On close with > clear some flags
-
Hello Kl3m3n,
Hope you are fine.Have a question:
Normally I have an exit button to close the Guio app, in which case I clear some flags before closing. Now, if I close via < which is followed by a request to confirm that I want to close, the flags are no longer cleared. Is there any way of clearing the flags when I close the Guio App in this way?Thank you
Best regrads -
@Sato Hi!
I am great, thank you. What about you?
I assume you want to clear the flags on the microcontroller side? So, on your microcontroller side, just clear the flags on disconnect (Bluetooth, some USB connections).
In MQTT it's a bit trickier, but you can send periodic ping to the app (using @ping command). When there is no reply after, for example, 3 ping requests, you clear the flags.
Delaying the exit in order to send a message is not a good approach in my opinion as the app could seem unresponsive.
Best regards,
Kl3m3n -
Hi @kl3m3n,
I'm fine too, thanks.
As I said, if I close the app via the button I created for it, then clear the flags I need and then shut it down, it works fine. The other issue is that if, for whatever reason, the app is closed by > on the Guio, then I can't clear the flags I need on the microcontroller.
I don't see if and how it's possible in this situation to clear the flags before shutting down.Thanks
Sato -
@Sato Hi,
which connection type are you using?
If you are using MQTT, and you have a bad connection, the "exit" action could actually take longer and the app may seem unresponsive to the user. This is not a good solution.
What do you do if GUI-O suddenly losses internet connection? How do you clear the flags then?
Kl3m3n
-
Hello @kl3m3n,
I use GPRS, and there's the rub!
As I want to dynamically evaluate the RF signal strength, I have to be careful not to consume unnecessary data.
Normally, when I connect to an Esp device, during the creation of the Guio graphical environment, I have already loaded the graph corresponding to the respective signal strength. I then set a flag that allows me to continuously evaluate which graph to load if the value previously read is different from the current one, i.e. while the Guio app is connected to the device, this flag remains and the intensity reading is dynamic.
When I close the app via the Exit button I created, I clear that
flag and the Esp no longer enters that void, so it doesn't consume unnecessary sends to load those graphs that are no longer needed. But if I close the app via the “>” button, I don't see how I can clear this flag because I think it's in Andoid and not Guio issue, but I could be wrong.If Guio loses its internet connection, after a short time the Esp restarts and all the flags are cleared.
Best regards
-
Hi!
Ok, I understand!
@Sato said in On close with > clear some flags:
If Guio loses its internet connection, after a short time the Esp restarts and all the flags are cleared.
How does the ESP know to restart if GUI-O loses connection?
-
Hello @kl3m3n,
Sorry, I meant that when Esp lose the connection to the Internet, it restarts and the flags are cleared.
Your "ping" idea, as allways, is good, I'll check it in the Guio Manual and implement it, it should work. I'll give you feedback when I see results.
Thank you
Best regards -
-
@Sato I am glad to hear that!
Best regards,
Kl3m3n