Some scripts/C/Java for the Raspberry Pi server. powermng.c manages power for the RPi based on battery SoC and grid state, eg dumping some excess power to a load taken from grid at optimal times. Some key updates: 2016/09/25: B1 temperature logging and compensation. 2016/09/24: created BATT1_MINUSAGE_mV_per_day; tiered 'e' dump triggers by days. 2016/09/17: attempt to suppress dump oscillation with tweaked thresholds. 2016/09/11: commented out most of B2 (Li) code. 2016/09/11: dump margin and sag calcs now dynamic with load compensation. 2016/09/10: more cautious after reboot in reliance on last-VHIGH flag timing. 2016/09/10: added live calc of implied supply impedance to RPi. 2016/09/09: made time since VHIGH determinant of less aggressive dumping. 2016/09/07: prioritised dump load triggers further. 2016/09/01: dumping less aggressive if battery not FULL for several days. 2016/09/01: moving locking to mbacess to be shared by the command-line tools. 2016/08/30: encouraging dump is battery > 'medium' and grid not 'green'. 2016/08/28: added FULL state (>=VH and battery in float) and flags. 2016/08/25: split out separate mbaccess.cpp wrapper.