Hi! I just had something weird happen with my device and thought I’d report it.
I have the following code:
bool isModemConnected()
{
bool isModemConnected = false;
J *hubStatusRequest = notecard.newRequest("hub.status");
J *response = notecard.requestAndResponse(hubStatusRequest);
isModemConnected = JGetBool(response, "connected");
notecard.deleteResponse(response);
Serial.print("Modem connected?: ");
Serial.println(isModemConnected);
return isModemConnected;
}
Most of the time this code works as expected. However, sometimes I see things in a weird state:
Here it looks to me like hub.status
is indicating that the modem has successfully connected, but the connected
result is still 0?
I poll the modem every 30 seconds waiting for the issue to resolve, but it doesn’t. The status never changes.
Then I kill power to my device, then restart it, and the issue resolves itself with me having changed no code.
[INFO] {"req":"hub.set","mode":"continuous","outbound":60,"inbound":60,"duration":60,"crc":"0001:7ECDB008"}
[INFO] {}
turnOnModem successful.
[INFO] {"req":"hub.status","crc":"0002:5874FEF1"}
[INFO] {"status":"4s starting communications {wait-module} {connecting}"}
Modem connected?: 0
[INFO] {"req":"hub.status","crc":"0003:5874FEF1"}
[INFO] {"status":"29s waiting for wireless service {wait-service} {connecting}"}
Modem connected?: 0
[INFO] {"req":"hub.status","crc":"0004:5874FEF1"}
[INFO] {"connected":true,"status":"connected (session open) {connected}"}
Modem connected?: 1
[INFO] {"req":"web.get","route":"GetSchedules","crc":"0005:5328B37A"}
[INFO] {"result":200,"body":{"schedules":[{"days_of_week":["thursday"],"duration":11,"minutes_past_midnight":1218}]}}
Schedule Count:0
[INFO] {"req":"hub.set","mode":"off","crc":"0006:C0794E2C"}
[INFO] {}
turnOffModem successful.
I’ve had this happen twice in the last hour of development. It’s not clear to me if I’m misunderstanding something or if I’m bumping into a bug.
Thanks!