I have an Imp that is used to communicate with a 4x4 HDMI matrix from monoprice over the UART. It has been working wonderfully until recently (maybe a few months ago) I started having problems when I couldn’t communicate with the Imp.
According to the logs, the Imp continually disconnects from the Wireless every 5 minutes or so. When it’s connected, it works fine, but once it disconnects, I cannot get it to reconnect (even if I re-blink it) until it connects on its own.
Here is a snippet from my logs:
2014-11-10 08:35:33 UTC-5 [Status] Device Booting; 3.37% program storage used 2014-11-10 08:36:35 UTC-5 [Status] Device disconnected 2014-11-10 08:36:42 UTC-5 [Status] Device Booting; 3.37% program storage used 2014-11-10 08:41:29 UTC-5 [Status] Device disconnected 2014-11-10 08:41:31 UTC-5 [Status] Device Booting; 3.37% program storage used 2014-11-10 08:43:13 UTC-5 [Status] Device disconnected 2014-11-10 08:43:15 UTC-5 [Status] Device Booting; 3.37% program storage used 2014-11-10 08:52:33 UTC-5 [Status] Device disconnected 2014-11-10 08:52:38 UTC-5 [Status] Device Booting; 3.37% program storage used 2014-11-10 08:58:23 UTC-5 [Status] Device disconnected 2014-11-10 09:18:45 UTC-5 [Exit Code] imp restarted, reason: wifi outage 2014-11-10 09:18:45 UTC-5 [Status] Device Booting; 3.37% program storage used 2014-11-10 09:24:45 UTC-5 [Status] Device disconnected 2014-11-10 09:24:45 UTC-5 [Status] Device Booting; 3.37% program storage used 2014-11-10 10:09:30 UTC-5 [Agent] { "input2": "PS3", "input3": "GoogleTV", "input4": "PC", "input2On": true, "output2": "Basement", "output3": "Dan's Office", "output4": "Liz's Office", "input1On": false, "input1": "XBox", "memD": 2, "memC": 2, "memB": 4, "memA": 3, "input4On": false, "output1On": false, "output1": "Living Room", "output4On": false, "input3On": true, "output2On": true, "output3On": true, "out4": 2, "out1": 3, "out2": 2, "out3": 3 } 2014-11-10 10:24:47 UTC-5 [Status] Device disconnected
The code is simple:
`function changeMatrix(command)
{
//hardware.configure(UART_57);
hardware.uart57.configure(9600, 8, PARITY_NONE, 1, NO_CTSRTS);
if (command != 255)
{
local notCommand = 255 - command;
server.log("command: " + command + " notCommand: " + notCommand);
hardware.uart57.write(command);
imp.sleep(0.06);
hardware.uart57.write(notCommand);
imp.sleep(0.06);
hardware.uart57.write(0xD5);
imp.sleep(0.06);
hardware.uart57.write(0x7B);
}
imp.sleep(0.06);
local startbit = 0;
do {
startbit = hardware.uart57.read();
}while(startbit != 0x61)
local status = blob(9);
for (local i = 0; i < 9; i += 1)
{
status.writen(hardware.uart57.read(), ‘b’);
}
agent.send(“status”, status);
hardware.uart57.disable();
}
agent.on(“change”, changeMatrix);
`
The HDMI matrix continuously sends data over the uart, which may be a problem? Also, I have a Netgear WNR3500L, which is placed about a foot from the Imp.
Thank you for your help!