Chart's X-Axis Time Values are 00:00:00

I have my node-red project deployed to a raspberry pi that is not connected to the internet. I have a dashboard chart that, when a button is pressed, it populates a "1" value so that a vertical line appears on the chart. The last minute in time is set along the X axis, so the button press corresponds to the exact time.

Intermittently this works great. But recently the time values on the X-Axis are 00:00:00. Has anyone experienced this before? Is it unable to get the system time for some reason (like lack of internet connection)?

Here is what the node properties look like:

The only way to diagnose the problem is if you also post your flow here.

I'm having the same problem. In my case I'm reading the values from a modbus get node, when I navigate to some tab and navigate back again to the previous tab the chart x axis show only 00:00:00 values and the no line, here is a simplified version of the flow that shows the problem

[{"id":"b06ba29b.716118","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"85853421.561d4","type":"inject","z":"b06ba29b.716118","name":"timer","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":80,"wires":[["9b097e70.d9a468"]]},{"id":"9b097e70.d9a468","type":"function","z":"b06ba29b.716118","name":"Temperatura de saida do ar","func":"msg.payload = { \n 'fc': 3,\n 'unitid': 1,\n 'address': 260,\n 'quantity': 1 \n} \nreturn msg;","outputs":1,"noerr":0,"x":310,"y":100,"wires":[["c3e7f47c.687488"]]},{"id":"c3e7f47c.687488","type":"modbus-flex-getter","z":"b06ba29b.716118","name":"Modbus/TCP Get","showStatusActivities":true,"showErrors":true,"logIOActivities":false,"server":"2c330275.c05d1e","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":580,"y":80,"wires":[["60ebfc0b.2c8304"],[]]},{"id":"60ebfc0b.2c8304","type":"function","z":"b06ba29b.716118","name":".[0]/10","func":"msg.payload = msg.payload[0] / 10;\nreturn msg;","outputs":1,"noerr":0,"x":770,"y":80,"wires":[["60863aaf.985db4"]]},{"id":"60863aaf.985db4","type":"change","z":"b06ba29b.716118","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"Saída","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":940,"y":30,"wires":[["f9b48201.c84c98"]]},{"id":"f9b48201.c84c98","type":"ui_chart","z":"b06ba29b.716118","name":"","group":"1029c925.810a8f","order":1,"width":0,"height":0,"label":"Saída e retorno do ar (℃)","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"40","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#b4201f","#2711d4","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":1180,"y":50,"wires":[[]]},{"id":"2c330275.c05d1e","type":"modbus-client","z":"","name":"Mecalor","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"tcpHost":"172.16.0.201","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"5000","reconnectTimeout":"5000"},{"id":"1029c925.810a8f","type":"ui_group","z":"","name":"Default","tab":"daa5b4e8.6d38a8","disp":true,"width":"6","collapse":false},{"id":"daa5b4e8.6d38a8","type":"ui_tab","z":"","name":"Teste","icon":"dashboard","disabled":false,"hidden":false}]

Here a screenshot before and after the problem
image
image

Redeploy doens't fix the problem, but if I send [] to the chart, it starts to plot correctly again

HI Daniel,

I could not reproduce the issue as you described.

Is it possible that your flow is delivering negative values to the chart node ? Note that in the node configuration is set to Y min = 0 and Ymax = 40. If you deliver values outside this range I would expect to see no points being plotted. A debug node could capture the payload values delivered to the UI_chart for your analysis. Makes sense ?

Does not reproduce for me too but I think it is reasonable if you tell us about your environment and versions of soft you are using. It may make some difference.

I'm running on Raspberry PI, Raspian 9, nodered 0.19.4 installed with default apt-get, the dashboard version:
image

all my line charts are showing this behavior

Andrei, even if this would be the case, this doesn't explains why the X axis are all 00:00:00.

I could reproduce this without depend on modbus

[{"id":"cedb3ea6.89e61","type":"ui_text","z":"8061d389.d01cd","group":"1029c925.810a8f","order":1,"width":0,"height":0,"name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":490,"y":200,"wires":[]},{"id":"1029c925.810a8f","type":"ui_group","z":"","name":"Default","tab":"daa5b4e8.6d38a8","disp":true,"width":"6","collapse":false},{"id":"daa5b4e8.6d38a8","type":"ui_tab","z":"","name":"Teste","icon":"dashboard","disabled":false,"hidden":false}]

image

Is there anything that I can do to troubleshoot this further?

And if you add info about the browser, someone with similar equipment can try and then the issue can be narrowed down. Unfortunately no PI equipment available for me.

I tried Chrome Version 73.0.3683.103 (Official Build) (64-bit) and Firefox 66.0.3 (64-bit), both for linux. I'll ask my fellows to try with another browsers too. Also, I have a raspberry here, I will try to reproduce

We're using chartjs with angular, is there a way to log some debug info? (I'm not very versed in node/angular/chartjs but I can try)

Regards!

The latest flow you posted has only one node. Please post again so we can have a look.

One thing that can explain the zeros is the X axis is your flow injecting msg.timestamp with value 0. This is just to illustrate that it is possible such thing happening. It should not be your case as you would easily catch that with a debug node.

A good place for adding a debug node is in the output of the ui_chart node. This way you could view the history of the data in the debug panel.

Good idea Andrei,

I'll try that today!

Here is the earlier exported node

[{"id":"8061d389.d01cd","type":"tab","label":"Flow 3","disabled":false,"info":""},{"id":"74e570d7.05b4c","type":"inject","z":"8061d389.d01cd","name":"","topic":"","payload":"","payloadType":"date","repeat":"1","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":140,"wires":[["5d653255.f498cc"]]},{"id":"5d653255.f498cc","type":"random","z":"8061d389.d01cd","name":"","low":"1","high":"10","inte":"true","property":"payload","x":340,"y":140,"wires":[["ca9b77b1.27e8b8","cedb3ea6.89e61"]]},{"id":"ca9b77b1.27e8b8","type":"ui_chart","z":"8061d389.d01cd","name":"","group":"1029c925.810a8f","order":0,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"auto","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":490,"y":140,"wires":[[]]},{"id":"cedb3ea6.89e61","type":"ui_text","z":"8061d389.d01cd","group":"1029c925.810a8f","order":1,"width":0,"height":0,"name":"","label":"text","format":"{{msg.payload}}","layout":"row-spread","x":490,"y":200,"wires":[]},{"id":"dd667a04.0d2ba8","type":"inject","z":"8061d389.d01cd","name":"","topic":"","payload":"[]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":340,"y":70,"wires":[["ca9b77b1.27e8b8"]]},{"id":"1029c925.810a8f","type":"ui_group","z":"","name":"Default","tab":"daa5b4e8.6d38a8","disp":true,"width":"6","collapse":false},{"id":"daa5b4e8.6d38a8","type":"ui_tab","z":"","name":"Teste","icon":"dashboard","disabled":false,"hidden":false}]

1 Like

I tried to reproduce this in my desktop, no success. I have a raspberry 3 here, but no SD card :open_mouth: I will try to find one, or buy one, but I will not get this working today :confused:

I don't know if this will matter but NR is now at v0.20.7 you might try an update on your pi using the directions at Running on Raspberry Pi : Node-RED

that shouldn't have an effect on dashboard per se. it'll be more down to the formatting of the data being sent in... -

1 Like