Visual component with id (im2) already exists
-
Hi kl3m3n,
I have 4 small graphs on https://i.imgur.com/XXxxXX.png, that alternate depending on the signal strength in the modem. I want to update it in periods of every 60 seconds.
The problem is that after 60 seconds, the next time I load the same graphic, the error message appears in the Gui-O,
Visual component with id (im8) already exists,
because it has already been loaded once. Is there any way to solve it?Best regards
-
Hi kl3m3n,
Perhaps one way to solve this would be if it were possible to assign a variable to IM UID:var
Best regards
-
@sato you are probably creating another |IM component with UID:im8 (which already exists). Try updating the IP parameter of im8 to change the image:
@im8 IP:"<image>"\r\n
BR,
kl3m3n -
Hi @kl3m3n
Thanks for the Tip, but it not update the graphic.
What make i wrong?loop()
unsigned long currentTime = millis(); if (currentTime - previousTime >= eventInterval) { // every 20 seconds previousTime = currentTime; s_quality = modem.getSignalQuality(); if (oneTime == 0) { // it load the graphic
mqttClient.publish(&In[0], "|IM UID:im8 X:10 Y:45 W:12 H:12 OPA:1 SCI:0 SCM:2 VIS:1 IP:"https://i.imgur.com/GGxxxxx.png"\r\n");
oneTime = 1; // load the graphic only one time and it works
}if (s_quality >= 24) { mqttClient.publish(&In[0], "@im8 VIS:1 SCI:0 IP:\"https://i.imgur.com/8dxxxxx.png\"\r\n"); // but don't update! The graphic exists Serial.println("Signal Top +"); } else if ((s_quality >=20) && (s_quality <= 23)) {
mqttClient.publish(&In[0], "@im8 VIS:1 SCI:0 IP:"https://i.imgur.com/2dxx3xx.png"\r\n"); // but don't update! The graphic exists
Serial.println("Signal Good");
}
else if ((s_quality >=16) && (s_quality <= 19)) {
mqttClient.publish(&In[0], "@im8 VIS:1 SCI:0 IP:"https://i.imgur.com/TJxxxxx.png"\r\n"); // but don't update! The graphic exists
Serial.println("poor signal");
}
}Best regards
-
Hi Kl3m3n,
This works, only the IP without the SCI and VIS
mqttClient.publish(&In[0], "@im8 IP:"https://i.imgur.com/vFexxxx.png"\r\n");
Solved
Thanks