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

Unreliable communication between device and companion

I have been running into an issue where updating settings or getting weather/GPS fails and doesn't recover unless the user cycles Bluetooth on their phone. It's seemingly random as well, I'm have been using the public branch of my watch face and haven't experienced the issue. But once every few weeks I get an email from someone saying they can't change settings or thing's aren't updating. And the fix 95% of the time is cycling their Bluetooth.

 

I am only updating weather/GPS once an hour and I'm updating settings on "messaging.peerSocket.onmessage". Is there a more reliable way to handle the connection? Are there any other way's to handle this to guarantee a stable connection? 

Best Answer
0 Votes
7 REPLIES 7

I don't think there's a way to guarantee a stable bluetooth connection. You might have better results using file transfer instead of messaging. File transfer attempts to resend failed communications, whereas messaging can just drop them. In addition, I suspect that the messaging connection doesn't automatically reopen when a socket is re-established.

 

However, file transfer still uses bluetooth, so it's still susceptible to the vagaries of bluetooth at the hardware/OS level.

Peter McLennan
Gondwana Software
Best Answer
0 Votes

Can you build even "json files" on the companion side? I'm currently building json strings and sending it over as a message. But the documentation for the file systems state is device side only.  Or does the companion just send a the raw data of the file over as a string?

Best Answer
0 Votes

Anything you can put in a file can be sent using file transfer. The data doesn't have to be a string (from your point of view). Binary data (such as images) can be sent.

 

While you don't get direct access to the file system on the companion, you can use file transfer to send data that will be stored in a file on the watch.

 

Peter McLennan
Gondwana Software
Best Answer
0 Votes

@T_mex wrote:

Can you build even "json files" on the companion side? I'm currently building json strings and sending it over as a message. But the documentation for the file systems state is device side only.  Or does the companion just send a the raw data of the file over as a string?


Javascript Object Notation is not just a file type.

 

You can pretty much always use JSON.stringify() and JSON.parse() on the app, the companion and even in the settings JSX page. 

Best Answer
0 Votes

@T_mex wrote:

I have been running into an issue where updating settings or getting weather/GPS fails and doesn't recover unless the user cycles Bluetooth on their phone. It's seemingly random as well, I'm have been using the public branch of my watch face and haven't experienced the issue. But once every few weeks I get an email from someone saying they can't change settings or thing's aren't updating. And the fix 95% of the time is cycling their Bluetooth.

 

I am only updating weather/GPS once an hour and I'm updating settings on "messaging.peerSocket.onmessage". Is there a more reliable way to handle the connection? Are there any other way's to handle this to guarantee a stable connection? 


I'm with Peter on this one. There is no real way to guarantee a stable Bluetooth connection. People move away from their phones, the internet is not actually everywhere, and microwave ovens exist.

 

You have to program your comms with the idea that they may have to wait, and will have to try again, without flooding the connection. And,... no matter how well you do, the Bluetooth itself may just hang. 

 

I think everyone eventually just gets used to restarting their phones every couple of days.😱

 

Regards,

Reign

Best Answer
0 Votes


Javascript Object Notation is not just a file type.

 

You can pretty much always use JSON.stringify() and JSON.parse() on the app, the companion and even in the settings JSX page. 

@morningReign wrote:

@T_mex wrote:

I have been running into an issue where updating settings or getting weather/GPS fails and doesn't recover unless the user cycles Bluetooth on their phone. It's seemingly random as well, I'm have been using the public branch of my watch face and haven't experienced the issue. But once every few weeks I get an email from someone saying they can't change settings or thing's aren't updating. And the fix 95% of the time is cycling their Bluetooth.

 

I am only updating weather/GPS once an hour and I'm updating settings on "messaging.peerSocket.onmessage". Is there a more reliable way to handle the connection? Are there any other way's to handle this to guarantee a stable connection? 


I'm with Peter on this one. There is no real way to guarantee a stable Bluetooth connection. People move away from their phones, the internet is not actually everywhere, and microwave ovens exist.

 

You have to program your comms with the idea that they may have to wait, and will have to try again, without flooding the connection. And,... no matter how well you do, the Bluetooth itself may just hang. 

 

I think everyone eventually just gets used to restarting their phones every couple of days.😱



_____________________________________________________

 

To reply to both of these.

 

Yes, but reading the documentation it looks like it's expecting a file path. Rather than information stored just in ram. So I'm unclear on the functionality of file transfer vs just messages, other than that messages can send raw data rather than requiring a file path.

_____________________________________________________

The issue isn't about not getting weather or GPS, that is understandable. The issue is that the Bluetooth fails even when just trying to change the settings. I'm not requesting any data from the phone outside of the 30 min request for weather. So it's not a overload on failed messages.

 

Yes people walk away from their phone, but steps and HR are syncing even after returning to their phone. The issue seems to be isolated to the phone sending a message to the watch from the companion. The issue also isn't the bluetooth hanging, it's when the connection between the watch and the phone fails it doesn't seem to recover on the companion side.

 

Also The issue continues even after a phone restart. So I don't know if turning off the bluetooth while the app is running forces a CASH clear, but it seems to be the only fix. Beyond uninstalling the fitbit app.

 

 

Best Answer
0 Votes

On the companion, you don't specify a file path that indicates the data you want to send. You specify a file name which will be used to store the data on the watch. The data is indeed from RAM on the companion.

 

This might help.

Peter McLennan
Gondwana Software
Best Answer
0 Votes