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. Simple Serial Gateway and sensor does not work...

Simple Serial Gateway and sensor does not work...

Scheduled Pinned Locked Moved Troubleshooting
14 Posts 5 Posters 5.9k Views 3 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.
  • LOSTL Offline
    LOSTL Offline
    LOST
    wrote on last edited by LOST
    #1

    Hi,

    I've downloaded the latest release of MySensors (2.0.0) and uploaded the GatewaySerial sketch (unmodified) to a NANO [1] with a NRF24L01+ [2] with the extra antenna like in the tutorial video [3]

    I've also uploaded a sketch to a Mini Pro 5v with a DHT22

    /*
     * TEST SKETCH
     */
    
    // Enable debug prints
    #define MY_DEBUG
    
    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    //#define MY_RADIO_RFM69
    
    // SET NODE ID
    #define MY_NODE_ID 10
    
    #include <SPI.h>
    #include <MySensors.h>  
    #include <DHT.h>  
    
    #define CHILD_ID_TEMP 11
    #define CHILD_ID_HUM 12
    #define HUMIDITY_SENSOR_DIGITAL_PIN 3
    unsigned long SLEEP_TIME = 5*1000; // Sleep time between reads (in milliseconds)
    
    DHT dht;
    float lastTemp = -100;
    float lastHum = -100;
    boolean metric = true; 
    
    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    
    void presentation() {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("TestSketch 1.0");
    
      // Register all sensors to gateway (they will be created as child devices)
      present(CHILD_ID_HUM, S_HUM);
      present(CHILD_ID_TEMP, S_TEMP);
      
    }
    
    void setup() {
      // put your setup code here, to run once:
      Serial.begin(115200);
      Serial.println("Setting up..");
      dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN);
      Serial.flush();
    }
    
    void loop() {
      // put your main code here, to run repeatedly:
     delay(dht.getMinimumSamplingPeriod());
    
      float temperature = dht.getTemperature();
      if (isnan(temperature)) {
          Serial.println("Failed reading temperature from DHT");
      } else if (temperature != lastTemp) {
        lastTemp = temperature;
        if (!metric) {
          temperature = dht.toFahrenheit(temperature);
        }
        send(msgTemp.set(temperature, 1));
        Serial.print("T: ");Serial.println(temperature);
      }
      
      float humidity = dht.getHumidity();
      if (isnan(humidity)) {
          Serial.println("Failed reading humidity from DHT");
      } else if (humidity != lastHum) {
          lastHum = humidity;
          send(msgHum.set(humidity, 1));
          Serial.print("H: ");Serial.println(humidity);
      }
      sleep(SLEEP_TIME);
    }
    

    This is the output of the gateway:

    0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
    0;255;3;0;9;TSM:INIT
    0;255;3;0;9;TSM:RADIO:OK
    0;255;3;0;9;TSM:GW MODE
    0;255;3;0;9;TSM:READY
    0;255;3;0;14;Gateway startup complete.
    0;255;0;0;18;2.0.0
    0;255;3;0;9;No registration required
    0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
    0;255;3;0;9;TSP:SANCHK:OK
    0;255;3;0;9;TSP:SANCHK:OK
    0;255;3;0;9;TSP:SANCHK:OK
    0;255;3;0;9;TSP:SANCHK:OK
    
    

    This is the output of the sensor:

    TSM:PDT
    TSM:INIT
    TSM:RADIO:OK
    TSP:ASSIGNID:OK (ID=10)
    TSM:FPAR
    TSP:MSG:SEND 10-10-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 10-10-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 10-10-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 10-10-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    !TSM:FPAR:FAIL
    !TSM:FAILURE
    TSM:PDT
    TSM:INIT
    TSM:RADIO:OK
    TSP:ASSIGNID:OK (ID=10)
    TSM:FPAR
    TSP:MSG:SEND 10-10-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 10-10-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 10-10-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    TSM:FPAR
    TSP:MSG:SEND 10-10-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
    !TSM:FPAR:FAIL
    !TSM:FAILURE
    

    I'm guessing they are not communicating with each-other? And I'm a little lost here and don't know where to continue troubleshooting.. I've replaced the SerialGateway with another radio and nano and both have the same issue.
    I've also tried several other mini's and radios, but no difference.

    Using Arduino 1.6.9 and capacitors on the radios...

    Any suggestions what to do next?

    [1]Nano
    [2]NRF24L01+
    [3]Video

    1 Reply Last reply
    0
    • SGiS Offline
      SGiS Offline
      SGi
      wrote on last edited by
      #2

      I have exactly the same problem.....

      1 Reply Last reply
      0
      • LOSTL Offline
        LOSTL Offline
        LOST
        wrote on last edited by
        #3

        It looks like it's similar to this: https://forum.mysensors.org/topic/4296/unable-to-get-simple-gateway-button-sensor-to-work-together

        I'm gonna try the debug for the NRF if it reveals any more...

        tekkaT 1 Reply Last reply
        0
        • LOSTL LOST

          It looks like it's similar to this: https://forum.mysensors.org/topic/4296/unable-to-get-simple-gateway-button-sensor-to-work-together

          I'm gonna try the debug for the NRF if it reveals any more...

          tekkaT Offline
          tekkaT Offline
          tekka
          Admin
          wrote on last edited by
          #4

          @LOST @SGi also make sure GW and node are not too close from each other.

          SGiS 1 Reply Last reply
          0
          • tekkaT tekka

            @LOST @SGi also make sure GW and node are not too close from each other.

            SGiS Offline
            SGiS Offline
            SGi
            wrote on last edited by
            #5

            @tekka my node and gateway are about 1m apart

            tekkaT 1 Reply Last reply
            0
            • SGiS Offline
              SGiS Offline
              SGi
              wrote on last edited by
              #6

              Hmmm even when I try the example battery status sketch I get the same results from the debug.... Maybe something to do with the Nano or wiring?

              1 Reply Last reply
              0
              • SGiS Offline
                SGiS Offline
                SGi
                wrote on last edited by
                #7

                Oh I am using a Uno for the gateway and a nano for the DHT node...

                1 Reply Last reply
                0
                • SGiS SGi

                  @tekka my node and gateway are about 1m apart

                  tekkaT Offline
                  tekkaT Offline
                  tekka
                  Admin
                  wrote on last edited by
                  #8

                  @SGi I suggest to put them even further away, I've had similar issues with the LNA PA RF24 version.

                  SGiS 1 Reply Last reply
                  0
                  • tekkaT tekka

                    @SGi I suggest to put them even further away, I've had similar issues with the LNA PA RF24 version.

                    SGiS Offline
                    SGiS Offline
                    SGi
                    wrote on last edited by
                    #9

                    @tekka thanks but that doesn't appear to change anything. Do you understand the error from the sensor debug? Is it not getting a response so it restarts or something? Basically is it more likely the sensor or gateway end with the problem?

                    1 Reply Last reply
                    0
                    • ? Offline
                      ? Offline
                      A Former User
                      wrote on last edited by A Former User
                      #10

                      Here the same, a simple sketch sending a value every 2 seconds on Arduino Pro mini its working but on @scalz simple aa node with atmega328 1MHz bootloader i am getting this error

                      Starting sensor (RRNNA-, 2.0.0)
                      TSM:INIT
                      TSM:RADIO:OK
                      TSP:ASSIGNID:OK (ID=41)
                      TSM:FPAR
                      TSP:MSG:SEND 41-41-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                      TSM:FPAR
                      TSP:MSG:SEND 41-41-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                      TSM:FPAR
                      TSP:MSG:SEND 41-41-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                      TSM:FPAR
                      TSP:MSG:SEND 41-41-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
                      !TSM:FPAR:FAIL
                      !TSM:FAILURE
                      TSM:PDT
                      

                      And this on the gateway

                      0;255;3;0;9;TSP:MSG:BC
                      0;255;3;0;9;TSP:MSG:FPAR REQ (sender=41)
                      0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
                      0;255;3;0;9;TSP:MSG:GWL OK
                      0;255;3;0;9;!TSP:MSG:SEND 0-0-41-41 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
                      0;255;3;0;9;TSP:MSG:READ 41-41-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
                      0;255;3;0;9;TSP:MSG:BC
                      0;255;3;0;9;TSP:MSG:FPAR REQ (sender=41)
                      0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
                      0;255;3;0;9;TSP:MSG:GWL OK
                      0;255;3;0;9;!TSP:MSG:SEND 0-0-41-41 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
                      0;255;3;0;9;TSP:MSG:READ 41-41-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
                      0;255;3;0;9;TSP:MSG:BC
                      0;255;3;0;9;TSP:MSG:FPAR REQ (sender=41)
                      0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
                      0;255;3;0;9;TSP:MSG:GWL OK
                      0;255;3;0;9;!TSP:MSG:SEND 0-0-41-41 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
                      

                      I am using RFM69 radio

                      Here is the code link text

                      1 Reply Last reply
                      0
                      • scalzS Offline
                        scalzS Offline
                        scalz
                        Hardware Contributor
                        wrote on last edited by scalz
                        #11

                        @kenci which aa node? I don't think this is my design ;)

                        About your issue,I have not digged yet so I don't know. On my side, the stParentUpdate is working I guess as I have not this problem. I'm using RFM69 too with a serial GW. But I'm still on end june temp 2.0b rev so I have not completely migrated to the new lib as I had some sketch to finish. I will update and diffcheck tests device today. So I will see if I fall into this, and try to debug if I can replicate the problem ;)

                        Just in case, what is your GW? I have serial gw + esp mqtt on my side for testing.

                        ? 1 Reply Last reply
                        0
                        • SGiS Offline
                          SGiS Offline
                          SGi
                          wrote on last edited by
                          #12

                          https://forum.mysensors.org/topic/4316/version-2-0-isn-t-working this could be the fix... Have to try tomorrow night....

                          1 Reply Last reply
                          0
                          • scalzS scalz

                            @kenci which aa node? I don't think this is my design ;)

                            About your issue,I have not digged yet so I don't know. On my side, the stParentUpdate is working I guess as I have not this problem. I'm using RFM69 too with a serial GW. But I'm still on end june temp 2.0b rev so I have not completely migrated to the new lib as I had some sketch to finish. I will update and diffcheck tests device today. So I will see if I fall into this, and try to debug if I can replicate the problem ;)

                            Just in case, what is your GW? I have serial gw + esp mqtt on my side for testing.

                            ? Offline
                            ? Offline
                            A Former User
                            wrote on last edited by A Former User
                            #13

                            Sorry @scalz , it was another user who designed the board, user @m26872 was it. My gateway is an ESP8266 with MQTT. I will try to find out what the problem is. With the same sketch it's working on an Arduino Pro 328 3v3. But on @m26872's board with 1MHz it's not.

                            EDIT:
                            I found out that my Simple AA node is not receiving packets(ATMega328 1MHZ). So now i have to check why!

                            EDIT 2:
                            OK, i found out if i connect DI0 of RFM69 to D2 it's working. But if i want to use D3(because D2 is in use for a switch) it's not working, even if i set #define MY_RF69_IRQ_PIN 3 in my sketch!

                            1 Reply Last reply
                            0
                            • scalzS Offline
                              scalzS Offline
                              scalz
                              Hardware Contributor
                              wrote on last edited by scalz
                              #14

                              @kenci ok, I think I know where is your problem. Try to add this in your sketch (before mysensors include of course)
                              #define MY_RF69_IRQ_NUM 1

                              That should work. I will do the change.

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


                              7

                              Online

                              11.7k

                              Users

                              11.2k

                              Topics

                              113.0k

                              Posts


                              Copyright 2019 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