sensor archive logging added

added mysql failure resistance (reconnect every 5 seconds), mysql can
drop at any time