04-10-2020 04:26
04-10-2020 04:26
Hi all
I hope everyone is safe during these uncertain times 🙂
First time poster on this forum, although i have been using the resources available for the last couple of months.
I am currently trying to post my accelerometer data from the companion app to another server. First of all, is this possible. I have a neural network developed using Python, and i want to make predictions using the data sent from the companion app. I have set up a Flask server to receive the post request from my companion app. The data has successfully been transferred from the Fitbit app/index.js file to the companion/index.js file. From there, i can't seem to post the data to the Flask server. The data is a Json Object and runs every 5 seconds as per the examples i have seen on Github.
I guess i am asking if this is possible to do and if not is there another way that it could be done. Maybe posting directly to a MySQL or real-time Firebase DBs. If anyone has any ideas or code examples that would be much appreciated as i want to make the most of this lockdown period.
Many thanks in advance
04-10-2020 13:35
04-10-2020 13:35
When you say 'post', I assume you're using fetch(). That should work, although I know nothing about Flask. The only gotcha from the Fitbit side should be the use of https rather than http.
Is the fetch() promise chain generating errors?
10-31-2020 19:36
10-31-2020 19:36
I have also been having problems with posting data. I'm able to post it with the fetch API but the companion behavior looks erratic. Sometimes it works, sometimes it doesn't, the sync is not as expected. I even have backup on files inside the fitbit to ensure that the data can be posted in case something goes wrong but it looks like it's not working as expected. I'm using mainly the file transfer API since the file size can exceed 1024 kb. I'm also using https, any feelings on this erratic behavior on the companion?