Best way to determine based on API whether the Notecard is having difficulty connecting to cell network?

I am looking for a boolean indicator of whether or not the Notecard is having trouble connecting to a cell network, so that I can light an LED on our Feather to indicate that for troubleshooting. That seems simple, but I’ve been having trouble finding a reliable way to get that info.

I disconnected the antenna from my board to simulate connection problems. The best way I can find to tell that there is an issue is to do hub.sync.status. The problem here is that many of the fields in this response are completely different depending on what’s going on. For example, there is an “alert” property that indicates a problem, but that field is only there on some responses. Can I infer by the absence of this property that everything is cool? There is also a “mode” property, but I don’t have a list of what the possible modes are or what they mean, so it’s tough to programmatically check that field to make a determination.

I suspect there is a super easy approach that I am missing and I will feel dumb but relieved at the reply I get. Can anyone suggest a clean approach to determining whether a Notecard is unable to connect?

Scott

1 Like