How much notifications append without to open Gui-O
-
@sato there is already a log for push notifications. You can open it from the GUI-O app. It is located in the "Notifications" folder on the device. You can also set how many notifications are shown (press the menu entry to change)...
See screenshot below.
Every new notification gets a timestamp, so I still don't understand your format? The notifications are already displayed like this. Control the timestamp with publish messages. Each publush will get its own timestamp.
Where the text breaks - this is up to the Android...BR,
kl3m3n -
Hi @kl3m3n,
Sorry, I didn't see that you had already added that feature.
Good, that way we always have a backup of all notifications, just in case we ever need it.If I want to delete the whole content of that file, because it has too many test notifications, how can I do it?
Output on Gui-O
Look that here the timestamp are no more to see, wich of these notifications are send with 5 minutes interval
[21:09] PixelBox - Obra_21 R. do Caires 46 * Position is changed * * Fehler Bremsschalter2 * * Motorwärmesensor normalisiert *Where the text breaks - this is up to the Android.
It could be, but all the notifications are sent with their timestamps, where are they?That's should look like. Every notification separated trough the timestamp.
[21:09] PixelBox - Obra_21 R. do Caires 46 * Position is changed *
[21:04] PixelBox - Obra_21 R. do Caires 46 * Fehler Bremsschalter2 *
[20:59] PixelBox - Obra_21 R. do Caires 46 * Motorwärmesensor normalisiert *Another issue is that from the 4th notification, Gui-O stops receiving more notifications. To continue receiving, I have to open the App, after 5 minutes I receive the next notification, and so on.
Another question, if I want my device to send Push Notifications to 2 or 3 cell phones, is that possible?
So, would Gui-O have to support more than one Application UUID, or can it be colonized?BR
-
@sato said in How much notifications append without to open Gui-O:
If I want to delete the whole content of that file, because it has too many test notifications, how can I do it?
Currently, you need to do this from the system's "file manager" app. Go to Android/data/com.guio.guioapp/files/Notifications
I can add a delete icon to the GUI-O app.
@sato said in How much notifications append without to open Gui-O:
Another issue is that from the 4th notification, Gui-O stops receiving more notifications. To continue receiving, I have to open the App, after 5 minutes I receive the next notification, and so on.
Are you sure you have "Autostart" for GUI-O enabled from the system settings? Sometimes, on my device the service is also killed by the OS, but the OS restarts it automatically after 1 second.
@sato said in How much notifications append without to open Gui-O:
Another question, if I want my device to send Push Notifications to 2 or 3 cell phones, is that possible?
No problem, just use the application UUID for each GUI-O app, when sending the notification. Each device has a unique id, so you just need to publish to the appropriate topic from your device side.
BR,
kl3m3n -
Hi @kl3m3n
Do you mean
Autoconnect (Automatically (re)connect )
Put it now ON. I will test if it fix the frozen of the App, i hope it doesI have 4 notifications and the 5 minutes time has passed, as such I should receive the next one, but it don't, to continue receiving I have to open the App
Here we have 3 notifications with only one timestamp, so as more notifications arrive, they are added to the existing ones, which without the timestamps separates them, gets a little bit confusing.
[10:09] PixelBox - Obra_21 R. do Caires 46 * Position verloren * * Bremsschalter2 * * Motorwärmesensor normalisiert *
This is better. Can you fix that to this?
[10:09] PixelBox - Obra_21 R. do Caires 46 * Position verloren *
[10:04] PixelBox - Obra_21 R. do Caires 46 * Bremsschalter2 *
[09:59] PixelBox - Obra_21 R. do Caires 46 * Motorwärmesensor normalisiert *Phone1 UUID
//static const char *Push = "e79a7f79-9fe5-4322-aee3-cfd10f940b1d/notifications";
Phone2 UUID
static const char *Push = "d3f1e986-16b3-4158-9724-52db22471d0c/notifications";//send Push
mqttClient.publish(&Push[0], (const char*) pushNotification.c_str());If uncomment the Phone1 UUID, the compiler show a error. Redefinition of 'const char* Push'
BR
-
@sato said in How much notifications append without to open Gui-O:
Do you mean
Autoconnect (Automatically (re)connect )
Put it now ON. I will test if it fix the frozen of the App, i hope it doesNo, I mean in the Android OS settings. When you turn on the notifications, it displays a message -> "App settings". Click on it and set the values according / similar to this (see images under this link):
https://www.gui-o.com/examples#h.ujq2e0ve4vac
@sato said in How much notifications append without to open Gui-O:
Here we have 3 notifications with only one timestamp, so as more notifications arrive, they are added to the existing ones, which without the timestamps separates them, gets a little bit confusing.
This is a problem on your side. You need to send push notifications one - by one. You are sending them all together...
So, like this:
// first notification... String pushNotification = "your data..."; mqttClient.publish(&Push[0], (const char*) pushNotification.c_str()); // second notification... pushNotification = "your new data"; mqttClient.publish(&Push[0], (const char*) pushNotification.c_str()); // third notification... pushNotification = "your new new data"; mqttClient.publish(&Push[0], (const char*) pushNotification.c_str()); and so on...
@sato said in How much notifications append without to open Gui-O:
If uncomment the Phone1 UUID, the compiler show a error. Redefinition of 'const char* Push'
Of course, you cannot redefine a variable... Do it like this.
//Phone1 UUID static const char *Push1 = "e79a7f79-9fe5-4322-aee3-cfd10f940b1d/notifications"; //Phone2 UUID static const char *Push2 = "d3f1e986-16b3-4158-9724-52db22471d0c/notifications";
then
mqttClient.publish(&Push1[0], (const char*) pushNotification.c_str()); mqttClient.publish(&Push2[0], (const char*) pushNotification.c_str());
P.S. You should not reveal your app id. Now I can send a false push notification to your device Of course, I need access to the broker (which is "public" in this case).
BR,
kl3m3n -
Hi @kl3m3n,
No, I mean in the Android OS settings.
Have not this setting on my Android 12. I search for Auto on settings and it show Android Auto, and there is all options ONYou should not reveal your app id. Now I can send a false push notification to your device
No you can't. Have modified the tokens before sendingThis is a problem on your side
No, you can see on my serial port that every 5 minutes
only one Push notification is send at time, with Arduino serial port timestamp//----- Push notifications every 5 minutes for testings!! --------
void loop() {
if (alert == 1) {
Push_falha(); // send Push
alert = 0; // The timer set it again when passed 5 minutes
}
unsigned long currentTime2 = millis();
if (currentTime2 - previousTime2 >= eventInterval2) { // 5 Min
const String numberStr(random(27));
nr_falha = numberStr.toInt(); //random failure number
alert = 1; // time is passed, set flag, so it can send Push again
previousTime2 = currentTime2;
}
}void Push_falha() {
/* PUSH NOTIFICATION /
texto_falha(); // get the failure text to the variable "avaria"
// ---- add the failure to Historico.txt ----
//-------------------------------------------------------------
strdata = "02-04-2022 14:57"; // Later get timestamp from RTC
strdata = avaria += strdata;
adiciona_falha(); // add to file Historico.txt
// ------------------------------------------------------------
String pushNotification("PixelBox - ");
// send the Push
pushNotification += pixelbox_id += avaria;
mqttClient.publish(&Push[0], (const char)
pushNotification.c_str());
// Print it on serial port
Serial.print("Notification done ");
Serial.println(avaria); // print the failure
nr_falha = 0; // clear the failure number
}Thanks for tip to send the Push for more then one UUID
BR
-
What happens when you tap the "App Settings" (see image below)?
@sato said in How much notifications append without to open Gui-O:
No you can't. Have modified the tokens before sending
Very nice!
@sato said in How much notifications append without to open Gui-O:
mqttClient.publish(&Push[0], (const char)
pushNotification.c_str());Does this code compile? It should be (const char *).
-
-
Perhaps have make a error on copy and paste, but on the code here it is:
mqttClient.publish(&Push2[0], (const char*) pushNotification.c_str());and it compile
Another question: On my other Android 10 i have allready the new version v.1.0.10.1 but i not make any update, do it make the update automatically without to ask?
BR
-
@sato said in How much notifications append without to open Gui-O:
Have the same info on IoT settings
Yes, it compile
BR
Yes, I know, what happens if you press App Settings?
-
@sato said in How much notifications append without to open Gui-O:
Perhaps have make a error on copy and paste, but on the code here it is:
mqttClient.publish(&Push2[0], (const char*) pushNotification.c_str());and it compile
Another question: On my other Android 10 i have allready the new version v.1.0.10.1 but i not make any update, do it make the update automatically without to ask?
BR
This is up to you. You can disable auto update feature from Google Play app. It has nothing to do with GUI-O.
-
Now I am sending the Push notification to both cell phones. I pressed on both CLEAR ALL and also clear my serial port.
5 minutes later, get on both phones the new notification, but it as also added the text of the two previous notifications before the CLEAR ALL pressed.In the Serial port I only have now one notification and that's is correct.
Maybe, you have some Buffer that you don't clear and then the new notification text is sent along with previous notifications?
BR
-
@sato said in How much notifications append without to open Gui-O:
Hi @kl3m3n,
No, I mean in the Android OS settings.
Have not this setting on my Android 12. I search for Auto on settings and it show Android Auto, and there is all options ONYou should not reveal your app id. Now I can send a false push notification to your device
No you can't. Have modified the tokens before sendingThis is a problem on your side
No, you can see on my serial port that every 5 minutes
only one Push notification is send at time, with Arduino serial port timestamp//----- Push notifications every 5 minutes for testings!! --------
void loop() {
if (alert == 1) {
Push_falha(); // send Push
alert = 0; // The timer set it again when passed 5 minutes
}
unsigned long currentTime2 = millis();
if (currentTime2 - previousTime2 >= eventInterval2) { // 5 Min
const String numberStr(random(27));
nr_falha = numberStr.toInt(); //random failure number
alert = 1; // time is passed, set flag, so it can send Push again
previousTime2 = currentTime2;
}
}void Push_falha() {
/* PUSH NOTIFICATION /
texto_falha(); // get the failure text to the variable "avaria"
// ---- add the failure to Historico.txt ----
//-------------------------------------------------------------
strdata = "02-04-2022 14:57"; // Later get timestamp from RTC
strdata = avaria += strdata;
adiciona_falha(); // add to file Historico.txt
// ------------------------------------------------------------
String pushNotification("PixelBox - ");
// send the Push
pushNotification += pixelbox_id += avaria;
mqttClient.publish(&Push[0], (const char)
pushNotification.c_str());
// Print it on serial port
Serial.print("Notification done ");
Serial.println(avaria); // print the failure
nr_falha = 0; // clear the failure number
}Thanks for tip to send the Push for more then one UUID
BR
Do you clear "avaria" variable? And "pixelbox_id"? Where do they come from?
-
@kl3m3n,
Sorry to come back to the same topic, but I think Push notifications should become well functional.From the fourth notification, I stop receiving the following ones on both phones.
Then I pressed CLEAR ALL on both phones, that cleared the notifications data on the phones, but I still don't receive the notifications that are being sent. All the followed notifications I can see on the serial port.Please take a look at it calmly, surely you can solve it.
Best Regards
-
Since I now receive notifications simultaneously on both phones it is easier to make comparisons.
Serial Port debug!
16:00:49.760 -> Push * Zeit zwischen Impulsen überschritten *
16:05:49.767 -> Push * Fehler Bremsschalter1 *
16:10:49.754 -> Push * Beide Bremsschalter Defekt *
16:15:49.773 -> Push * Beide Bremsschalter Defekt *
//Receiving two identical failures in a row is normal because I haven't filtered it yetFrom here, the notifications are no more received, on both Phones, must open a Gui-O on one from them, then it works again
16:20:49.763 -> Push * Außerhalb der Türzone angehalten *These are the screenshots from both, hope it helps.
Best regards
-
@sato ok, let's go step-by-step...
Please try to answer the questions below:
-
Navigate to "Settings -> Quick pair -> IoT settings" and disable IoT notifications. Enable them and when the second dialog pops up, please press the "App settings" button and send the screenshot.
-
Navigate to "Settings -> Quick pair -> IoT settings" and check "Notifications to show". What number does it show? For example, is it showing "Showing 3 recent"? This means the number of notification that will be shown. The oldest notification gets discarded when a new notification arrives. Note that Android cannot show unlimited notifications on screen. You can change the number of notifications to show by pressing the menu entry.
-
I am attaching a windows script that periodically sends the notifications to the specified channel. First download and install mosquitto from https://mosquitto.org/download/
Then download this pub_test.txt
and rename extension to ".bat". Open the script and modify <application UUID> for your case. You can also modifiy the time period with which the notifications are sent... It is 5 seconds by default (see timeout value).Please test if this works with your device.
BR,
kl3m3n -
-
Hello @kl3m3n,
Here the screenshot of Point 1 and Point 2
Have installed mosquitto and run your script with timeout of 10 seconds
Here the screenshot tooBR
-
@sato Again, please press the "App settings" text / button. This is the screenshot I need to examine!
Otherwise, everything looks ok. You are showing 2 last notifications, and they are displayed. You can modify the script to put some additional text and simulate sending data every 300 seconds (5 min).
Do you see any problem here? What would you expect from this test that you just made?
BR,
kl3m3n -
Hi kl3m3n,
Here the sreenshot
Is this what you need?When i choose on the menu, more then 2 notifications to show, then Gui-O freeze many times, have than to force to close the App
Memory allocation?What i expected?
That Gui-O have a good working Push notificationsI will add in your test script, text like that what i do
in my test programm, to see if it works too.
With your script it works fine, have more than 200 on index with timeout of 10 seconds.Afternoon or tomorow i will give feedback
BR
-
Hello @kl3m3n,
So far, your script pub_test.bat is continuously sending notification with the index incrementing. How can I modify it so that it also sends some text.
Thanks for your help
BR