# Hub.status.connected response is incorrect?

**URL:** <https://discuss.blues.com/t/hub-status-connected-response-is-incorrect/2221>\
**Category:** Troubleshooting\
**Created:** [July 18, 2024, 1:50am UTC](https://discuss.blues.com/t/hub-status-connected-response-is-incorrect/2221 "2024-07-18T01:50:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Meo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/meo/32/1183_2.png) [@Meo](https://discuss.blues.com/u/Meo)\
**Post date:** [July 18, 2024, 1:50am UTC](https://discuss.blues.com/t/hub-status-connected-response-is-incorrect/2221/1 "2024-07-18T01:50:51Z")

</div>

Hi! I just had something weird happen with my device and thought I’d report it.

I have the following code:

```auto
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:

![image](https://us1.discourse-cdn.com/flex020/uploads/blues/original/2X/a/ababdfe56c18b7bc08497b5ac12a659d98149ce5.png)

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.

```auto
[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!

---

<div class="post-metadata">

**Author:** ![RobLauer](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/roblauer/32/1567_2.png) [@RobLauer](https://discuss.blues.com/u/RobLauer)\
**Post date:** [July 22, 2024, 2:16pm UTC](https://discuss.blues.com/t/hub-status-connected-response-is-incorrect/2221/2 "2024-07-22T14:16:33Z")

</div>

Hi @Meo,

This is a good question. The `connected:true` response indicates that the Notecard has an active connection via whatever wireless transport mechanism it’s using **AND** that it has made a connection to Notehub. Without that response (like in your example) the Notecard may have made a successful cellular connection, but it hasn’t yet connected to Notehub. This shouldn’t take 30 seconds though. What firmware version of the Notecard are you on?

I don’t _think_ this is related, but I would also recommend reading up on the types of penalty boxes a Notecard can be in, especially the [Inability to Connect to Notehub](https://dev.blues.io/guides-and-tutorials/notecard-guides/understanding-notecard-penalty-boxes/#inability-to-connect-to-notehub) penalty box.

Rob

---

<div class="post-metadata">

**Author:** ![Meo](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.blues.com/meo/32/1183_2.png) [@Meo](https://discuss.blues.com/u/Meo)\
**Post date:** [July 23, 2024, 12:44am UTC](https://discuss.blues.com/t/hub-status-connected-response-is-incorrect/2221/3 "2024-07-23T00:44:34Z")

</div>

Hey, thanks for the response.

Okay, I appreciate the clarification. That’s helpful.

I bet you it was the penalty box. I was frequently turning my device on/off as I flashed new firmware onto it trying to triage an issue.

It would be nice if any penalty box issues were highlighted in the connection metadata if they’re preventing the initial connection from being established. I realize this is redundant, but seems like it’d be more clear.

Cheers
