roataway / roataway-web

Roataway web site
https://roataway.md
GNU Affero General Public License v3.0
20 stars 13 forks source link

Switch to the MQTT-backed transport #81

Open roata opened 4 years ago

roata commented 4 years ago

Currently we use an API that was not documented officially, the one that runs on top of WebSTOMP. The new API, documented in api-documentation is using MQTT and is more reliable (it runs on a separate server, and it works even when RabbitMQ is down).

The payload formats are the same, and the subscription logic is the same too.

What is different:

iamandrewluca commented 4 years ago

Can we get state.station from MQTT ?

For station panels we can split frontend, and use webstomp.

roata commented 4 years ago

Hmm, at the moment it is not available over MQTT. I will make it happen and write about it tonight.

Note, however, that this feature request is for milestone 3.0, so - in the future. At the moment our top priorities are route-multi-subscription and the performance issues #76. It is getting unusable on my phone, and sometimes even on my computer.

roata commented 4 years ago

@iamandrewluca, I forgot about this, but stumbled upon it today. The ETAs are now exposed to the public via MQTT as well, here's how it works: mosquitto_sub -h opendata.dekart.com -p 1945 -t state/infopanel/+

Payload example:

{"route": 30, "station": "Aeroport - pornire", "time": "2"}

The format is a draft and will be changed, based on feedback. The payloads may contain other elements - don't count on those.

roata commented 3 years ago

This could be relevant, since the bus telemetry also uses MQTT: https://github.com/roataway/gtfs-data/issues/5

iamandrewluca commented 3 years ago

Notes;