08-28-2019 15:23
08-28-2019 15:23
Hello everyone, I'm just about to pull my hair out and I really hope this is just a simple issue.
I am trying to build a framework where my Fitbit Versa will real-time send data to my iOS Fitbit Companion App, where there the iOS Companion App will use Websockets to real-time send the data to a local server written in Python.
So far, I've been able to have the Versa and iOS app communicate using the peerSocket class from the Messaging API, and am able to read sent data from the Versa in my iOS companion app's logs. The issue is where the websocket.send() commands I'm using to send data from the iOS app to my local Python server only works for the initial line of data sent.
Here is my Fitbit app and companion codes:
app/index.js: https://pastebin.com/q9Tmbdch
companion/index.js: https://pastebin.com/6pKXZL6q
My Podunk Local Python Server (IP addresses on all codes will need to be modified): https://pastebin.com/qtJRLVn7
When you run the local Python server and then Run the Fitbit app and companion scripts, from the server you get this:
Logs from the device and companion as seen from Fitbit Studio (I personally stopped the program):
Here's those photos in Imgur if they're not legible from here: https://imgur.com/a/O0yPWMV
Is there a flaw or typo in my logic/code that you guys can see that could cause this problem?
Thank you so much!