I have a Raspberry Pi 3B with a python scripts that sends data from some sensors to a Cayenne Dashboard via MQTT.
Everything is working good except for 1 gauge (I have a total of 5 gauges) where it should display the battery voltage of a battery powered ESP8266.
This ESP8266 sends data to the Raspberry where, after some processing, a python script is used to send these data “back” to the dashboard every 10 minutes (temperature, humidity, solar light intensity, battery voltage and load current).
The gauge that is facing a problem is the one regarding the battery voltage: everytime there is new data, it always displays “0.000” and only when I refresh the web page with F5 it displays the correct value (for example 3.723).
The other gauges display their value as soon as data are received without the need of refreshing the page.
Of course each gauge has its own channel so…why this behaviour?
Thank you, regards.
where “bVoltage” contains the value to be displayed in the gauge.
The lines for the remaining gauges are the same except for the channel number and the variable.
The value to display on the various gauges are sent with this format:
value*command
for example, to send the battery voltage the command is “3.600*b”.
The logic is the following: an ESP8266 “nodeMcu” sends the readings from the sensors to a Raspberry Pi through TCP, the Raspberry processes data, formats them and then sends to the python script all the values via “TCP:9080”.
The python script sends values to the gauges via MQTT.
The only gauge that has the described issue is the one that receives data with the command “b” (in the source code the line “if tipo==‘b’:…”), all the others don’t have problems.
I did it but the issue still remains.
I tried the following:
removed the gauge, set it up again on a different channel, issue remains
removed the gauge, after some seconds it appeared (automatically) a “Value widget”
left the “value widget”, the issue didn’t appear
I set one more “Gauge widget” on an unused channel (15), modified the python script to send battery voltage to channel 11 (–>value widget) and 15 (gauge widget): the “value widget” updated its value automatically, the “gauge widget” updated its value to “0.000”…pressed F5 and also the gauge widget displayed the correct value (the same of the “value widget”).
So the issue seems to affect only the gauge widget…
I removed the gauge by clicking on the small “gear” in the upper right corner of the widget and then clicked on “remove”.
Then I added it clicking on “Add New–>Device and Widgets–>Custom Widgets”, set the channel up to “15” and saved it.
Once it is on the dashboard, if I have to modify its settings, I click on the small “gear”…