new alternative train firmware using MQTT

Forum about the OS-Railway project available on Thingiverse. Here you can ask questions, look at building pictures, share ideas, pictures and STL's.
aligator
Posts: 2
Joined: Sat Jul 25, 2020 8:25 am

new alternative train firmware using MQTT

Postby aligator » Sat Jul 25, 2020 8:58 am

hi

I just started a new firmware for the trains which uses MQTT for communication. https://github.com/aligator/OSRailwayTrain

For all who don't know what MQTT is:
It is a simple Protocol to send messages to iot devices. It works very well with the ESP-8266.
Every client can listen to specific topics and then receives the messages automatically.

Advantages:
- MQTT is widely used for iot and therefore there are many tools/apps to communicate with it.
- It is also very lightweight and efficient on the client side.
- The protocol needs only a low band-with.

Disadvantage:
- MQTT needs a server (broker). But this is no problem if you already use it for other iot projects.
And also if not, it's easily set one up using a raspi (using Mosquitto, https://github.com/eclipse/mosquitto, https://randomnerdtutorials.com/how-to- ... pberry-pi/). There is even an implementation for the esp-8266 (https://github.com/martin-ger/esp_mqtt) but I haven't tested how it performs...

Because I had problems using the official firmware (it behaved very strangely on my esp...) I decided to write my own.
Currently my solution is only based on MQTT so there is no webinterface. But it can already be used using any mqtt app. I use https://play.google.com/store/apps/deta ... x.mqttdash for testing currently.

It is built using the Platformio platform (basically a better library management and IDE support than plain Arduino, still uses the Arduino framework).

I already have some ideas how to improve the firmware. For example I would like to write a OSRailway controling software using a web-ui (I will very likely write this webserver in Golang.)

Finally it is possible (and I think very easy) to also write a firmware for the remote control which is compatible with my train firmware.

I am open to suggestions and help :-)

admin
Site Admin
Posts: 314
Joined: Thu Jan 11, 2018 7:46 pm

Re: new alternative train firmware using MQTT

Postby admin » Fri Jul 31, 2020 10:44 am

Hi!

Thanks for your contribution! I have dreamt of a unified open source software development for this project for a long time. I will go through this when I get home, I'm out traveling today but when we have something started that is worth publishing I will add links to all the thingiverse pages. I will get back on this hopefully now during the weekend!

aligator
Posts: 2
Joined: Sat Jul 25, 2020 8:25 am

Re: new alternative train firmware using MQTT

Postby aligator » Tue Aug 04, 2020 5:35 pm

Ok,
I have to finish my train first, but then I could start working on a remote control firmware as the next step. I haven't looked into the existing remote control firmware yet, but I think it should be easy possible. I could also implement something like auto-discovery using mqtt, like posting the train name on activation of the train in a special mqtt-channel which the remote listens to.

Feel free to post your ideas about this project.

admin
Site Admin
Posts: 314
Joined: Thu Jan 11, 2018 7:46 pm

Re: new alternative train firmware using MQTT

Postby admin » Thu Aug 06, 2020 10:09 pm

Hi, ok, please post some pictures or video when you have it up'n'running. :) I'm currently waiting for TTGO boards with ESP32 that I ordered. Those seems to be very nice and could be very suitable at least as remote control platform to simplify construction and add performance.


Who is online

Users browsing this forum: No registered users and 0 guests