Hi,
Well i'm brand new to the Tizen app development world but slowly getting there.
I'm trying to create a gear S3 web App that connects to a bluetooth board (v2.0) and once bonded sends a 'ping' every few seconds to to tell an arduino board to unlock a door. If the pings stop, the door re-locks automatically.
The basic idea is that as long as i'm wearing my watch, if i walk up to a door it auto unlocks and when i walk away it re-locks itself.
The App works great - does everything as expected. Recorgnises and re-connects to the Bluetooth adapter automatically and starts pinging. recorgnises that its out of range and stops the pings. All goes well.
The problem is this - although the Web App is set to 'background enabled', after approx 15min or so it goes to sleep! The app unloads from memory (according to gear monitor app on phone) and does nothing. So far i've tried...
tizen.power.request("CPU", "CPU_AWAKE"); ---> Doesn't do anything.
i've set a 'setInterval' function that pings every minute the function...
tizen.application.launch(app.appInfo.id);
This is an attempt to bring the app back to the foreground and keep working. anoyingly it wakes the screen too with the app on which i dont want to see, but again after 15min or so this stops working too!!
Nothing seems to keep the app awake, when running it uses 2-3% CPU according to the samsung gear monitor. I don't mind the additional power drain, i re-charge every evening.
Please can anybody help. I've been stuck at this for two weeks now and cannot find anyway to keep a background app alive and talking to the bluetooth devices.
Thanks,
Chris