10-11-2017 18:12
10-11-2017 18:12
I am trying to get the BART example working, but the peersocket readystate never moves to open, so data is never sent to the Ionic. The console logging shows that the data is being fetched correctly, it just never passes the readstate==open check. I do have a solid bluetooth connection between my Ionic and my device.
Does anyone know if something is missing from the example or what may be wrong?
10-12-2017 01:22
10-12-2017 01:22
Are you also enabling the Developer Bridge on the Fitbit App in your mobile phone? If this is not enabled, this could be the reason why the peersocket is not working.
10-12-2017 04:17
10-12-2017 04:17
It is enabled, otherwise it would not deploy and I would not have seen the results of the HTTP fetch.
10-12-2017 15:34
10-12-2017 15:34
Try to put a console.log message on the receiving end to see if the message is passed. Also, I always have to try few times to run the app I am developing before seeing the message.
E.g. in the app/index.js
// Listen for messages from the companion
messaging.peerSocket.onmessage = function() {
console.log("received data");
}
10-12-2017 15:36
10-12-2017 15:36
@agsurf5, the code does already have that and it is not firing. There are console.logs all over the place and it never shows readystate=open so it never gets to sending the message. I did try having it send anyway, but that threw an error that it wasn't connected as I expected it would.
10-14-2017 05:43
10-14-2017 05:43
Looks like the problem may be the Windows 10 Fitbit app. The peerSocket does not open on the companion on either Windows 10 Pro or Windows 10 Mobile, tried using my Kindle Fire HD8 and first try it showed the readyState===Open and it got to sending the message.
11-26-2017 14:01
11-26-2017 14:01
I am having the same issue on Lumia 950. Setting works fine for built-in clock faces, but not for my own app. I am also having issues with the weather app - it is working for a few days and then it stops suddenly - I have to uninstall/reinstall the phone app to get it working again.
11-26-2017 15:20
11-26-2017 15:20
Ok I got it working on Windows 10 Mobile:
The socket opens fine, but it is the "messaging.peerSocket.readyState === messaging.peerSocket.OPEN" part that does not work. Changing this check in the companion code to "messaging.peerSocket.readyState == 0" fixed the issue.
11-27-2017 12:39
11-27-2017 12:39
@jimm98y wrote:
Ok I got it working on Windows 10 Mobile:
The socket opens fine, but it is the "messaging.peerSocket.readyState === messaging.peerSocket.OPEN" part that does not work. Changing this check in the companion code to "messaging.peerSocket.readyState == 0" fixed the issue.
I know the open and closed constants were missing in one of the releases. Is the Fitbit windows mobile app up to date?
11-27-2017 14:04
11-27-2017 14:04
According to Windows Store there is no available update. In the about it shows version 2.27.1318(49165).
11-29-2017 10:09
11-29-2017 10:09
@jimm98y wrote:
According to Windows Store there is no available update. In the about it shows version 2.27.1318(49165).
It's fixed in the next version, which should be available within the next few days.