Raspberry Pi 3 (RPI 3) gateway initialization loop



  • Hi all,

    I have a working ESP8266 gateway with 2 nodes, but I want to move the gateway to my Raspberry.

    I followed all the instructions on the website and had a successful installation.

    However, I notice that the gateway enters a loop on its initialization and keeps sending the version of MySensors to the MQTT server.

    The gateway configuration is:

    ./configure --my-transport=rfm69 --my-rfm69-frequency=433 --my-is-rfm69hw --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-user=user --my-mqtt-password=password --my-mqtt-publish-topic-prefix=mygateway1-out --my-mqtt-subscribe-topic-prefix=mygateway1-in --my-mqtt-client-id=gw_01
    

    My Raspberry runs:

    Raspbian GNU/Linux 11 (bullseye)
    

    Where I run Openhab 3.3.0

    When I run mysgw or start the service, it keeps sending the same message over an over again (many times per second) as below:

    Aug 27 23:16:00 INFO  Starting gateway...
    Aug 27 23:16:00 INFO  Protocol version - 2.3.2
    Aug 27 23:16:00 DEBUG MCO:BGN:INIT GW,CP=RPNGL---,FQ=NA,REL=255,VER=2.3.2
    Aug 27 23:16:00 DEBUG TSF:LRT:OK
    Aug 27 23:16:00 DEBUG TSM:INIT
    Aug 27 23:16:00 DEBUG TSF:WUR:MS=0
    Aug 27 23:16:00 DEBUG TSM:INIT:TSP OK
    Aug 27 23:16:00 DEBUG TSM:INIT:GW MODE
    Aug 27 23:16:00 DEBUG TSM:READY:ID=0,PAR=0,DIS=0
    Aug 27 23:16:00 DEBUG MCO:REG:NOT NEEDED
    Aug 27 23:16:00 DEBUG MCO:BGN:STP
    Aug 27 23:16:00 DEBUG MCO:BGN:INIT OK,TSP=1
    Aug 27 23:16:00 DEBUG GWT:RMQ:CONNECTING...
    Aug 27 23:16:00 DEBUG connected to 127.0.0.1
    Aug 27 23:16:00 DEBUG GWT:RMQ:OK
    Aug 27 23:16:00 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT
    Aug 27 23:16:00 DEBUG TSM:READY:NWD REQ
    Aug 27 23:16:00 DEBUG ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    Aug 27 23:16:00 DEBUG GWT:RMQ:CONNECTING...
    Aug 27 23:16:00 DEBUG connected to 127.0.0.1
    Aug 27 23:16:00 DEBUG GWT:RMQ:OK
    Aug 27 23:16:00 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT
    Aug 27 23:16:01 DEBUG GWT:RMQ:CONNECTING...
    Aug 27 23:16:01 DEBUG connected to 127.0.0.1
    Aug 27 23:16:01 DEBUG GWT:RMQ:OK
    Aug 27 23:16:01 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT
    Aug 27 23:16:01 DEBUG GWT:RMQ:CONNECTING...
    Aug 27 23:16:01 DEBUG connected to 127.0.0.1
    Aug 27 23:16:01 DEBUG GWT:RMQ:OK
    Aug 27 23:16:01 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT
    Aug 27 23:16:01 DEBUG GWT:RMQ:CONNECTING...
    Aug 27 23:16:01 DEBUG connected to 127.0.0.1
    Aug 27 23:16:01 DEBUG GWT:RMQ:OK
    Aug 27 23:16:01 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT
    Aug 27 23:16:01 DEBUG GWT:RMQ:CONNECTING...
    Aug 27 23:16:01 DEBUG connected to 127.0.0.1
    Aug 27 23:16:01 DEBUG GWT:RMQ:OK
    Aug 27 23:16:01 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT
    Aug 27 23:16:01 DEBUG GWT:RMQ:CONNECTING...
    
    

    Many thanks for any help.



  • @Oumuamua When you set

    --my-controller-ip-address=127.0.0.1
    

    you are saying your MQTT broker is on the same machine as your gateway. If, on your RPi you installed your broker with (what I do)

    sudo apt install mosquitto
    

    you will have to add the lines to /etc/mosquitto/mosquitto.conf

    allow_anonymous true
    listener 1883 0.0.0.0
    

    After that, reboot.

    Alas, this may not fix your problem. I see you're looping on connecting/connected/sent. I make the assumption that the debug message aren't quite accurate because ... well ... sometimes they aren't.

    Let us know if this works 🙂

    OSD


  • Mod

    Add --extra-cxxflags="-DMY_DEBUG_VERBOSE_GATEWAY to the configure command and run make again. This will give more details in the debug log.

    Edit: the log file of your mqtt broker might give some iseful info as well.



  • @mfalkvidd and @OldSurferDude

    My thanks for the quick hints.

    Yes, Mosquitto is running on the same machine.

    I added --extra-cxxflags="-DMY_DEBUG_VERBOSE_GATEWAY to the configure file and also updated the Mosquitto conf as per @mfalkvidd suggestion.

    Unfortunately the log did change (see below).

    One important comment: the connection is actually successful with the MQTT server as I can see all the publications in it using MQTT Explorer. It seems to me that the problem is with the gateway in some way that keeps sending it non-stop.

    The problem happens if I just run mysgw or when I start the service.

    Aug 28 07:39:11 INFO  Starting gateway...
    Aug 28 07:39:11 INFO  Protocol version - 2.3.2
    Aug 28 07:39:11 DEBUG MCO:BGN:INIT GW,CP=RPNGL---,FQ=NA,REL=255,VER=2.3.2
    Aug 28 07:39:11 DEBUG TSF:LRT:OK
    Aug 28 07:39:11 DEBUG TSM:INIT
    Aug 28 07:39:11 DEBUG TSF:WUR:MS=0
    Aug 28 07:39:11 DEBUG TSM:INIT:TSP OK
    Aug 28 07:39:11 DEBUG TSM:INIT:GW MODE
    Aug 28 07:39:11 DEBUG TSM:READY:ID=0,PAR=0,DIS=0
    Aug 28 07:39:11 DEBUG MCO:REG:NOT NEEDED
    Aug 28 07:39:11 DEBUG MCO:BGN:STP
    Aug 28 07:39:11 DEBUG MCO:BGN:INIT OK,TSP=1
    Aug 28 07:39:11 DEBUG GWT:RMQ:CONNECTING...
    Aug 28 07:39:11 DEBUG connected to 127.0.0.1
    Aug 28 07:39:11 DEBUG GWT:RMQ:OK
    Aug 28 07:39:11 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT
    Aug 28 07:39:11 DEBUG TSM:READY:NWD REQ
    Aug 28 07:39:12 DEBUG ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
    Aug 28 07:39:12 DEBUG GWT:RMQ:CONNECTING...
    Aug 28 07:39:12 DEBUG connected to 127.0.0.1
    Aug 28 07:39:12 DEBUG GWT:RMQ:OK
    Aug 28 07:39:12 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT
    Aug 28 07:39:12 DEBUG GWT:RMQ:CONNECTING...
    Aug 28 07:39:12 DEBUG connected to 127.0.0.1
    Aug 28 07:39:12 DEBUG GWT:RMQ:OK
    Aug 28 07:39:12 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT
    Aug 28 07:39:12 DEBUG GWT:RMQ:CONNECTING...
    Aug 28 07:39:12 DEBUG connected to 127.0.0.1
    Aug 28 07:39:12 DEBUG GWT:RMQ:OK
    Aug 28 07:39:12 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT
    Aug 28 07:39:12 DEBUG GWT:RMQ:CONNECTING...
    Aug 28 07:39:12 DEBUG connected to 127.0.0.1
    Aug 28 07:39:12 DEBUG GWT:RMQ:OK
    Aug 28 07:39:12 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT
    Aug 28 07:39:12 DEBUG GWT:RMQ:CONNECTING...
    Aug 28 07:39:12 DEBUG connected to 127.0.0.1
    Aug 28 07:39:12 DEBUG GWT:RMQ:OK
    Aug 28 07:39:12 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT
    Aug 28 07:39:13 DEBUG GWT:RMQ:CONNECTING...
    Aug 28 07:39:13 DEBUG connected to 127.0.0.1
    Aug 28 07:39:13 DEBUG GWT:RMQ:OK
    Aug 28 07:39:13 DEBUG GWT:TPS:TOPIC=mygateway1-out/0/255/0/0/18,MSG SENT
    
    


  • @Oumuamua said in Raspberry Pi 3 (RPI 3) gateway initialization loop:
    This is a clue (or a red herring) because there is a ? in the message.

    Aug 28 07:39:12 DEBUG ?TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:

    Hopefully @mfalkvidd can tell us what it means



  • Problem solved: I was using as --my-mqtt-client-id the same name as my previous broker.

    Thanks for your help all!


Log in to reply
 

Suggested Topics

  • 3
  • 10
  • 4
  • 3
  • 2
  • 2

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts