· updates
Power Management

The web server wasn’t writing shut-down events to the logs. (Or, sometimes, it was just writing a string of null characters.) The problem was that the server was shutting down too soon, as the battery had run out of power before it had a chance to finish writing a log entry. This meant that the stats page wasn’t showing an accurate picture of server uptime.

I made some changes to the microcontroller script which sends boot up and shut-down instructions to the web server, based on the voltage being output by the battery. I set it much more conservatively, to send shut-down signals at a higher voltage threshold.

It’s a 12.8V battery. Now, the microcontroller sends a shut-down signal when the battery voltage is consistently below 12.7V. Previously a signal to shut down would be sent when it dropped below 12.2V. The battery’s state of charge drops off very rapidly, especially in winter time, so that didn’t leave enough time for the server to shut down cleanly.

Now it’s working consistently. However, because the settings are conservative, the server is online for fewer hours. For now, it’s up and running for about 3-5 hours per day, on average. I may reduce the threshold for booting the server: at the moment the battery has to put out 13V or more for at least 30 secs before the server gets a boot-up signal. I may try reducing this to 2.9V, to see if it will result in longer uptimes.

Microcontroller script:
https://codeberg.org/mikekelly/solarpi