Virtuino Forum
App in the background - Printable Version

+- Virtuino Forum (https://virtuino.com/forum)
+-- Forum: Virtuino (https://virtuino.com/forum/forumdisplay.php?fid=1)
+--- Forum: Virtuino IoT (https://virtuino.com/forum/forumdisplay.php?fid=2)
+--- Thread: App in the background (/showthread.php?tid=1139)



App in the background - robert4you - 11-27-2022

The application is running in the background or not?
How to make a button to connect and disconnect mqtt server?


RE: App in the background - Gunner - 11-29-2022

(11-27-2022, 01:10 PM)robert4you Wrote: The application is running in the background or not?
How to make a button to connect and disconnect mqtt server?

1st - Yes, there are background tasks available in the Widget Selector.  I have tested this with a the random number generator on one device to publish via MQTT, and display it on another device subscribing to that topic, which keeps displaying the random number updates even when VirtuinoIoT is in the background on publishing device.
EDIT - I have noticed delays and eventual stop of updated data after a few seconds in background, or immediately once the publishing device has gone into sleep (AKA home screen locked).  Once I unlock the screen and bring VirtuinoIoT to forground the random counter starts updating again.  Not sure if this is a VirtuinoIoT issue with background operation or something with how I have set up my phone. 

2nd - That would be done via the Connect/Disconnect option in Menu... the three dots in the upper right corne of the Virtuino screen.


RE: App in the background - robert4you - 11-29-2022

AD1 / EDIT

I meant the operation of the VirtuinoT application when the phone screen is off and the phone is locked.

I have the same problem as you and I think it's VirtuinoT's fault. Older versions work fine.

AD2

I am looking for the ability to connect and disconnect mqtt server using a variable.


RE: App in the background - iliaslamprou - 12-02-2022

Hi,

answer to first question:
for now the app can't work on the background while the phone is locked.
The battery manager closes the app after some minutes.
I am not sure if I can add this feature for all device manufacturers.
I have this issue on my schedule. 
The app is designed to work as service too. But it is too early for this.
I have too many other issues to fix first. 

answer to second question:
Ι thought I didn't need this feature.
I try to reduce the options as much as I can and keep only the necessary ones.

I am interested in the opinion of users on these matters


RE: App in the background - robert4you - 12-03-2022

When I unlock the screen and bring VirtuinoIoT to the foreground, the mqtt server sometimes does not connect automatically. The cloud is still green, but it does not receive or transmit anything.
That's why I was thinking about mqtt control to automatically connect it correctly. I tested it on Android and on iOs