10-11-2017 18:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-11-2017 18:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-12-2017 01:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-12-2017 04:17
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-12-2017 15:34
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-12-2017 15:36
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
@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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

10-14-2017 05:43
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-26-2017 14:01
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-26-2017 15:20
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


11-27-2017 12:39
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@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
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-27-2017 14:04
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
According to Windows Store there is no available update. In the about it shows version 2.27.1318(49165).

11-29-2017 10:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


11-29-2017 10:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@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.

