Switching from ethernet gateway to MQTT



  • Hi,

    I want to switch from an ethernet- to an MQTT-gateway, to be able to add some ESP8266 and ESP32 "natively", i.e. without extra nRF24-modules.

    From all I´ve read, my "old" gateway (ethernet) uses the nRF24-module of my Raspi to communicate with the nodes. MySensors handels the messaging stuff, talks to Domoticz using the easy-to-use LAN interface.

    Switching from ethernet to MQTT means I have the option to send also data per MQTT to and from the MS-gateway, besides the "usual nRF24-way". Only difference is to setup a MQTT gateway instead of the ethernet-gateway within domotics and to install a Mosquitto Broker (Server). Now the communication Domoticz <-> MySensors uses MQTT the usual ethernet gateway, nodes can connect the "usual way" using nRF24 or communicate using MQTT. MySensors uses the Mosquitto server for some implementation(?). Communication is then node <-> Mosquitto Broker <-> MySensors <-> Domoticz (?)

    Sadly, the Domoticz tutorial is very unclear about that , it just said install Mosquitto, you need it. Also the Build-section here did not help much, and reading here on the forum did confuse more then it helped.

    However, I managed it to let Domoticz and MySensors connect fine.

    Nov 30 02:16:29 INFO  Starting gateway...
    Nov 30 02:16:29 INFO  Protocol version - 2.3.0
    Nov 30 02:16:29 DEBUG MCO:BGN:INIT GW,CP=RNNGL---,VER=2.3.0
    Nov 30 02:16:29 DEBUG TSF:LRT:OK
    Nov 30 02:16:29 DEBUG TSM:INIT
    Nov 30 02:16:29 DEBUG TSF:WUR:MS=0
    Nov 30 02:16:29 DEBUG TSM:INIT:TSP OK
    Nov 30 02:16:29 DEBUG TSM:INIT:GW MODE
    Nov 30 02:16:29 DEBUG TSM:READY:ID=0,PAR=0,DIS=0
    Nov 30 02:16:29 DEBUG MCO:REG:NOT NEEDED
    Nov 30 02:16:29 DEBUG MCO:BGN:STP
    Nov 30 02:16:29 DEBUG MCO:BGN:INIT OK,TSP=1
    Nov 30 02:16:29 DEBUG GWT:RMQ:MQTT RECONNECT
    Nov 30 02:16:29 DEBUG connected to 127.0.0.1
    Nov 30 02:16:29 DEBUG GWT:RMQ:MQTT CONNECTED
    Nov 30 02:16:29 DEBUG GWT:TPS:TOPIC=domoticz/in/MyMQTT/0/255/0/0/18,MSG SENT
    Nov 30 02:16:36 DEBUG TSF:MSG:READ,51-51-0,s=2,c=1,t=37,pt=3,l=2,sg=0:5
    Nov 30 02:16:36 DEBUG GWT:TPS:TOPIC=domoticz/in/MyMQTT/51/2/1/0/37,MSG SENT
    Nov 30 02:16:56 DEBUG GWT:IMQ:TOPIC=domoticz/out/MyMQTT/0/0/3/0/18, MSG RECEIVED
    Nov 30 02:16:56 DEBUG GWT:TPS:TOPIC=domoticz/in/MyMQTT/0/255/3/0/22,MSG SENT
    

    Problems starting with having no Version on hardware-tab (MySensors Gateway with MQTT interface
    Version: ?), and the type of my "old" nodes is not recognized. I see the Node IDs I gave em, children type is unknown, values (f.e. #1.V_TEMP (24.3)) are received, but do not show up at the devices tab.
    Do I have to rewrite all the Nodes to now use MQTT? As the nRF-nodes have no ethernet-interface, I only could add MY_MQTT_PUBLISH_TOPIC_PREFIX and MY_MQTT_SUBSCRIBE_TOPIC_PREFIX.

    Sorry if I am asking noobish questions here, I´m only searching for a good way to let Arduinos and ESPs work side by side fine while using the hardware they provide.
    From all I´ve read, a MQTT gateway is the best way (better then connect every ESP as a separate gateway). Or maybe I have missed something?



  • Update: rebuild from the bones. Raspi-OS, Domoticz, Mosquitto, MySensors.
    I don´t get a version of my gateway nether.
    Sensors run but have to be renamed complete within Domotics (database backup did not help), and all data is lost.


Log in to reply
 

Suggested Topics

  • 3
  • 6
  • 1
  • 2

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts