owntracks / talk

Questions, talk about OwnTracks
32 stars 4 forks source link

HTTP add topic to the json body #105

Closed ronsmits closed 3 years ago

ronsmits commented 3 years ago

I find that MQTT is not very reliable when used on mobile phones / networks. either running normally against port 1883 or with websockets on port 9001 the connection does not very stable. Using HTTP works very well, however the topic from MQTT is not there. Is it possible to add that to the json object that is returned?

If it is added a seperate key value it should not interfere with already existing implementations like

{
  "_type": "encrypted",
  "topic": "owntracks/ron/1/waypoint"
   "data": "ssdfkjhsdkflgjh ewriutydkfjgvbdksfjghdkfjghdf==="
}

I wrote a simple server thingy (kotlin is great) that receives the http post, decrypts it and then publishes it to a local mqtt broker. If the topic is in the json block then the publishing would be completely consistent with the mqtt implementation

jpmens commented 3 years ago

I think the topic is/was added in iOS but not in Android. If I remember correctly, we also wanted the topic in the JSON payload for our HTTP Traccar protocol decoder.

Looking at the Booklet, topic is in the HTTP payloads in iOS, but not in Android. Is that last part accurate, @growse?

growse commented 3 years ago

topic is not included in the message on Android - the JSON body sent is identical for both MQTT and HTTP.

If we want to change, I can probably mark as a bug and include in the next beta for 2.4?

jpmens commented 3 years ago

I think we should do that, @growse. If you call it an enhancement, I'll feel less bad about it. :-)

growse commented 3 years ago

Do we just want the topic? There's other MQTT-specific message settings like qos and retained that could also be added.

jpmens commented 3 years ago

Just topic in order to have better control over identity. Quoting the Booklet:

jpmens commented 3 years ago

Closing this issue, followup here.