I have an Electric Imp impExplorer Kit and it was running fine until I tried to let it run till failure on batteries to see how long it would last. I’m pulling temperature & humidity from the onboard sensors. Since I plugged it in I now get the following errors:
|2018-05-04 16:08:47 -04:00|[Status]|Device connected| |—|---|—|
|2018-05-04 16:08:48 -04:00|[Device]|ERROR: I2C write error: -1|
|2018-05-04 16:08:48 -04:00|[Device]|ERROR: in _setReg …mp#hts221.device.lib.nut#2.0.1:239|
|2018-05-04 16:08:48 -04:00|[Device]|ERROR: from _getCalibrationVariables …mp#hts221.device.lib.nut#2.0.1:251|
|2018-05-04 16:08:48 -04:00|[Device]|ERROR: from constructor …mp#hts221.device.lib.nut#2.0.1:86|
|2018-05-04 16:08:48 -04:00|[Device]|ERROR: from main device_code:20|
|2018-05-04 16:08:53 -04:00|[Status]|Device disconnected|
Line 20 refers to the I2c initilization:
tempHumid <- HTS221(hardware.i2c89);
Code was running fine and I suspect the power failure caused it. Any toughts on fixing the issue? I’ll try to grab another imp on Monday to validate that the code is not problem.
Here’s the code until the device fails and reboots:
#require “HTS221.device.lib.nut:2.0.1”
#require “LPS22HB.device.lib.nut:2.0.0”
#require “LIS3DH.device.lib.nut:2.0.1”
#require “WS2812.class.nut:3.0.0”
//LED variables
spi <- null;
led <- null;
state <- false;
hardware.i2c89.configure(CLOCK_SPEED_400_KHZ);
server.log(hardware.i2c89.readerror());
//tempHumid <- HTS221(hardware.i2c89, 0xBE);
tempHumid <- HTS221(hardware.i2c89);