Connecting to mqtt for device data

draksh4 years ago

Hi,

I just downloaded traccar app source code and trying to use traccar server and web app. Wanted to know how to connect to mqqt server and get the device data. Here is our sample message format:

{
  "I": "123456789012345",
  "T": "20201021183423",
  "V": 12.62,
  "A": "1",
  "La": 12.9961,
  "Lo": 77.697556,
  "Alt": 917.3
}

Once the connection is successful, do I need to add any attributes to display the device info on map?

Ernesto Vallejo4 years ago

Use OsmAnd protocol

draksh2 years ago

Issue https://github.com/traccar/traccar/issues/1582 is closed stating Traccar now supports MQTT protocol. Can someone guide me where we have to provide the MQTT configurations for the connections. Any sample or documentation would be really helpful.

Anton Tananaev2 years ago

Check the IOTM protocol. That's the one that's based on MQTT.

draksh2 years ago

Hi @Anton Tananaev,

Thanks for responding so quickly. I couldn't find the documentation for IOTM protocol. In the protocol or decoder file I don't see any Mqtt config parameters that is getting set explicitly. For Mqtt connection we might have to specify serverUrl, port, rootTopic, path for the key files etc.,
Could you please guide me in which file all these configurations should go.

Anton Tananaev2 years ago

Traccar receives the data. It does not publish anything.

draksh2 years ago

How about sending commands?

Anton Tananaev2 years ago

I don't think commands are supported for that specific protocol.

Ann2 years ago

Hi Gentlemen. Have you solved the issue of transferring data from radio devices via the MQTT server to the Traccar server? I see a lot of interest in the topic on both discord and github or meshtastic forum. But... it's not working. If you are able to write what and how - I will be grateful. Take care :-)