Debugging a Weather Station 2
My Pimoroni weather station had stopped logging data. It had stopped at some point over the winter - I kept meaning to take it down and see what was wrong - but it lives 20’ up in the air, and it was winter.
Today I took a look. I cut away the vines growing up the pole, took down the poles and rediscovered I had greased them last year.
The board looked fine; the conformal coating had worked. I evicted a desiccated wasp from the board and applied power. The only sign of life was a brief flash of a white LED, then nothing. In normal operation, the while LED fades up and down in brightness as the board attempts to establish a wifi connection; if it fails, the LED blinks red.
I took the board inside and connected to it with Thonny. I could see the board was still alive, code was running, but the log just showed an error connecting to my influxdb endpoint. I checked the endpoint; I already knew it was running since other things depend on it, but it’s worth checking anyway.
Digging into the code as best my limited python skills allow, I found an issue with the influx bucket the code was trying to fill. Comparing the code on the device and the copy on github, I found no differences. I was about to nuke the board and refresh a brand new version of the code, when I noticed the config file had a mistake: a ‘b’ in influx_bucket had become a ‘j’ so it read influx_jucket
A suspicious single bit error - in ASCII “b” and “j” are one bit apart.
I fixed the error in the config, backed it up and for good measure, reflashed the board with the newest firmware. If I had a bit flip error in a config file, there may be more.
I still need to design my own weather station.