Adafruit_Learning_System_Guides
Adafruit_Learning_System_Guides copied to clipboard
Star_Fragment_Lamp code has an issue with sunrise
Board flashed with adafruit-circuitpython-adafruit_qtpy_esp32s2-en_GB-8.2.4.uf2 Used CircuitPython 8.x code / library version
The lamp has no issues with determining sunset and approx.one hour outy and slowly increasing brightness till sunset is reached:
17:13:32.913 -> pinging Open-Meteo 17:13:40.931 -> struct_time(tm_year=2023, tm_mon=8, tm_mday=29, tm_hour=17, tm_min=13, tm_sec=40, tm_wday=2, tm_yday=241, tm_isdst=0) 17:13:40.976 -> 0 hour(s) until sunset 17:13:40.976 -> 48 minutes(s) until sunset 17:13:40.976 -> 2023-08-29T18:02 17:13:40.976 -> 0 17:13:40.976 -> 17:13:40.976 -> pinging Open-Meteo 17:13:48.915 -> struct_time(tm_year=2023, tm_mon=8, tm_mday=29, tm_hour=17, tm_min=13, tm_sec=47, tm_wday=2, tm_yday=241, tm_isdst=0) 17:13:48.959 -> 0 hour(s) until sunset 17:13:48.959 -> 48 minutes(s) until sunset <<--approx one hour hout it goes into teh countown loop increasing LED brightness 17:13:48.959 -> 2023-08-29T18:02 17:13:48.959 -> 47.5424 17:13:48.959 ->
Once sunset time is reached "the star is glowing" waits till after midnight to look for sunrise:
18:00:03.974 -> pinging Open-Meteo 18:00:11.164 -> struct_time(tm_year=2023, tm_mon=8, tm_mday=29, tm_hour=18, tm_min=0, tm_sec=10, tm_wday=2, tm_yday=241, tm_isdst=0) 18:00:11.164 -> 0 hour(s) until sunset 18:00:11.164 -> 1 minutes(s) until sunset 18:00:11.164 -> 2023-08-29T18:02 18:00:11.164 -> 229.068 18:00:11.164 -> 18:05:04.015 -> pinging Open-Meteo 18:05:11.282 -> struct_time(tm_year=2023, tm_mon=8, tm_mday=29, tm_hour=18, tm_min=5, tm_sec=10, tm_wday=2, tm_yday=241, tm_isdst=0) 18:05:11.315 -> 23 hour(s) until sunset 18:05:11.315 -> 56 minutes(s) until sunset 18:05:11.315 -> 2023-08-29T18:02 18:05:11.315 -> 250.678 18:05:11.315 -> 18:05:11.315 -> star is glowing 18:30:06.932 -> not looking for sunrise 18:30:06.979 -> struct_time(tm_year=2023, tm_mon=8, tm_mday=29, tm_hour=18, tm_min=30, tm_sec=6, tm_wday=2, tm_yday=241, tm_isdst=0) 18:30:06.979 ->
The trouble is that approx. 1 hour out from sunrise, instead of counting down to sunrise and decreasing brightness, the star is instead turned off and the lamp goes back to looking for sunset:
05:26:57.051 -> 05:41:49.895 -> pinging Open-Meteo 05:41:57.433 -> struct_time(tm_year=2023, tm_mon=8, tm_mday=29, tm_hour=5, tm_min=41, tm_sec=57, tm_wday=2, tm_yday=241, tm_isdst=0) 05:41:57.479 -> 0 hour(s) until sunrise 05:41:57.479 -> 59 minutes(s) until sunrise 05:41:57.479 -> 2023-08-29T06:40 05:41:57.479 -> struct_time(tm_year=2023, tm_mon=8, tm_mday=29, tm_hour=5, tm_min=41, tm_sec=57, tm_wday=2, tm_yday=241, tm_isdst=0) 05:41:57.479 -> 05:41:57.479 -> 0 hour(s) until sunrise 05:41:57.479 -> 59 minutes(s) until sunrise 05:41:57.479 -> 2023-08-29T06:40 05:41:57.479 -> struct_time(tm_year=2023, tm_mon=8, tm_mday=29, tm_hour=5, tm_min=41, tm_sec=57, tm_wday=2, tm_yday=241, tm_isdst=0) 05:41:57.479 -> 05:41:57.479 -> star is off <<-- one hour out instead of counting down the lamp is turned off 05:56:49.925 -> pinging Open-Meteo 05:56:57.751 -> struct_time(tm_year=2023, tm_mon=8, tm_mday=29, tm_hour=5, tm_min=56, tm_sec=56, tm_wday=2, tm_yday=241, tm_isdst=0) 05:56:57.751 -> 12 hour(s) until sunset 05:56:57.751 -> 4 minutes(s) until sunset 05:56:57.751 -> 2023-08-29T18:02 05:56:57.751 -> 0