NodeRed -> Traccar

fabio sierra7 years ago

Hi everyone

i try send data to traccar server using osmand protocol, using for this Node-Red but I do not achieve the objective, on the contrary I have this error:

alt text

Anton Tananaev7 years ago

Your format is obviously wrong. Why do you have curly braces in the parameters?

fabio sierra7 years ago

Thank you very much, the error was in the keys.

Thank you again

Greg Albrecht7 years ago

Hey @Fabio Sierra, would you mind showing us the flow you're using to integrate Node Red into Traccar, specifically the functions/transforms you're using? Thanks!

fabio sierra7 years ago

inport in nodered

[{"id":"ba5ce3e7.8deeb","type":"inject","z":"5553f4a5.9cc61c","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":240,"wires":[["4e35264f.5dd608"]]},{"id":"84a0e866.3a9108","type":"debug","z":"5553f4a5.9cc61c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":810,"y":240,"wires":[]},{"id":"b91f024.7a333","type":"change","z":"5553f4a5.9cc61c","name":"","rules":[{"t":"set","p":"url","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":240,"wires":[["bd846a9.bb9c498"]]},{"id":"bd846a9.bb9c498","type":"http request","z":"5553f4a5.9cc61c","name":"","method":"GET","ret":"txt","url":"","x":630,"y":240,"wires":[["84a0e866.3a9108"]]},{"id":"4e35264f.5dd608","type":"function","z":"5553f4a5.9cc61c","name":"url","func":"var time = msg.payload; \nvar url = \"http://demo5.traccar.org:5055/?id=0091047430039&lat=10.25&lon=-75.45&timestamp=\"+time+\"&hdop=3&altitude=4&speed=5\"\nnode.send({payload:url}); ","outputs":1,"noerr":0,"x":290,"y":240,"wires":[["b91f024.7a333"]]}]