My Enviro Urban was running ok using Micro USB power (direct into the Pi Pico W board). I then switched to LIPO AMIGO PRO power with a 6700mAh Lithium Ion Battery Pack (BAT0013). Very soon, I got the red flashing LED, and a warning from Adafruit.io about data in the future.
This is what I found in the logs …
2022-12-02 14:44:56 [debug / 94kB] > 99 blocks free out of 212 2022-12-02 14:44:56 [debug / 92kB] > taking new reading 2022-12-02 14:44:56 [info / 123kB] - seconds since last reading: -1801331985 2022-12-02 14:44:56 [debug / 120kB] - starting sensor 2022-12-02 14:44:56 [debug / 118kB] - wait 5 seconds for airflow 2022-12-02 14:45:01 [debug / 99kB] - taking pms5003i reading 2022-12-02 14:45:01 [debug / 96kB] - taking microphone reading 2022-12-02 14:45:02 [debug / 94kB] > caching reading for upload 2022-12-02 14:45:02 [info / 88kB] > 11 cache file(s) need uploading 2022-12-02 14:45:02 [info / 86kB] > connecting to wifi network 'harpeople2' 2022-12-02 14:45:02 [info / 82kB] - ip address: 192.168.1.149 2022-12-02 14:45:02 [info / 120kB] > uploading cached readings to Adafruit.io: pgdh 2022-12-02 14:45:03 [info / 105kB] - uploaded 2022-12-02T14_45_02Z.json 2022-12-02 14:45:04 [debug / 90kB] - upload issue (422 b'Unprocessable Entity') 2022-12-02 14:45:04 [error / 88kB] ! failed to upload '2080-01-01T08_40_20Z.json' to adafruit_io 2022-12-02 14:45:04 [error / 86kB] ! reading upload failed 2022-12-02 14:45:04 [info / 84kB] > going to sleep
Upon further investigation …
pgdh$ mpremote connect /dev/cu.usbmodem314401 ls :uploads ls :uploads 254 2022-12-02T15_00_03Z.json 255 2080-01-01T08_40_20Z.json 254 2080-01-01T08_41_42Z.json 255 2080-01-01T08_42_19Z.json 254 2080-01-01T08_42_35Z.json 255 2080-01-01T08_42_50Z.json 255 2080-01-01T08_43_10Z.json 256 2080-01-01T08_43_29Z.json 254 2080-01-01T08_43_53Z.json 257 2080-01-01T08_44_22Z.json 255 2080-01-01T08_44_47Z.json pgdh$
i.e. the RTC is jumping to a crazy value - probably because it lost power for a brief period as I switched power sources.
Of course, once the upload code hits one of these files, it will retain it for next time, such that nothing will ever update again until the files are removed.
Note: I was pushing the wakeup button pretty regularly, but just getting the flashing red LED every time. The exact sequence of events is a bit hazy, as plugging in Thonny or using mpremote can mess with the the Pico’s brain and mine.
Has anyone else seen this?
I think I’ve may seen it before, as for a while I forced the NTP update on every connection. I think we should check that the RTC’s current time is later, but relatively close to last time, and then re-sync via NTP as necessary.
I’m running 0.0.9