08-18-2022 19:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-18-2022 19:44
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Dear Development Team
I am currently trying to GET and POST to a homebrew API.
However, it is not working.
It works well in the fitbit OS simulator and
I have confirmed both GET and POST connections to the API from my smartphone browser as well.
Only in fitbitAPP, it does not work.
Do you know the cause?
Below is the source code that I have reduced to a minimum to determine the cause.
import * as messaging from "messaging";
messaging.peerSocket.addEventListener("message", (evt) => {
fetch('http://172.30.0.63:8001/select/1',{
method: 'GET',
})
.then(json => {console.log(json);})
.catch(error => {console.log(error);})
.then(response => {console.log(response);});
});
The output of console.log(error) is
TypeError:Failed to fetch
Of course, the output of console.log(response) is
undefined
I continue to worry. Please help me.
Answered! Go to the Best Answer.
Accepted Solutions
08-18-2022 20:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-18-2022 20:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
On Android, there are only a few IPs you can use without https (for which you'd need a non-self-signed certificate): see here.
A recent Fitbit app update broke ALL http from working; see here. There have been a few updates since then, but I don't know whether the problem has been fixed.
Gondwana Software

08-18-2022 19:56
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-18-2022 19:56
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Companion phone is Android or iOS?
Gondwana Software

08-18-2022 19:58
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-18-2022 19:58
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi @TNakamura - this may have a bearing. No internet connection especially if you have a recent Android phone, Private DNS may be the issue.
Author | ch, passion for improvement.

08-18-2022 19:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-18-2022 19:59
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks for the reply! I use Android

08-18-2022 20:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-18-2022 20:42
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
On Android, there are only a few IPs you can use without https (for which you'd need a non-self-signed certificate): see here.
A recent Fitbit app update broke ALL http from working; see here. There have been a few updates since then, but I don't know whether the problem has been fixed.
Gondwana Software

08-18-2022 21:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-18-2022 21:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@Guy_ Thanks for the reply!
I checked the Android settings and the private DNS feature was turned off.
Perhaps this does not affect you?
I'm a newbie, so I don't understand a lot of things, and I'm sorry for the confusion, but thank you in advance for your help!

08-18-2022 21:17
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-18-2022 21:17
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@TNakamura - are you using 3.65 or later version of the Fitbit App and did you check the other issues in the link I sent?
Author | ch, passion for improvement.

08-18-2022 21:37
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-18-2022 21:37
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
The fitbit version must be 3.65 or later, and
not using a VPN connection
Adblock software is not running
security software is not running
Private DNS is not set up.
I have checked everything and there is no change.
08-18-2022 21:41
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-18-2022 21:41
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
The IP address you're trying to use can't work. Did you see my post?
Gondwana Software

08-18-2022 21:43
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-18-2022 21:43
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@TNakamura - thanks for the feedback, at least you are sure it's none of that.
3.65.1 will probably make no difference.
Was worth verifying.
Author | ch, passion for improvement.

08-18-2022 21:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-18-2022 21:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks for getting back to me! I will try the change to https.
But attaching the certificate, that's a pain in the **ahem**...
That helped! Thanks!

08-18-2022 21:58
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-18-2022 21:58
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Yeah, I gave up trying to install non-self-signed cert on Windows. You can normally use http on the same device as the Fitbit app (ie, your phone). Or use https to a full-on web server or service; eg, Heroku.
Gondwana Software

08-18-2022 22:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-18-2022 22:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Thanks for the info!
Regarding the former, is that meant to be an API embedded in the phone itself?
I'm learning a lot about Heroku, etc. I will look into it. Thanks!

08-18-2022 22:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post


08-18-2022 22:22
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
On the phone, I've used node.js hosted within dory-node, and also written a native Java app accessing the Android API. I think the latter is on the Fibit ossapps repo.
Gondwana Software

