Hello, we’ve got an imp004m ( impOS 40.7 ) that is being used to control a 2 channel 5v relay ( with an external power source ). Periodically, we’ve noticed that the two pins appear to stop working. Unfortunately, the device is not directly accessible by me which makes troubleshooting a bit difficult.
What we’ve seen is that the imp will work fine for most of the day, but at some point the output pins appear to stop working. The device will receive the message from the agent, log that it got the message with server.log(), set two pins LOW, sleep and log again when it wakes. At no point does the device disconnect or appear to be unresponsive, but the pins seem to not get set to a low state.
We’ve found that most of the time the device will self recover after a few hours or if someone physically disconnects/reconnects power that resolves the issue. During troubleshooting we have also tried restarts via the cloud console, and that doesn’t appear to resolve the issue either.
The code running on the device is very simple. It configures the pins, and listens for a message from the agent and triggers the relays.
relay_pin_1 <- hardware.pinM
relay_pin_1.configure(DIGITAL_OUT, 1)
relay_pin_2 <- hardware.pinN
relay_pin_2.configure(DIGITAL_OUT, 1);
function latch(msg) {
relay_pin_1.write(0);
relay_pin_2.write(0);
imp.sleep(8);
relay_pin_1.write(1);
relay_pin_2.write(1);
}
function handleLatchMsg(msg) {
// simplified
latch();
}
agent.on(“latch”, handleLatchMsg);
I’m not sure what “easy” answers exists, but I’m hoping to get some pointers as to where to look next. At this time we think that it’s a code issue or maybe an issue with the imp. We’ve ruled out shoddy pin header solders, and issues with the relay / associated wiring.
Thanks in advance for any ideas!