Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Companion Sometimes Not Available - Even When Socket Open

I don't have a great description of this issue unfortunately.

 

My watch face sends a message (reliably) to my companion app every 30 minutes on the half hour.  The companion app does some work, getting user location, getting data from a REST service, and then sending a message back to the face.  This process fails every so often, maybe once a day. 

 

  1. I know the socket is open and the message is attempted to be sent by the device (peerSocket.send), since I have an animation that only happens if the socket is open, and that is occurring.
  2. If I manually initiate the send again from the watch, the animation happens again (so the socket is open), and still no data is returned.
  3. I know that there was no call to the REST service, because I can see on the server that this didn't happen.
  4. Similarly, I know that there was no failure in a call to the service, because that would be logged.
  5. Also, I know that there was no failure in getting location, because that would be logged too.
  6. Here is the important one.  If I open the Fitbit app on the phone and let it sync, the requests (seemingly queued?) all go through.  The REST service is called (multiple times), the data makes it back to the watch, and the face is updated.  All is then good for the next day or so.

So it seems like the companion (iPhone X, w/Versa) is not waking up for messaging every now and then, yet is still registering on the Versa as an open socket.  

 

I tried setting a periodic timer to wake up the companion 5 seconds before I know the message will come through, but the issue still occurred.

 

Any suggestions?  Workarounds?  Solutions?  Is anyone else experiencing something similar?  Is this just due to iOS killing the background companion process?  If so, is there any way to avoid this?

 

This is irritating, because it means about once a day my watch face stops working and won't work again until the iOS app is opened.  This, of course, always happens when I'm driving and I shouldn't be fiddling around on my phone.

 

Thanks in advance for any help.

Best Answer
3 REPLIES 3

Hi, Have you found a solution? I have exactly the same problem...

Best Answer

Have you found a solution? 
I send data from my fitbit ionic to the phone. Other than checking:
if (messaging.peerSocket.readyState === messaging.peerSocket.OPEN)

there isn't much we can do. Also, some times the companion app is in a good state for this condition to be true, but it still doesn't receive anything. I don't ask for a socket to be always open or make things super reliable and have everything always ready, but at least it would be nice to understand what is the condition that doesn't let my device receive that data, and how can I do a check on that. At least I would know that I need to send those data again somehow.

Best Answer

This sounds like the same issue I'm having posted here. Been scratching my head over this for months and don't seem to find any fine grained ability to deal with it other than the readystate stuff outlined in the guide and reference which really doesn't allow us to affect the communications between the devices in any meaningful way, for example, making sure they can talk to each other every 5 minutes (in my case).

 

I'm currently suspecting that this has nothing to do with the versa but with the Fitbit phone app itself and how it is interacting with the Bluetooth subsystem.  It seems that they aren't playing well together and the Fitbit phone app occasionally looses it's BT connectivity footing and doesn't regain it well on it's own.  This forces the user to manually go into the app, click the device (Versa for me) and then the sync process happens as it should.  Which brings up the notion that "syncing" and companion messages/file transfers are linked in some way that we developers can't control well.  So, when the phone app can't sync on it's own for some reason, then all comms with the watch are dead in the water... but then when the user manually 'wakes the phone app up'... it syncs and then all comms start working for a while.  I do have all the settings enabled in the phone app to ensure "all day syncing" "notification widget", etc... None of that seems to ensure reliable device to companion communications.

 

I really wish this could get cleaned up and could work more reliably.

 

 

Best Answer