Clipboard
- This topic has 4 replies, 2 voices, and was last updated 7 years, 4 months ago by
tom deprez.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
December 13, 2017 at 2:27 am #22121
tom deprez
ParticipantBonjour,
Voila mon supporte technique ma donné un fichier à rentrer dans Node-RED ‘Clipboard’ mon problème est que quand je rentre mon texte dans Clipboard un contour rouge s’affiche. j’ai donc essayé de rentrer nœud par nœud et j’ai réussi, sauf le nœud Fonction. il y a surement une erreur mais la quel ? je vous donne la fonction :{"id":"67ac197.ec430e8","type":"function","name":"formatage payload","func":"//recuperation du timestamp\nvar tmsp=new Date(msg.timestamp).getTime()-7200000 ;\n\nvar payload_=\"\";\nvar hex_value=0;\nfor(var i= 0; i <msg.payload.length; i++)\n{ \n hex_value=msg.payload[i].toString(16);\n if (hex_value.length==1)\n {\n hex_value=\"0\"+hex_value;\n }\n payload_+=hex_value;\n}\n\nmsg.payload=msg.eui.toUpperCase()+\";\"+tmsp+\";\"+payload_+\";\"+msg.lsnr+\";\"+msg.rssi;\nreturn msg; ","outputs":1,"noerr":0,"x":437.00001525878906,"y":310.20001220703125,"z":"52e7d611.dcfbf8","wires":[["e2597a9b.9d5b78","14ed99db.939bf 6"]]}
-
This topic was modified 7 years, 4 months ago by
tom deprez.
December 13, 2017 at 5:42 am #22125Jason Reiss
KeymasterIs there a newline in the string at the end?
I’d go back to the support person who gave you this for help to be sure the logic is intact after modifications.
December 13, 2017 at 6:27 am #22126tom deprez
Participantvoici toutes les lignes dans la chaîne.
[{"id":"5510b172.9c35d8","type":"lora in","name":"","datatype":"bytes","x":253,"y":309.1999969482422,"z":"52e7d611.dcfbf8","wires":[["67ac197.ec430e8"]]},{"id":"89a675dd.8c1ed","type":"debug","name":"CALLBACK RESPONSE","active":true,"console":"false","complete":"true","x":886.199951171875,"y":311.20001220703125,"z":"52e7d611.dcfbf8","wires":[]},{"id":"67ac197.ec430e8","type":"function","name":"formatage payload","func":"//recuperation du timestamp\nvar tmsp=new Date(msg.timestamp).getTime()-7200000 ;\n\nvar payload_=\"\";\nvar hex_value=0;\nfor(var i= 0; i <msg.payload.length; i++)\n{ \n hex_value=msg.payload[i].toString(16);\n if (hex_value.length==1)\n {\n hex_value=\"0\"+hex_value;\n }\n payload_+=hex_value;\n}\n\nmsg.payload=msg.eui.toUpperCase()+\";\"+tmsp+\";\"+payload_+\";\"+msg.lsnr+\";\"+msg.rssi;\nreturn msg; ","outputs":1,"noerr":0,"x":437.00001525878906,"y":310.20001220703125,"z":"52e7d611.dcfbf8","wires":[["e2597a9b.9d5b78","14ed99db.939bf 6"]]},{"id":"e2597a9b.9d5b78","type":"http request","name":"CallBack","method":"POST","ret":"txt","url":"http://91.235.138.86:3333/deviceCallBackManagor/loadMessageMULTITECH","x":648.7999877929688,"y":312,"z":"52e7d611.dcfbf8","wires":[["89a675dd.8c1ed"]]},{"id":"14ed99db.939bf6","type":"debug","name":"","active":true,"console":"false","complete":"false","x":655,"y":216,"z":"52e7d611.dcfbf8","wires":[]}]
December 13, 2017 at 7:48 am #22129Jason Reiss
KeymasterThe input must be valid json, try running it through a linter.
https://jsonlint.comDecember 13, 2017 at 9:40 am #22130tom deprez
Participantmerci bien 🙂
-
This topic was modified 7 years, 4 months ago by
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.