Get ASR-1 connection status from external MCU


#1

Hi,

Is there a way to know whether ASR-1 is able to connect to afero Cloud or not from external MCU?

I’m using afLib to send data from external MCU to ASR-1 via SPI.
The external MCU would send data to ASR-1 every 5 seconds.
There could be a case when ASR-1 has no peripheral HUBs to connect to, possibly 1 hour.
In that case, I think that the external MCU has to know the connection status of ASR-1 so that it could temporarily buffer data until ASR-1 goes online.

Thanks!!


#2

Hi, Wataru!

Unfortunately, right now, there is no way to know if an ASR-1 is connected to the cloud or not from the MCU.

Because the ASR-1 is a bluetooth device, it does not maintain a persistent connection to the cloud - it broadcasts an advertising packet that indicates it has data to send to the cloud, and a hub (usually the mobile app acting as a hub) will connect to the ASR-1, pick up the data that needs to be sent, and then disconnect. There would not be a stable “connected/not connected” status that the MCU would be able to read to know if there was a connection.

However, one of the pieces of information that the ASR-1 knows is whether an outgoing update is “pending” (un-sent) or not. This way, we could check the “pending” status of an attribute update and if we see that status go away, we’d know that the ASR-1 MUST have connected to the cloud in order to clear that status. It’s not a perfect “connection” flag, but it will tell you if the ASR-1 has connected to the cloud recently or not.

This pending status is not currently provided to the MCU through afLib, but we intend to provide that status in a future update to afLib. For now, I’m sorry, but I don’t have a workaround for you, but when we release the next version of afLib (hopefully not too long from now) you should be able to query this pending status to see if the ASR-1 is connecting to the cloud or not.

Thanks,

Joe


#3

Hi Joe,

Thank you for the response.

“pending” flag sounds good enough. Based on the flag, my external MCU could probably determine when to buffer data for later transmission.

I’m looking forward to the update.

Best,
Wataru