02-18-2019 01:57
02-18-2019 01:57
I am trying to get a very simple app working for a Fitbit Versa or Ionic (Using SDK 3.x).
The idea is that it collects 5 seconds worth of accelerometer and heart rate data, and post it to a web server (that is running on the attached android phone)....and repeats indefinitely.
I seem to have it working - watch app collects the data, uses messaging to send it to a companion app, which uses fetch() to post it to the web server, and returns the response to the watch app as a message.
The problem is reliability - I am experiencing the following issues, which may or may not be linked:
The watch app stopping sounded like a memory leak, but as far as I can tell the memory usage is not increasing (but does seem to vary a lot over time). I found a 'run in background' permission, but that seems to relate to the companion app, so not relevant for me.
I wondered if anyone has any advice how to de-bug this, because I am struggling - is there a system log I can get to to find out why the watch app stopped? Or something I need to do to stop the watch app shutting down - is it a power saving 'feature' that I need to disable?
The source code is here if you would like to see it: https://github.com/OpenSeizureDetector/Fitbit_SD.
Answered! Go to the Best Answer.
02-18-2019 12:13
02-18-2019 12:13
Unfortunately, messaging isn't as reliable as file transfer. Even file transfer fails about 5% of the time.
I, too, see dev bridge disconnections regularly. I'm not sure that this is indicative of behaviour of an app when it isn't being debugged. Red herring?
Re watch stopping, did you set Appbit's me.appTimeoutEnabled to false?
If it's just your app seeming to not monitor and send, it could happen if you're using ontick() which only fires when the watch's display is on.
You can use memory API to monitor memory usage.
In general, stick some console.log() output in strategic places in your code, then run it until it dies. You can then see where it got to (roughly).
02-18-2019 12:13
02-18-2019 12:13
Unfortunately, messaging isn't as reliable as file transfer. Even file transfer fails about 5% of the time.
I, too, see dev bridge disconnections regularly. I'm not sure that this is indicative of behaviour of an app when it isn't being debugged. Red herring?
Re watch stopping, did you set Appbit's me.appTimeoutEnabled to false?
If it's just your app seeming to not monitor and send, it could happen if you're using ontick() which only fires when the watch's display is on.
You can use memory API to monitor memory usage.
In general, stick some console.log() output in strategic places in your code, then run it until it dies. You can then see where it got to (roughly).
02-18-2019 12:43
02-18-2019 12:43
@Gondwana wrote:Re watch stopping, did you set Appbit's me.appTimeoutEnabled to false?
I think that is it, thank you! I had not seen the appTimeoutEnabled setting, so I have set it to false, and it seems to be running for longer than it would yesterday - will run it over night to check before I accept the solution, just in case.
Oddly though, when I print out the value of appTimeoutEnabled, it is false before i do anything to it, but maybe the act of importing the Appbit library is doing something.
Thanks!
Graham.
04-25-2019 04:50
04-25-2019 04:50
Did this work for you?
I'm trying to change the me.appTimeoutEnabled = false;
But when I do a console.log("Timeout Enabled: " + me.appTimeoutEnabled); after the change I still get true
04-25-2019 05:22
04-25-2019 05:22