Brainstorm Idea, MQTT protocol?

Travis Farmer Jul 21, 2019

  1. Travis Farmer

    Travis Farmer TrainBoard Member

    352
    320
    14
    so, been a while since i logged in.
    unfortunately, my laptop died a horrible death, and i lost everything that wasn't uploaded to my GitHub, or my backup server. right now, i have been reduced to a Raspberry Pi 4B 4GB for a computer. it functions well, but i really miss my laptop.

    anyway, i know i have been out of the loop for a while, but has anybody explored MQTT as a layout system communication protocol? ( mqtt.org ) i have a MQTT server running on my main server, and even a Raspberry Pi ( http://mosquitto.org/ ).

    MQTT operates over a network, and with the little bit i have been playing with it, it seems possible. i haven't found space to setup my test track yet, but when i get another laptop, i was thinking of exploring the idea. with the protocol, and there are libraries ( https://github.com/mqtt/mqtt.github.io/wiki/libraries ) for Arduino, ESP, and a variety of other devices.

    basicly, your device connects to the MQTT broker, ad either posts and/or subscribes to a topic, and thus either receives a value, or posts a value to the server. so it could not only possibly handle the DCC++ tasks, but if for example you have an Arduino or ESP way across the layout that controls lighting, or switches, or reads block location, etc, and it would be possible to get the info around it can run on a Ethernet connection, or even WiFi.

    i will have to download a copy of my old DCC++ off my GitHub and refresh my memory, but i think it could be possible. it would, i think, simplify adding devices to the layout, like walk-around controllers that communicate over WiFi. it may even be possible to have multiple controllers, i haven't thought that far ahead.

    so, my question is, has it been explored, and if not, would there be a call for it? it would not exactly be compatible with legacy control methods, but that *could* be fixed by making a legacy to MQTT gateway controller.

    thought i would throw the idea out there, see if maybe i was on to something.
    i never gave up on DCC++, i just got really busy from so many projects on my plate at once.

    ~Travis
     
  2. Travis Farmer

    Travis Farmer TrainBoard Member

    352
    320
    14
    i dove into the DCC++ code in an effort to work in MQTT, and it wouldn't be practical to control the DCC++ driver via MQTT.
    However, it would make a great automation protocol for non track/train operations, like scenery lighting, and so on.
    so, for those that were looking forward to an easier communication protocol, sorry. for those that were dreading me treading all over the working code simply because i couldn't leave well-enough alone, and had the obsession to improve upon something already working... your safe, i will leave it alone, for now.

    what i was simply trying for, is to improve the ability for others to program in added features at a later date, without having to do a complete code re-write. that was also the intent with my attempted use of an ATtiny85 for a bare-bones DCC++ driver. but that failed as well.

    if somebody thinks i was on to something with MQTT, let me know. otherwise, i will set DCC++ improvements aside.

    ~Travis
     

Share This Page