diff --git a/Notizen.md b/Notizen.md new file mode 100644 index 0000000..4bc3fb5 --- /dev/null +++ b/Notizen.md @@ -0,0 +1,128 @@ +# Notizen + +## Idee + +Der Raspberry Pi Pico soll am Vorabend schauen, welche Abfallart am folgenden Tag abgeholt wird. Dementsprechend soll er eine RGB-LED schalten: + +* Keine Abholung: SCHWARZ (aus, 0x000000) + * ggf. kurzes, minütliches blinken in WEIß (0xffffff / 0x000000) +* Restmüll: ROT (0xff0000) +* Papier: BLAU (0x0000ff) +* Gelber Sack: GELB (0xffff00) +* Bio: GRÜN (0x00ff00) + +Bei mehreren Abholungen sollen die Farben im Wechsel (5 Sek?) angezeigt werden. + +## Abfall API + +Der Landkreis Reutlingen verwendet die API [api.abfall.io](). + + +* f_id_kommune (Dettingen): 1258 +* f_id_strasse (Eichendorffstr.): 1258eichendorffstrasse +* f_id_strasse_hnr (6): 25938 +* f_id_abfalltyp_0 (Restmülltonne): 31 +* f_id_abfalltyp_1 (Biotonne): 50 +* f_id_abfalltyp_2 (Papiertonne): 19 +* f_id_abfalltyp_3 (Gelber Sack): 17 +* f_id_abfalltyp_4 (Problemstoffmobil): 44 +* f_zeitraum (2023): 20230101-20231231 +* f_abfallarten_index_max: 5 +* f_abfallarten: 31,50,19,17,44 + +Request-URL: ` +https://api.abfall.io/?key=514199db585ea04541fe70feead6315f&modus=d6c5855a62cf32a4dadbc2831f0f295f&waction=export_csv +` + +Content-Type: `application/x-www-form-urlencoded` + +Request-Body: +```json +[ + { + "key": "e2368c5c4cf4e863ea77c5649c17f9cf", + "value": "121c322b9e8e8bf0e46c93812449e484" + }, + { + "key": "f_abfallarten", + "value": "31,50,19,17,44" + }, + { + "key": "f_abfallarten_index_max", + "value": "5" + }, + { + "key": "f_export_als", + "value": "{'action':'https://api.abfall.io/?key=514199db585ea04541fe70feead6315f&modus=d6c5855a62cf32a4dadbc2831f0f295f&waction=export_csv','target':''}" + }, + { + "key": "f_id_abfalltyp_0", + "value": "31" + }, + { + "key": "f_id_abfalltyp_1", + "value": "50" + }, + { + "key": "f_id_abfalltyp_2", + "value": "19" + }, + { + "key": "f_id_abfalltyp_3", + "value": "17" + }, + { + "key": "f_id_abfalltyp_4", + "value": "44" + }, + { + "key": "f_id_kommune", + "value": "1258" + }, + { + "key": "f_id_strasse", + "value": "1258eichendorffstrasse" + }, + { + "key": "f_id_strasse_hnr", + "value": "25938" + }, + { + "key": "f_posts_json[]", + "value": "a:2:{s:32:\"e2368c5c4cf4e863ea77c5649c17f9cf\";s:32:\"121c322b9e8e8bf0e46c93812449e484\";s:12:\"f_id_kommune\";s:4:\"1258\";}" + }, + { + "key": "f_posts_json[]", + "value": "a:4:{s:32:\"e2368c5c4cf4e863ea77c5649c17f9cf\";s:32:\"121c322b9e8e8bf0e46c93812449e484\";s:12:\"f_id_kommune\";s:4:\"1258\";s:12:\"f_posts_json\";a:0:{}s:12:\"f_id_strasse\";s:22:\"1258eichendorffstrasse\";}" + }, + { + "key": "f_posts_json[]", + "value": "a:5:{s:32:\"e2368c5c4cf4e863ea77c5649c17f9cf\";s:32:\"121c322b9e8e8bf0e46c93812449e484\";s:12:\"f_id_kommune\";s:4:\"1258\";s:12:\"f_posts_json\";a:1:{i:0;s:117:\"a:2:{s:32:\"e2368c5c4cf4e863ea77c5649c17f9cf\";s:32:\"121c322b9e8e8bf0e46c93812449e484\";s:12:\"f_id_kommune\";s:4:\"1258\";}\";}s:12:\"f_id_strasse\";s:22:\"1258eichendorffstrasse\";s:16:\"f_id_strasse_hnr\";s:5:\"25938\";}" + }, + { + "key": "f_zeitraum", + "value": "20220101-20221231" + } +] + +``` + + +Intercepted: +``` +URL : https://api.abfall.io/?key=514199db585ea04541fe70feead6315f&modus=d6c5855a62cf32a4dadbc2831f0f295f&waction=export_csv + +Header: +Method : POST +host : api.abfall.io +Accept : text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 +sec-ch-ua : "Not?A_Brand";v="8", "Chromium";v="108", "Google Chrome";v="108" +User-Agent : Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 +Content-Type : application/x-www-form-urlencoded +sec-ch-ua-mobile : ?0 +sec-ch-ua-platform : "Linux" +Upgrade-Insecure-Requests : 1 + +Body: +[{"key":"e2368c5c4cf4e863ea77c5649c17f9cf","value":"121c322b9e8e8bf0e46c93812449e484"},{"key":"f_abfallarten","value":"31,50,19,17,44"},{"key":"f_abfallarten_index_max","value":"5"},{"key":"f_export_als","value":"{'action':'https://api.abfall.io/?key=514199db585ea04541fe70feead6315f&modus=d6c5855a62cf32a4dadbc2831f0f295f&waction=export_csv','target':''}"},{"key":"f_id_abfalltyp_0","value":"31"},{"key":"f_id_abfalltyp_1","value":"50"},{"key":"f_id_abfalltyp_2","value":"19"},{"key":"f_id_abfalltyp_3","value":"17"},{"key":"f_id_abfalltyp_4","value":"44"},{"key":"f_id_kommune","value":"1258"},{"key":"f_id_strasse","value":"1258eichendorffstrasse"},{"key":"f_id_strasse_hnr","value":"25938"},{"key":"f_posts_json[]","value":"a:2:{s:32:\"e2368c5c4cf4e863ea77c5649c17f9cf\";s:32:\"121c322b9e8e8bf0e46c93812449e484\";s:12:\"f_id_kommune\";s:4:\"1258\";}"},{"key":"f_posts_json[]","value":"a:4:{s:32:\"e2368c5c4cf4e863ea77c5649c17f9cf\";s:32:\"121c322b9e8e8bf0e46c93812449e484\";s:12:\"f_id_kommune\";s:4:\"1258\";s:12:\"f_posts_json\";a:0:{}s:12:\"f_id_strasse\";s:22:\"1258eichendorffstrasse\";}"},{"key":"f_posts_json[]","value":"a:5:{s:32:\"e2368c5c4cf4e863ea77c5649c17f9cf\";s:32:\"121c322b9e8e8bf0e46c93812449e484\";s:12:\"f_id_kommune\";s:4:\"1258\";s:12:\"f_posts_json\";a:1:{i:0;s:117:\"a:2:{s:32:\"e2368c5c4cf4e863ea77c5649c17f9cf\";s:32:\"121c322b9e8e8bf0e46c93812449e484\";s:12:\"f_id_kommune\";s:4:\"1258\";}\";}s:12:\"f_id_strasse\";s:22:\"1258eichendorffstrasse\";s:16:\"f_id_strasse_hnr\";s:5:\"25938\";}"},{"key":"f_zeitraum","value":"20220101-20221231"}] +```