Tap on Push notification to connect automaticly
-
-
Hello @kl3m3n,
I've updated to 1.0.61.1
I don't know if there have been any improvements in push notifications, at least I haven't noticed much differences.One situation that I wanted to report a few months ago is the following.
I receive notification "A", it displays "A"
I receive notification "B", it displays "A", "B"
In the notification I confirm "Clear All"
I receive a new notification, it shows "A", "B", "C"
Shouldn't only "C" appear?Regards
-
@Sato said in Tap on Push notification to connect automaticly:
Hello @kl3m3n,
I've updated to 1.0.61.1
I don't know if there have been any improvements in push notifications, at least I haven't noticed much differences.One situation that I wanted to report a few months ago is the following.
I receive notification "A", it displays "A"
I receive notification "B", it displays "A", "B"
In the notification I confirm "Clear All"
I receive a new notification, it shows "A", "B", "C"
Shouldn't only "C" appear?Regards
Hi!
IoT push notifications are a non-standard way of passing messages, while the new push notification feature offers a standard push messages mechanism:
- based on Google messaging service (FCM)
- if Android device is offline, the message should arrive when back online
- you don't need IoT connection, you can send push messages in any communication mode (Bluetooth, USB, etc...)
- notification is shown when it arrives and does not persist on the Android screen
- Each notification gets a new message, messages are grouped
For new projects it is recommended to use this instead of IoT push notifications, which is a custom mechanism and does not handle some cases efficiently.
P.S.: I did not forget about your suggestion for auto connection when tapping the push notification.
Best regards,
kl3m3n -
Hello Kl3m3n,
Ok, thanks for the infoDo I now have to change anything on my device?
I'm asking because I forced Gui-O to stop
in the smartphone settings. After that, my device sent a notification, it didn't arrive, I opened Gui-O and it still didn't receive it, since I only send the notification once, I'm sure it will never arrive.
If I understand correctly, isn't this the Broker's "persistence mechanism"?Do I have to implement periodic resending on the device as long as I don't confirm receipt via Gui-O?
Initially I had it working this way, but to save data because it works with a GPRS modem and I have very little data available, I removed the periodic sending procedure.
"I haven't forgotten your suggestion....."
Thank you!Regards
-
@Sato Hi.
You now have two options for push notifications:
- Standard push notifications (preferred / recommended)
This works without the foreground service running and ensures delivery, even if your device is offline (it will be delivered when back online). This uses Google Cloud Messaging and is the standard way of handling push notifications. You can use this in any GUI-O connection mode.
- IoT push notifications
This is (my) custom delivery mechanism as it relies on MQTT.
I will explain why you don't in this case receive notifications if you are offline:
GUI-O MQTT broker uses persistence, but only in RAM.Note that I did not implement reliable persistence (storing messages locally and recalling them if server has a power outage for example) as this would take additional resources.
That is why in normal GUI-O mode (when the app is opened), the client connects without persistence ("clean session flag" is always set to true). When using IoT push notifications, the cllient requests persistence ("clean session flag" is set to false), but as a new client id is generated on each connection, this persistence does not matter (persistence is based on known client id).
I will try to link the client id (which can be set in the app) to the IoT push notifications and test the persistence - this is currently low priority to me. Note that the IoT push notifications are currently not encrypted and can be potentially read by a third party. I will patch this ASAP.
To sum it up: I suggest for new projects you use push notifications as described here: https://www.gui-o.com/examples/gui-o-push-notifications.
Best regards,
Kl3m3n -
Hello @kl3m3n,
Thanks, I understand
But both types are still supported, push notifications as well as the new ones via FCM, right?My last suggestion of automatically positioning the Menu in the connection of the device that sent the notification, do you have any idea if it will be possible?
As always you make a good work, congrats
Regards
-
@Sato I have added persistence to GUI-O MQTT broker (7 days), but only for IoT push notifications, not for normal connection (in this case, there is no persistence as it makes no sense). But, the only catch is that the MQTT messages need to be published with QOS (quality of service) at least QOS 1. Otherwise, the broker will discard the message. If published with QOS 1 or QOS 2, the broker will deliver the messages when the IoT push notification service is back online... Sadly, the PubSubClient used in the Android examples only supports publishing messages with QOS 0...
Of course, the push notifications that use FCM are persistent by default!
Still, I will deliver the persistence functionality with the new release.
After this release, I will see what I can do about your suggestion...
Regards,
Kl3m3n -
-
Hello Kl3m3n,
The latest version .62 doesn't work well with push notifications.
Most of the time they don't arrive, and everytime the device sends the notification, it freezes for a while, often even stops communicating and after a while resumes the MQTT connection.I haven't tested FCM notifications yet, but I'd like to know if Gui-O can support both?
At the moment, as it is, it is unusable.How can i get back to .61 version?
Thank you
Regards -
@Sato Hi.
Can you try again now? I have made some changes to the broker.
I don't see how the app can be the problem, since no major changes were made to IoT push notifications.
Do you have Mqtt clientId set or is it empty?
Yes, both types of push notifications can work (even simultaneously).
Regards,
Kl3m3n -
@Sato said in Tap on Push notification to connect automaticly:
Most of the time they don't arrive, and everytime the device sends the notification, it freezes for a while, often even stops communicating and after a while resumes the MQTT connection.
You mean when the microcontroller device sends a notification?
-
Hi @kl3m3n,
It's still not working properly. What I can see is that whenever Esp sends a notification, it freezes for about 5...10 seconds then it continues to communicate. I can see it on the led on the pcb board, which is always flashing as long as I have an internet connection.
With version 6.0 this didn't happen, it didn't freeze when sending a push notification.
Another issue is that the app now freezes so often that I have to force it to stop.
I haven't changed the App settings, the Mqtt clientid is still Not setRegards
-
Yes, right allways the Esp send the Push notification
-
@Sato What freezes? GUI-O app or ESP? Both?
Can you try setting the clientId to something unique and reconnect (disable and enable IoT notifications)? And see if the problem persists?
-
Hi @kl3m3n,
The problem perssist
Have set the client id to 1234, disable notification and enabled it again
Have reinitalize the Smartphone
The most notification don´t arriveThe Clear All continue not to clear the notifications buffer, but that is a other issue
that have nothing to do with the problem, i thinkIs it possible to update back to 6.0 to make tests again?
Regards
-
@Sato Hi.
I have tested (again) the IoT push notifications and I cannot reproduce none of the problems you are experiencing.
- I receive all notifications that I sent (with QOS level 1 or 2, I get them even if notifications are disabled and I enable them).
- It works if I set the clientId or keep it empty.
- The number of notifications shown corresponds to the setting "Notifications to show". When the set number of notifications are reached, the oldest is pushed out.
- If I press "CLEAR ALL", all notifications are cleared
I will try it on other Android devices and using ESP32.
If I remember correctly you've had some similar problems with notifications in the past and I as far as I remember I did not do any fixes then.
Can you try another Android device?
Regards.
Kl3m3n -
Hi @kl3m3n,
Tomorrow I'll test it with another Esp32 and another cell phone and give you feedback
Yes, when I press Clear All the notifications disappear, but when the next notification arrives the others that already existed before pressing Clear All appear again, shouldn't only the last one appear since I supposedly "deleted" the previous ones?
Regards
-
@Sato said in Tap on Push notification to connect automaticly:
Yes, when I press Clear All the notifications disappear, but when the next notification arrives the others that already existed before pressing Clear All appear again, shouldn't only the last one appear since I supposedly "deleted" the previous ones?
I cannot reproduce it. When I "CLEAR ALL" and send a new notification, only the new one appears.
Are you sure you are not storing and sending old notifications on ESP side?Can you give exact steps for this? So I will try to follow them with my tests? Also for other tests, can you give steps so I can try to reproduce the exact steps?
Best regards.
-
Hi @kl3m3n,
Strange, I'm shure that only one Push will be send every time.
I'll check it tomorrow on the serial monitor too
Regards
-
@Sato
FYI - I use this for testing MQTT:It's free and it's easy to setup. You can get the credentials from the example. Use 1883 port without SSL.