Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. Troubleshoot Nano temp/humidity to ESP8266-MQTT gateway issue

Troubleshoot Nano temp/humidity to ESP8266-MQTT gateway issue

Scheduled Pinned Locked Moved Troubleshooting
10 Posts 4 Posters 2.7k Views 4 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jwosnick
    wrote on last edited by
    #1

    Everyone,

    I am new to MySensors but have experience with Arduino, ESP8266, and MQTT. Trying to debug my "starter" MySensors setup and am having a hard time.

    My set up is as follows:

    • Sensor node: Arduino Nano clone with a DHT22 attached (DHT22 and Nano clone tested and working fine in non-MySensors applications). An NRF24L01 is attached, with a 10-uF cap across VCC-GND. It is running a variant of the humidity / temperature script described at https://www.mysensors.org/build/humidity. I made changes to make the script compatible with the standard DHT library.
    • Gateway: A Wemos D1 Mini with an NRF24L01 attached (also with a 10-uF cap). It is running the ESP8266 variant of the MQTT gateway script described at https://www.mysensors.org/build/mqtt_gateway#mqttgateway-example

    When I run the gateway script, the following appears in the serial monitor:

    0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGE--,VER=2.1.1
    0;255;3;0;9;TSF:LRT:OK
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSF:WUR:MS=0
    scandone
    state: 0 -> 2 (b0)
    state: 2 -> 3 (0)
    state: 3 -> 5 (10)
    add 0
    aid 4
    cnt 
    
    connected with Frog Station Alpha, channel 4
    dhcp client start...
    0;255;3;0;9;TSM:INIT:TSP OK
    0;255;3;0;9;TSM:INIT:GW MODE
    0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
    0;255;3;0;9;MCO:REG:NOT NEEDED
    f r0, scandone
    ip:192.168.1.189,mask:255.255.255.0,gw:192.168.1.1
    .IP: 192.168.1.189
    0;255;3;0;9;MCO:BGN:STP
    0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
    IP: 192.168.1.189
    0;255;3;0;9;Attempting MQTT connection...
    0;255;3;0;9;MQTT connected
    0;255;3;0;9;Sending message on topic: mygateway1-out/0/255/0/0/18
    pm open,type:2 0
    
    

    I see nothing after this, though my MQTT broker does indeed successfully receive the message "2.1.1" on topic mygateway1-out/0/255/0/0/18.

    On the sensor node side, the serial output looks like this:

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.1.1
    3 TSM:INIT
    4 TSF:WUR:MS=0
    11 TSM:INIT:TSP OK
    13 TSM:FPAR
    15 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    2022 !TSM:FPAR:NO REPLY
    2024 TSM:FPAR
    2026 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    4034 !TSM:FPAR:NO REPLY
    4036 TSM:FPAR
    4038 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    6046 !TSM:FPAR:NO REPLY
    6048 TSM:FPAR
    6050 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    8058 !TSM:FPAR:FAIL
    8059 TSM:FAIL:CNT=1
    8061 TSM:FAIL:PDT
    

    This type of output continues on and on.

    Obviously there is a "failure" but is it possible to diagnose where the problem lies, based on this output?

    Many thanks! I'm hoping I can get this working.

    1 Reply Last reply
    0
    • J Offline
      J Offline
      jwosnick
      wrote on last edited by
      #2

      Any ideas from the crowd? I tried swapping in a NRF24L01 on the gateway side, which had no effect.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        Fabien
        wrote on last edited by
        #3

        Triple check wires (and change them, sometimes dupont câble are bad) on Gateway side.

        1 Reply Last reply
        0
        • J Offline
          J Offline
          jwosnick
          wrote on last edited by jwosnick
          #4

          Thanks for the tip. I changed to a new ESP8266 unit (now a NodeMCU board) and may be getting somewhere.

          I can see what looks like the node and the gateway talking to each other, but the node never gets to the part where it actually reads a temperature! It seems to be stuck at some kind of "handshake" stage.

          The log on the sensor node side reads as follows:

          2503067 TSM:FAIL:RE-INIT
          2503069 TSM:INIT
          2503076 TSM:INIT:TSP OK
          2503078 TSM:FPAR
          2503081 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
          2503468 TSF:MSG:READ,0-0-255,s=255,c=3,t=8,pt=1,l=1,sg=0:0
          2503473 TSF:MSG:FPAR OK,ID=0,D=1
          2505090 TSM:FPAR:OK
          2505091 TSM:ID
          2505093 TSM:ID:REQ
          2505096 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
          2507103 TSM:ID
          2507104 TSM:ID:REQ
          2507107 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
          2509115 TSM:ID
          2509116 TSM:ID:REQ
          2509119 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
          2511127 TSM:ID
          2511128 TSM:ID:REQ
          2511131 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
          2513139 !TSM:ID:FAIL
          2513141 TSM:FAIL:CNT=7
          2513143 TSM:FAIL:PDT
          

          On the gateway side, I see publish events to my MQTT broker on the topic mygateway1-out/255/255/3/0/3 with no content in the message (timed corresponding to the TSF:MSG:SEND events in the sensor node log) so I assume the radios are actually talking to one another. I just don't know why the temperature isn't being read.

          mfalkviddM 1 Reply Last reply
          0
          • J jwosnick

            Thanks for the tip. I changed to a new ESP8266 unit (now a NodeMCU board) and may be getting somewhere.

            I can see what looks like the node and the gateway talking to each other, but the node never gets to the part where it actually reads a temperature! It seems to be stuck at some kind of "handshake" stage.

            The log on the sensor node side reads as follows:

            2503067 TSM:FAIL:RE-INIT
            2503069 TSM:INIT
            2503076 TSM:INIT:TSP OK
            2503078 TSM:FPAR
            2503081 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
            2503468 TSF:MSG:READ,0-0-255,s=255,c=3,t=8,pt=1,l=1,sg=0:0
            2503473 TSF:MSG:FPAR OK,ID=0,D=1
            2505090 TSM:FPAR:OK
            2505091 TSM:ID
            2505093 TSM:ID:REQ
            2505096 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
            2507103 TSM:ID
            2507104 TSM:ID:REQ
            2507107 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
            2509115 TSM:ID
            2509116 TSM:ID:REQ
            2509119 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
            2511127 TSM:ID
            2511128 TSM:ID:REQ
            2511131 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
            2513139 !TSM:ID:FAIL
            2513141 TSM:FAIL:CNT=7
            2513143 TSM:FAIL:PDT
            

            On the gateway side, I see publish events to my MQTT broker on the topic mygateway1-out/255/255/3/0/3 with no content in the message (timed corresponding to the TSF:MSG:SEND events in the sensor node log) so I assume the radios are actually talking to one another. I just don't know why the temperature isn't being read.

            mfalkviddM Offline
            mfalkviddM Offline
            mfalkvidd
            Mod
            wrote on last edited by mfalkvidd
            #5

            The node is requesting an ID from your controller (see the log parser for more info)

            I don't think handing out dynamic IDs works with mqtt. Define a node ID manually by adding

            #define MY_NODE_ID 123
            

            before including MySensors.h

            J mppM 2 Replies Last reply
            0
            • J Offline
              J Offline
              jwosnick
              wrote on last edited by
              #6

              Thanks for the tip, I'll give it a try. It occurs to me that I have no "controller" here and so that may be why I'm getting errors.

              1 Reply Last reply
              0
              • mfalkviddM mfalkvidd

                The node is requesting an ID from your controller (see the log parser for more info)

                I don't think handing out dynamic IDs works with mqtt. Define a node ID manually by adding

                #define MY_NODE_ID 123
                

                before including MySensors.h

                J Offline
                J Offline
                jwosnick
                wrote on last edited by
                #7

                @mfalkvidd said in Troubleshoot Nano temp/humidity to ESP8266-MQTT gateway issue:

                I don't think handing out dynamic IDs works with mqtt. Define a node ID manually by adding

                #define MY_NODE_ID 123
                

                before including MySensors.h

                It worked. Data is coming through now. Thanks again!

                mfalkviddM 1 Reply Last reply
                1
                • J jwosnick

                  @mfalkvidd said in Troubleshoot Nano temp/humidity to ESP8266-MQTT gateway issue:

                  I don't think handing out dynamic IDs works with mqtt. Define a node ID manually by adding

                  #define MY_NODE_ID 123
                  

                  before including MySensors.h

                  It worked. Data is coming through now. Thanks again!

                  mfalkviddM Offline
                  mfalkviddM Offline
                  mfalkvidd
                  Mod
                  wrote on last edited by
                  #8

                  @jwosnick great! Thanks for reporting back.

                  1 Reply Last reply
                  0
                  • mfalkviddM mfalkvidd

                    The node is requesting an ID from your controller (see the log parser for more info)

                    I don't think handing out dynamic IDs works with mqtt. Define a node ID manually by adding

                    #define MY_NODE_ID 123
                    

                    before including MySensors.h

                    mppM Offline
                    mppM Offline
                    mpp
                    wrote on last edited by mpp
                    #9

                    @mfalkvidd said in Troubleshoot Nano temp/humidity to ESP8266-MQTT gateway issue:

                    I don't think handing out dynamic IDs works with mqtt.

                    It took me some time to find out that dynamic IDs don't work (yet?) with MQTT. Is there some documentation about this? Perhaps a note about this could be added here or a feature request could be opened here?

                    MyController with USB powered WeMos D1/mini ESP8266 MQTT Gateways and battery powered Arduino Pro Mini using the RFM69 radio

                    mfalkviddM 1 Reply Last reply
                    0
                    • mppM mpp

                      @mfalkvidd said in Troubleshoot Nano temp/humidity to ESP8266-MQTT gateway issue:

                      I don't think handing out dynamic IDs works with mqtt.

                      It took me some time to find out that dynamic IDs don't work (yet?) with MQTT. Is there some documentation about this? Perhaps a note about this could be added here or a feature request could be opened here?

                      mfalkviddM Offline
                      mfalkviddM Offline
                      mfalkvidd
                      Mod
                      wrote on last edited by
                      #10

                      @mpp I've added a note to the MQTT gateway page, thanks for suggesting.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      15

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.1k

                      Posts


                      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular