sending position data to an MQTT broker

yourmate 3 years ago

Hi,

one of the devices I use on the traccar server is a Teltonika RUT955 which works absolutely fine with the server.
I would like to monitor this device in the web interface as usual but I would also like to send this device's position data to Home Assistant through Mosquitto.

Could you give me some guidance how this would be achievable, please?

Anton Tananaev 3 years ago

It was just implemented recently:

https://github.com/traccar/traccar/pull/5009

yourmate 3 years ago

5 days ago?!?
Thank you Anton, you guys are superstars :)

Traccar runs on an Ubuntu LXC container in Proxmox. Home Assistant runs as a VM on the same Proxmox node with an IP address of 192.168.22.11. The Mosquitto broker runs as an add-on/integration within HA.

I modified my traccar.xml with the following code but it does not send any location data to the broker, mind the vehicle has been stationary for 10 hours now.

Do I miss something obvious?

<entry key='event.forward.type'>mqtt</entry>
<entry key='event.forward.url'>mqtt://my_mqtt_user:my_password@192.168.22.11:1883</entry>
<entry key='event.forward.topic'>traccar/events</entry>

I reckon that QoS level is 0, right?
Also, could I alter the topic or should it be left as traccar/events?

EDIT:
The RUT955 unit is on the same network - the Proxmox server is installed in said vehicle.

yourmate 3 years ago

Checking the Mosquitto logs I found this. Could this be traccar?

2022-12-29 09:10:21: New connection from 172.30.32.2:48638 on port 1883.
2022-12-29 09:10:21: Client <unknown> closed its connection.
2022-12-29 09:12:21: New connection from 172.30.32.2:42600 on port 1883.
2022-12-29 09:12:21: Client <unknown> closed its connection.
2022-12-29 09:14:22: New connection from 172.30.32.2:51292 on port 1883.
2022-12-29 09:14:22: Client <unknown> closed its connection.
2022-12-29 09:16:22: New connection from 172.30.32.2:47450 on port 1883.
2022-12-29 09:16:22: Client <unknown> closed its connection.
2022-12-29 09:18:22: New connection from 172.30.32.2:33216 on port 1883.
2022-12-29 09:18:22: Client <unknown> closed its connection.
2022-12-29 09:20:22: New connection from 172.30.32.2:54758 on port 1883.
2022-12-29 09:20:22: Client <unknown> closed its connection.
Anton Tananaev 3 years ago

I recommended asking on the GitHub pull request directly. It was a contribution, so I haven't actually tried it myself yet.

Dinoc 2 years ago

Hello Anton.
I have my application in the Traccar cloud.
Would it be possible for me to send the tracker data to my MQTT server?
Thanks!

Anton Tananaev 2 years ago

It should be possible. We have MQTT position forwarding.

Dinoc 2 years ago

Could you tell me how I configure the Traccar server to send the data to my MQTT server. I saw some information on the forum, but it seemed to be related to local Traccar user servers.
Thank you for your attention and help.

Anton Tananaev 2 years ago

If the question is about a subscription, please email support.

Dinoc 2 years ago

Thank you Anton!
I am sending the question about my account to support.
Att;