Mikrotik - Get data

Hi, I'm very newbee to Node-RED, I only made some API call to my local transportation's public API with the http request node.

I'd like to solve a GPS problem with Node-Red. I'm looking for a way to ask the GPS capable Mikrotik Router's lat / long position.

I got stuck when making the initial request, the node stays in : requesting state. and the answer is:
"no response from server" or "Error: ESOCKETTIMEDOUT : http://x.x.x.1:8728"

Please help me out if you have experience with this. I'd like zo mimic a logon and a terminal with Node-red, and parse out the long and lat from the router, and than transform to OSMAND and send it to Traccar :slight_smile:

Thnaks

Zoli

I think you need to provide a bit more information.

What have you tried so far? Are any custom nodes involved? Maybe share a part of the flow.

I need some time, Ive just cannibalised the host :-))) I run node-red in docker... the request was in a loop...

Oooops! :crazy_face:

Try starting Node-RED with --safe. That way the flows won't start and you can fix the bug.

1 Like

is the http request appropriate to login to the Router?

I don't know your specific hardware, but if your router provides a HTTP interface, then yes.

with http request it becomes connected, I think ssh node would be the best, so I'll try the node-red-contrib-ssh

Then you're on the right track!

For debugging, it's best to add some debug nodes with the "complete message" setting to see whats going on.

1 Like

This is what Ive done so far:

[{"id":"8e03c0ba.cc4f2","type":"tab","label":"Mikrotik - Traccar","disabled":false,"info":""},{"id":"46941acf.02f724","type":"inject","z":"8e03c0ba.cc4f2","name":"trigger","topic":"","payload":"","payloadType":"date","repeat":"3","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":140,"wires":[["e7fdf82f.2de7d8"]]},{"id":"e7fdf82f.2de7d8","type":"ssh-client","z":"8e03c0ba.cc4f2","debug":false,"ssh":"","hostname":"10.20.20.1","name":"Mikrotik LtAP mini","x":470,"y":320,"wires":[["f9e2bb06.cbc47"]]},{"id":"f9e2bb06.cbc47","type":"exec","z":"8e03c0ba.cc4f2","command":"system identity set name=\"from-node-red\" ","addpay":true,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":800,"y":220,"wires":[["30fe042b.83037c"],["30fe042b.83037c"],["30fe042b.83037c"]]},{"id":"30fe042b.83037c","type":"debug","z":"8e03c0ba.cc4f2","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"payload","targetType":"msg","x":1200,"y":280,"wires":[]}]

But It doesnt work yet. I Just would like to set the Microtik's identity.

Note that there are mikrotik nodes available

1 Like

Thank you!

Hi, Thanks. Interestingly I cannot install additional noded via npm.
I'm testing Node-RED with Docker.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.