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. Development
  3. Newbie Problem! Get Started with NRF24L01+

Newbie Problem! Get Started with NRF24L01+

Scheduled Pinned Locked Moved Development
55 Posts 9 Posters 24.2k Views 2 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.
  • hekH Offline
    hekH Offline
    hek
    Admin
    wrote on last edited by
    #10

    http://www.mysensors.org/download/sensor_api_14#the-full-api

    Second argument to gw.begin(NULL, xxx);

    1 Reply Last reply
    2
    • C Chester

      Just to check, did you upload the DallasTemperatureSensor.ino, or did you upload the Temperature sketch inside the MySensors subfolder?

      I'm at work currently so I can't give exact details, but I noticed that if you unpack the MySensors package into the Arduino libraries, you get a heap of example sketches for various items, but then inside the MySensors subfolder are the sketches set up for the MySensors stuff.

      So check which one you have used for the remote module with the dallas sensor.

      Also on the serial gateway, check the serial output on that (at 115,200 board speed), and check, it should say "Gateway setup complete" or something close to that.

      F Offline
      F Offline
      fakeJake
      wrote on last edited by fakeJake
      #11

      @Chester : After checking the wire and the supply I know my connection isn't the problem so I replaced my Arduino.

      This is the output:

      send: 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
      req node id
      send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
      sensor started, id 255
      req node id
      send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
      req node id
      send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
      req node id
      send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
      req node id
      send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
      

      @hek : After using gw.begin(NULL, 0);

      Thi is the output:

      send: 0-0-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
      sensor started, id 0
      send: 0-0-255-0 s=255,c=0,t=17,pt=0,l=5,st=fail:1.4.1
      send: 0-0-255-0 s=255,c=3,t=6,pt=1,l=1,st=fail:255
      send: 0-0-255-0 s=255,c=3,t=11,pt=0,l=18,st=fail:Temperature Sensor
      send: 0-0-255-0 s=255,c=3,t=12,pt=0,l=3,st=fail:1.0
      send: 0-0-255-0 s=0,c=0,t=6,pt=0,l=5,st=fail:1.4.1
      send: 0-0-255-0 s=0,c=1,t=0,pt=7,l=5,st=fail:29.9
      

      What are the s,c,t,pt

      1 Reply Last reply
      0
      • korttomaK Offline
        korttomaK Offline
        korttoma
        Hero Member
        wrote on last edited by korttoma
        #12

        Don't use 0 for your node ID! (gw.begin(NULL, 0);) Choose a value beween 1 and 254.

        nodeId - The unique id (1-254) for this sensor.
        

        Do not confuse this with child sensor ID

        childSensorId - The unique child id you want to choose for the sensor connected to this Arduino. Range 0-254.
        
        • Tomas
        F 1 Reply Last reply
        2
        • korttomaK korttoma

          Don't use 0 for your node ID! (gw.begin(NULL, 0);) Choose a value beween 1 and 254.

          nodeId - The unique id (1-254) for this sensor.
          

          Do not confuse this with child sensor ID

          childSensorId - The unique child id you want to choose for the sensor connected to this Arduino. Range 0-254.
          
          F Offline
          F Offline
          fakeJake
          wrote on last edited by
          #13

          @korttoma : Ok. Thank you! Could you kindly explain what are the send, s, c, t, pt, l and st?

          tekkaT 1 Reply Last reply
          0
          • rvendrameR Offline
            rvendrameR Offline
            rvendrame
            Hero Member
            wrote on last edited by
            #14

            Maybe this may cover it http://www.mysensors.org/download/serial_api_14

            Home Assistant / Vera Plus UI7
            ESP8266 GW + mySensors 2.3.2
            Alexa / Google Home

            F 1 Reply Last reply
            0
            • F fakeJake

              @korttoma : Ok. Thank you! Could you kindly explain what are the send, s, c, t, pt, l and st?

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

              @fakeJake you could also use the latest release of MYSController (0.1.2.278) to have the debug messages parsed.

              1 Reply Last reply
              0
              • F Offline
                F Offline
                fakeJake
                wrote on last edited by
                #16

                Can I use the inclusion button on the serialGateway?

                korttomaK 1 Reply Last reply
                0
                • F fakeJake

                  Can I use the inclusion button on the serialGateway?

                  korttomaK Offline
                  korttomaK Offline
                  korttoma
                  Hero Member
                  wrote on last edited by
                  #17

                  @fakeJake said:

                  Can I use the inclusion button on the serialGateway?

                  yes

                  • Tomas
                  1 Reply Last reply
                  0
                  • F Offline
                    F Offline
                    fakeJake
                    wrote on last edited by fakeJake
                    #18

                    The inclusion button is used to detect the connecting modules, yes?

                    This is the output I get when I press the inclusion button on the serial gateway

                    0;0;3;0;14;Gateway startup complete.
                    0;0;3;0;9;Inclusion started by button.
                    0;0;3;0;5;1
                    0;0;3;0;5;0
                    

                    I have another NRF module with ds18b20 connected. Can you help me on how I can get the temp sensor to connect to the serial gateway? I c

                    I used the code here and changed the gw.begin() to gw.begin(NULL, 1)

                    sensor started, id 1
                    send: 1-1-0-0 s=255,c=0,t=17,pt=0,l=5,st=fail:1.4.1
                    send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
                    send: 1-1-0-0 s=255,c=3,t=11,pt=0,l=18,st=fail:Temperature Sensor
                    send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,st=fail:1.0
                    send: 1-1-0-0 s=0,c=0,t=6,pt=0,l=5,st=fail:1.4.1
                    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=fail:29.6
                    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=fail:29.7
                    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=fail:29.6
                    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=fail:29.7
                    send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
                    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=fail:29.6
                    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=fail:29.8
                    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=fail:29.7
                    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=fail:29.6
                    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=fail:29.7
                    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=fail:29.6
                    send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=fail:29.7
                    send: 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
                    
                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      andriej
                      wrote on last edited by
                      #19
                      This post is deleted!
                      1 Reply Last reply
                      0
                      • rvendrameR Offline
                        rvendrameR Offline
                        rvendrame
                        Hero Member
                        wrote on last edited by
                        #20

                        How are you powering your node? Your node's radio is constantly fail to transmit (st=fail).

                        Home Assistant / Vera Plus UI7
                        ESP8266 GW + mySensors 2.3.2
                        Alexa / Google Home

                        hekH 1 Reply Last reply
                        0
                        • rvendrameR rvendrame

                          How are you powering your node? Your node's radio is constantly fail to transmit (st=fail).

                          hekH Offline
                          hekH Offline
                          hek
                          Admin
                          wrote on last edited by
                          #21

                          How are you powering your node? Your node's radio is constantly fail to transmit (st=fail).

                          It's actually the gateway having problems transmitting acks back to node.

                          F 1 Reply Last reply
                          0
                          • hekH hek

                            How are you powering your node? Your node's radio is constantly fail to transmit (st=fail).

                            It's actually the gateway having problems transmitting acks back to node.

                            F Offline
                            F Offline
                            fakeJake
                            wrote on last edited by
                            #22

                            @hek said:

                            How are you powering your node? Your node's radio is constantly fail to transmit (st=fail).

                            It's actually the gateway having problems transmitting acks back to node.

                            I'm powering the nrf modules from same 3.3V supply since I haven't bought a regulator yet. I'll test it again later. I'll be going out to buy them now.

                            Just to give me a heads up. What should the serial gateway get after i press the inclusion button?

                            1 Reply Last reply
                            0
                            • F Offline
                              F Offline
                              fakeJake
                              wrote on last edited by fakeJake
                              #23

                              Sorry for the late reply

                              Each modules are now supplied with 5V and 3.3V.

                              This is the serial gateway output:

                              0;0;3;0;14;Gateway startup complete.
                              0;0;3;0;9;read: 1-1-0 s=0,c=1,t=0,pt=7,l=5:30.2
                              1;0;1;0;0;30.2
                              0;0;3;0;9;Inclusion started by button.
                              0;0;3;0;5;1
                              0;0;3;0;5;0
                              

                              This is the temp output:

                              sensor started, id 1
                              send: 1-1-0-0 s=255,c=0,t=17,pt=0,l=5,st=fail:1.4.1
                              send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
                              send: 1-1-0-0 s=255,c=3,t=11,pt=0,l=18,st=fail:Temperature Sensor
                              send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,st=fail:1.0
                              send: 1-1-0-0 s=0,c=0,t=6,pt=0,l=5,st=fail:1.4.1
                              send: 1-1-0-0 s=0,c=1,t=0,pt=7,l=5,st=fail:30.2
                              

                              st keeps on failing. I checked the nrf supply and it ranges from 3.1v to 3.3 v. Is this bad? I'm using spx2815 since it's the only thing available to me. I placed 10uF capacitor in the 5v input and 3.3v output to ground

                              1 Reply Last reply
                              0
                              • rvendrameR rvendrame

                                Maybe this may cover it http://www.mysensors.org/download/serial_api_14

                                F Offline
                                F Offline
                                fakeJake
                                wrote on last edited by
                                #24

                                @rvendrame said:

                                Maybe this may cover it http://www.mysensors.org/download/serial_api_14

                                It only explains the "0;0;3;0;14;" but not the "s=255,c=3,t=11,pt=0,l=18,st=fail:Temperature Sensor" that it sends or reads

                                1 Reply Last reply
                                0
                                • rvendrameR Offline
                                  rvendrameR Offline
                                  rvendrame
                                  Hero Member
                                  wrote on last edited by
                                  #25

                                  @fakeJake , are the node far from gateway, or any obstacle (such as a wall) in between? Another source of interference is for example a microwave.

                                  Home Assistant / Vera Plus UI7
                                  ESP8266 GW + mySensors 2.3.2
                                  Alexa / Google Home

                                  F 1 Reply Last reply
                                  0
                                  • rvendrameR rvendrame

                                    @fakeJake , are the node far from gateway, or any obstacle (such as a wall) in between? Another source of interference is for example a microwave.

                                    F Offline
                                    F Offline
                                    fakeJake
                                    wrote on last edited by
                                    #26

                                    @rvendrame said:

                                    @fakeJake , are the node far from gateway, or any obstacle (such as a wall) in between? Another source of interference is for example a microwave.

                                    They are just 6 inches apart :worried:

                                    1 Reply Last reply
                                    0
                                    • rvendrameR Offline
                                      rvendrameR Offline
                                      rvendrame
                                      Hero Member
                                      wrote on last edited by
                                      #27

                                      Some people reported trouble with cheap fake radios. If you have spares nRF try replacing one of them or both.

                                      You mentioned a flotation (3.1 to 3.3) in radio VCC, this can also be a reason, as these nRF are very sensible to power variations.

                                      Post your sketches too, just incase...

                                      Home Assistant / Vera Plus UI7
                                      ESP8266 GW + mySensors 2.3.2
                                      Alexa / Google Home

                                      1 Reply Last reply
                                      0
                                      • F Offline
                                        F Offline
                                        fakeJake
                                        wrote on last edited by
                                        #28

                                        I'm using the DallasTemperatureSensor.ino on MySensors library. I just change the gw.begin(); to gw.begin(NULL, 1);

                                        // Example sketch showing how to send in OneWire temperature readings
                                        #include <MySensor.h>  
                                        #include <SPI.h>
                                        #include <DallasTemperature.h>
                                        #include <OneWire.h>
                                        
                                        #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected 
                                        #define MAX_ATTACHED_DS18B20 16
                                        unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)
                                        OneWire oneWire(ONE_WIRE_BUS);
                                        DallasTemperature sensors(&oneWire);
                                        MySensor gw;
                                        float lastTemperature[MAX_ATTACHED_DS18B20];
                                        int numSensors=0;
                                        boolean receivedConfig = false;
                                        boolean metric = true; 
                                        // Initialize temperature message
                                        MyMessage msg(0,V_TEMP);
                                        
                                        void setup()  
                                        { 
                                          // Startup OneWire 
                                          sensors.begin();
                                        
                                          // Startup and initialize MySensors library. Set callback for incoming messages. 
                                          gw.begin(NULL,1); 
                                        
                                          // Send the sketch version information to the gateway and Controller
                                          gw.sendSketchInfo("Temperature Sensor", "1.0");
                                        
                                          // Fetch the number of attached temperature sensors  
                                          numSensors = sensors.getDeviceCount();
                                        
                                          // Present all sensors to controller
                                          for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {   
                                             gw.present(i, S_TEMP);
                                          }
                                        }
                                        
                                        
                                        void loop()     
                                        {     
                                          // Process incoming messages (like config from server)
                                          gw.process(); 
                                        
                                          // Fetch temperatures from Dallas sensors
                                          sensors.requestTemperatures(); 
                                        
                                          // Read temperatures and send them to controller 
                                          for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) {
                                         
                                            // Fetch and round temperature to one decimal
                                            float temperature = static_cast<float>(static_cast<int>((gw.getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.;
                                         
                                            // Only send data if temperature has changed and no error
                                            if (lastTemperature[i] != temperature && temperature != -127.00) {
                                         
                                              // Send in the new temperature
                                              gw.send(msg.setSensor(i).set(temperature,1));
                                              lastTemperature[i]=temperature;
                                            }
                                          }
                                          gw.sleep(SLEEP_TIME);
                                        }
                                        
                                        1 Reply Last reply
                                        0
                                        • F Offline
                                          F Offline
                                          fakeJake
                                          wrote on last edited by
                                          #29

                                          Good news! The gateway is now working :)
                                          I changed the dallas temperature to relay actuator and, yes, it's now working!
                                          Bad news is I still don't know what went wrong with my temperature sensor.
                                          I'll investigate on it soon.

                                          This is the gateway output:

                                          0;0;3;0;14;Gateway startup complete.
                                          0;0;3;0;9;read: 2-2-0 s=255,c=0,t=18,pt=0,l=5:1.4.1
                                          2;255;0;0;18;1.4.1
                                          0;0;3;0;9;read: 2-2-0 s=255,c=3,t=6,pt=1,l=1:0
                                          2;255;3;0;6;0
                                          0;0;3;0;9;read: 2-2-0 s=255,c=3,t=11,pt=0,l=5:Relay
                                          2;255;3;0;11;Relay
                                          0;0;3;0;9;read: 2-2-0 s=255,c=3,t=12,pt=0,l=3:1.0
                                          2;255;3;0;12;1.0
                                          0;0;3;0;9;read: 2-2-0 s=1,c=0,t=3,pt=0,l=5:1.4.1
                                          2;1;0;0;3;1.4.1
                                          

                                          This is the relay output:

                                          repeater started, id 2
                                          send: 2-2-0-0 s=255,c=0,t=18,pt=0,l=5,st=ok:1.4.1
                                          send: 2-2-0-0 s=255,c=3,t=6,pt=1,l=1,st=ok:0
                                          send: 2-2-0-0 s=255,c=3,t=11,pt=0,l=5,st=ok:Relay
                                          send: 2-2-0-0 s=255,c=3,t=12,pt=0,l=3,st=ok:1.0
                                          send: 2-2-0-0 s=1,c=0,t=3,pt=0,l=5,st=ok:1.4.1
                                          

                                          I just need to test it.
                                          Since I'll be using a gsm to control the relay. Can you help me on what to send to the relay to turn it on/off?

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


                                          14

                                          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