I have this node:
[{"id":"6a0bb249.a7d50c","type":"serial in","z":"2788693.17e8d16","name":"","serial":"9939954d.414a","x":75,"y":110.00000762939453,"wires":[["ecfc3405.1f6968"]]},{"id":"e4698ad2.53ac","type":"debug","z":"2788693.17e8d16","name":"","active":true,"console":"true","complete":"payload","x":482.8333740234375,"y":459.5,"wires":[]},{"id":"ecfc3405.1f6968","type":"switch","z":"2788693.17e8d16","name":"redirection payload ","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"<","vt":"str"},{"t":"eq","v":"t","vt":"str"},{"t":"eq","v":"a","vt":"str"}],"checkall":"false","outputs":3,"x":116.83335876464844,"y":445.3333740234375,"wires":[["bf9d5354.71114"],[],[]]},{"id":"bf9d5354.71114","type":"function","z":"2788693.17e8d16","name":"","func":"var outputMsgs = [];\nvar myVars = msg.payload.split(\"\\t\");\nfor(var w in myVars){\n// outputMsgs.push({payload:myVars[w]});\n outputMsgs.push({payload:myVars[w]});\n \n}\noutputMsgs.shift(); // remove 1st element of the array\noutputMsgs.pop(); // remove last element \\r\\n\n\noutputMsgs[0].topic = \"now\"; // affectation d'1 topic pour le graph\noutputMsgs[1].topic = \"timer\";\noutputMsgs[2].topic = \"T_amb\";\noutputMsgs[3].topic = \"Tc_K\";\noutputMsgs[4].topic = \"Consigne\";\noutputMsgs[5].topic = \"Feedback\";\noutputMsgs[6].topic = \"flag_capteur\";\noutputMsgs[7].topic = \"Pyro\";\noutputMsgs[8].topic = \"output_dac\";\noutputMsgs[9].topic = \"adc1_V_retour_MCP_DAC\";\noutputMsgs[10].topic = \"ERR\";\nvar A = Math.round(outputMsgs[5].payload - outputMsgs[4].payload);\noutputMsgs.push({payload:A});\noutputMsgs[11].topic = \"Consigne/feedback\";\noutputMsgs.topic = \"global\"\nreturn [outputMsgs[0], outputMsgs[1], outputMsgs[2], outputMsgs[3], outputMsgs[4], outputMsgs[5], outputMsgs[6], outputMsgs[7], outputMsgs[8], outputMsgs[9], outputMsgs[10], outputMsgs[11], outputMsgs];\n","outputs":"13","noerr":0,"x":125,"y":270.6666564941406,"wires":[["a44ed837.15356","f306d8fd.9f86a8"],["cca205b3.9695c8"],["4cc145ad.c22da4"],["754ba1ba.aa2c1"],["74bdf184.6d8c98","f306d8fd.9f86a8"],["f3f0ec03.a68238","f306d8fd.9f86a8"],["30e453be.caab14"],["f35d6ee6.332888","f306d8fd.9f86a8"],["375ce9d6.08b3a6","f306d8fd.9f86a8"],["134e68f2.4ed237"],["125231d4.d2ca06"],["ed091a4d.79f85"],["e4698ad2.53ac","9ee95d09.e23f68"]],"outputLabels":["now","timer","internal_C","température_Tc_K","Consigne","feedback","flag_pyro","température_pyro","output","adc1_sortie_MCP4725","","",""]},{"id":"754ba1ba.aa2c1","type":"ui_gauge","z":"2788693.17e8d16","name":"","group":"52880442.6f8dfc","order":2,"width":0,"height":0,"gtype":"gage","title":"Thermocouple","label":"°C","format":"{{value}}","min":0,"max":"1200","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":520.8333740234375,"y":210.00001525878906,"wires":[]},{"id":"a44ed837.15356","type":"ui_text","z":"2788693.17e8d16","group":"1708d647.04db7a","order":3,"width":0,"height":0,"name":"","label":"Secondes écoulées","format":"{{msg.payload}}","layout":"col-center","x":424.16668701171875,"y":83.16666412353516,"wires":[]},{"id":"cca205b3.9695c8","type":"ui_text","z":"2788693.17e8d16","group":"1708d647.04db7a","order":5,"width":0,"height":0,"name":"","label":"Timer","format":"{{msg.payload}}","layout":"col-center","x":466.16668701171875,"y":151.1666717529297,"wires":[]},{"id":"4cc145ad.c22da4","type":"ui_text","z":"2788693.17e8d16","group":"1708d647.04db7a","order":6,"width":0,"height":0,"name":"Tamb","label":"T_amb","format":"{{msg.payload}}","layout":"col-center","x":355.16668701171875,"y":200.1666717529297,"wires":[]},{"id":"74bdf184.6d8c98","type":"ui_gauge","z":"2788693.17e8d16","name":"","group":"12a6957e.88ac3b","order":1,"width":0,"height":0,"gtype":"gage","title":"Consigne","label":"C°","format":"{{value}}","min":0,"max":"1050","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":352.16668701171875,"y":242.83331298828125,"wires":[]},{"id":"f3f0ec03.a68238","type":"ui_gauge","z":"2788693.17e8d16","name":"","group":"a0898c66.f0283","order":2,"width":0,"height":0,"gtype":"gage","title":"feedback","label":"°C","format":"{{value}}","min":0,"max":"1200","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":502.16668701171875,"y":258.83331298828125,"wires":[]},{"id":"f35d6ee6.332888","type":"ui_gauge","z":"2788693.17e8d16","name":"","group":"d518e72d.e17d78","order":1,"width":0,"height":0,"gtype":"gage","title":"Pyromètre","label":"°C","format":"{{value}}","min":"250","max":"1200","colors":["#00acb5","#00b500","#ca3838"],"seg1":"1000","seg2":"1100","x":510.16668701171875,"y":317.83331298828125,"wires":[]},{"id":"375ce9d6.08b3a6","type":"ui_gauge","z":"2788693.17e8d16","name":"","group":"d183329a.5b0ba8","order":1,"width":0,"height":0,"gtype":"gage","title":"output_MCP4725_digit","label":"bit","format":"{{value}}","min":0,"max":"4095","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":688.1666564941406,"y":346.83331298828125,"wires":[]},{"id":"cd49d46.7b81d28","type":"ui_text","z":"2788693.17e8d16","group":"1708d647.04db7a","order":4,"width":0,"height":0,"name":"","label":"Capteur en usage","format":"{{msg.payload}}","layout":"col-center","x":686.8333435058594,"y":288.3333740234375,"wires":[]},{"id":"f306d8fd.9f86a8","type":"ui_chart","z":"2788693.17e8d16","name":"","group":"959ffa36.2e3e78","order":0,"width":0,"height":0,"label":"chart","chartType":"line","legend":"false","xformat":"mm:ss","interpolate":"linear","nodata":"","dot":true,"ymin":"","ymax":"","removeOlder":"5","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":336.8333740234375,"y":476.73333740234375,"wires":[[],[]]},{"id":"134e68f2.4ed237","type":"ui_gauge","z":"2788693.17e8d16","name":"","group":"d183329a.5b0ba8","order":2,"width":0,"height":0,"gtype":"gage","title":"V_dac_MCP","label":"V","format":"{{value}}","min":0,"max":"5","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":458.0832824707031,"y":352.75,"wires":[]},{"id":"64914e7.d6aadb","type":"function","z":"2788693.17e8d16","name":"","func":"var outputMsgs = [];\nvar myVars = msg.payload.split(\"\\t\");\nfor(var w in myVars){\n// outputMsgs.push({payload:myVars[w]});\n outputMsgs.push({payload:myVars[w]});\n \n}\noutputMsgs.shift(); // remove 1st element of the array\noutputMsgs.pop(); // remove last element \\r\\n\n\noutputMsgs[0].topic = \"now\";\noutputMsgs[1].topic = \"timer\";\noutputMsgs[2].topic = \"T_amb\";\noutputMsgs[3].topic = \"Tc_K\";\noutputMsgs[4].topic = \"Consigne\";\noutputMsgs[5].topic = \"Feedback\";\noutputMsgs[6].topic = \"flag_capteur\";\noutputMsgs[7].topic = \"Pyro\";\noutputMsgs[8].topic = \"output_dac\";\noutputMsgs[9].topic = \"adc1_V_retour_MCP_DAC\";\n//outputMsgs\n\nreturn [outputMsgs[0], outputMsgs[1], outputMsgs[2], outputMsgs[3], outputMsgs[4], outputMsgs[5], outputMsgs[6], outputMsgs[7], outputMsgs[8], outputMsgs[9]];\n","outputs":"10","noerr":0,"x":191.88333129882812,"y":551.88330078125,"wires":[[],[],[],[],[],[],[],[],[],[]],"outputLabels":["now","timer","internal_C","température_Tc_K","Consigne","feedback","flag_pyro","température_pyro","output","adc1_sortie_MCP4725"]},{"id":"30e453be.caab14","type":"function","z":"2788693.17e8d16","name":"Tc_K ON / Pyrometre ON","func":"if (msg.payload == 0){\n msg.payload = \"Tc_K ON\";\n} else if(msg.payload == 1){\n msg.payload = \"Pyrometre ON\";\n}\nreturn msg;","outputs":1,"noerr":0,"x":437.5666809082031,"y":285.48333740234375,"wires":[["cd49d46.7b81d28"]]},{"id":"d919a6de.786358","type":"function","z":"2788693.17e8d16","name":"","func":"var outputMsgs = [];\nvar myVars = msg.payload.split(\"\\t\");\nfor(var w in myVars){\n// outputMsgs.push({payload:myVars[w]});\n outputMsgs.push({payload:myVars[w]});\n \n}\noutputMsgs.shift(); // remove 1st element of the array\noutputMsgs.pop(); // remove last element \\r\\n\n\n/*outputMsgs[0].topic = \"now\";\noutputMsgs[1].topic = \"timer\";\noutputMsgs[2].topic = \"T_amb\";\noutputMsgs[3].topic = \"Tc_K\";\noutputMsgs[4].topic = \"Consigne\";\noutputMsgs[5].topic = \"Feedback\";\noutputMsgs[6].topic = \"flag_capteur\";\noutputMsgs[7].topic = \"Pyro\";\noutputMsgs[8].topic = \"output_dac\";\noutputMsgs[9].topic = \"adc1_V_retour_MCP_DAC\";\n*///outputMsgs\n\nreturn [outputMsgs[0], outputMsgs[1], outputMsgs[2], outputMsgs[3], outputMsgs[4], outputMsgs[5], outputMsgs[6], outputMsgs[7], outputMsgs[8], outputMsgs[9], outputMsgs];\n","outputs":"11","noerr":0,"x":393.8833312988281,"y":577.88330078125,"wires":[[],[],[],[],[],[],[],[],[],[],[]],"outputLabels":["now","timer","internal_C","température_Tc_K","Consigne","feedback","flag_pyro","température_pyro","output","adc1_sortie_MCP4725",""]},{"id":"ed091a4d.79f85","type":"ui_gauge","z":"2788693.17e8d16","name":"","group":"1708d647.04db7a","order":7,"width":0,"height":0,"gtype":"gage","title":"Consigne / feedback","label":"°C","format":"{{value}}","min":"-100","max":"100","colors":["#0073b5","#00b500","#ca3838"],"seg1":"-20","seg2":"20","x":477.5666809082031,"y":412.95001220703125,"wires":[]},{"id":"125231d4.d2ca06","type":"ui_text","z":"2788693.17e8d16","group":"1708d647.04db7a","order":0,"width":0,"height":0,"name":"","label":"Errors","format":"{{msg.payload}}","layout":"row-spread","x":460.5666809082031,"y":384.3833312988281,"wires":[]},{"id":"9ee95d09.e23f68","type":"file","z":"2788693.17e8d16","name":"","filename":"/home/harold/arduinoDataloggerToFile/arduino_dataloggerToFile","appendNewline":true,"createDir":false,"overwriteFile":"false","x":787.5,"y":695,"wires":[]},{"id":"9939954d.414a","type":"serial-port","z":"","serialport":"/dev/ttyUSB0","serialbaud":"9600","databits":"8","parity":"none","stopbits":"1","newline":"\\n","bin":"false","out":"char","addchar":false},{"id":"52880442.6f8dfc","type":"ui_group","z":"","name":"Group 2","tab":"bdf79f7a.36f0a8","order":2,"disp":true,"width":"6","collapse":true},{"id":"1708d647.04db7a","type":"ui_group","z":"","name":"Group 1","tab":"bdf79f7a.36f0a8","order":1,"disp":true,"width":"6","collapse":false},{"id":"12a6957e.88ac3b","type":"ui_group","z":"","name":"Group 3","tab":"bdf79f7a.36f0a8","order":3,"disp":true,"width":"6","collapse":false},{"id":"a0898c66.f0283","type":"ui_group","z":"","name":"Group 4","tab":"bdf79f7a.36f0a8","order":4,"disp":true,"width":"6","collapse":false},{"id":"d518e72d.e17d78","type":"ui_group","name":"Group 5","tab":"bdf79f7a.36f0a8","order":5,"disp":true,"width":6},{"id":"d183329a.5b0ba8","type":"ui_group","z":"","name":"Debug","tab":"bdf79f7a.36f0a8","order":6,"disp":true,"width":"6","collapse":true},{"id":"959ffa36.2e3e78","type":"ui_group","z":"","name":"Default","tab":"31bd863e.f5000a","disp":true,"width":"22","collapse":false},{"id":"bdf79f7a.36f0a8","type":"ui_tab","z":"","name":"Curing","icon":"dashboard"},{"id":"31bd863e.f5000a","type":"ui_tab","z":"","name":"Graph","icon":"dashboard","order":3}]
On the arduino I’m sending through serial the following:
Serial.print("<\t");
Serial.print(now);
Serial.print("\t");
Serial.print(timer);
Serial.print("\t");
Serial.print(temperatures.internal_C);
Serial.print("\t");
Serial.print(temperatures.Tc_K);
Serial.print("\t");
Serial.print(setpoint);
Serial.print("\t");
Serial.print(input);
Serial.print("\t");
Serial.print(temperatures.flag_pyro);
Serial.print("\t");
Serial.print(temperatures.T_pyro);
Serial.print("\t");
Serial.print(sortie_MCP); // 0<MCP4725<4095
Serial.print("\t");
Serial.print(temperatures.adc1_Voltage);
Serial.print("\t");
Serial.print(temperatures.nb_of_errors);
Serial.println("\t");
I can see my value till “output_MCP4725_digit” on the dashboard different gauges, but none following that value ! “V_dac_MCP” and “Errors” plus the last value which is calculated in the function node itself “Consigne / feedback”
plus I have some error that I don’t know how to deal with !
[error] [function:bf9d5354.71114] TypeError: Cannot set property 'topic' of undefined