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 26.9k 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.
  • F Offline
    F Offline
    fakeJake
    wrote on last edited by
    #46

    Is there a way to receive only the last state of the sensors/actuators in the serial?

    instead of:

    0;0;3;0;9;read: 2-2-0 s=1,c=1,t=2,pt=2,l=2:1
    0;0;3;0;9;send: 0-0-2-2 s=1,c=1,t=2,pt=2,l=2,st=ok:1
    2;1;1;0;2;1
    

    it only print the "2;1;1;0;2;1" on the serial

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

      I placed if statement in serial function inside MyGateway.cpp
      where 0 is the gateway address

      void MyGateway::serial(MyMessage &msg) {
        if (msg.sender != 0); serial(PSTR("%d;%d;%d;%d;%d;%s\n"),msg.sender, msg.sensor, mGetCommand(msg), mGetAck(msg), msg.type, msg.getString(convBuf));
      }
      

      Still it doesnt work.

      Heres the format:

          msg.sender = GATEWAY_ADDRESS;
      	msg.destination = destination;
      	msg.sensor = sensor;
      	msg.type = type;
      	mSetCommand(msg,command);
      	mSetRequestAck(msg,ack?1:0);
      	mSetAck(msg,false);
      	if (command == C_STREAM)
      		msg.set(bvalue, blen);
      	else
      		msg.set(value);
      
      1 Reply Last reply
      0
      • S Offline
        S Offline
        Stric
        wrote on last edited by
        #48

        if (msg.sender != 0); serial(PSTR("%d;%d;%d;%d;%d;%s\n"),msg.sender, msg.sensor, mGetCommand(msg), mGetAck(msg), msg.type, msg.getString(convBuf));

        Note the ; after the 0) which should not belong there..

        F 1 Reply Last reply
        0
        • S Stric

          if (msg.sender != 0); serial(PSTR("%d;%d;%d;%d;%d;%s\n"),msg.sender, msg.sensor, mGetCommand(msg), mGetAck(msg), msg.type, msg.getString(convBuf));

          Note the ; after the 0) which should not belong there..

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

          @Stric Removed it but still the read and send appears

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

            Should I post my new question on another board?

            Re: s there a way to receive only the last state of the sensors/actuators in the serial?

            1 Reply Last reply
            0
            • H Offline
              H Offline
              hek
              Admin
              wrote on last edited by
              #51

              The gateway itself doesn't buffer anything. It just forwards the data from your sensors.

              F 1 Reply Last reply
              0
              • H hek

                The gateway itself doesn't buffer anything. It just forwards the data from your sensors.

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

                @hek can you please help me on what should I comment out?

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  hek
                  Admin
                  wrote on last edited by
                  #53

                  turn off DEBUG in MyConfig.h (by commenting it out) before comping you gateway sketch to get rid of debug messages.

                  F 1 Reply Last reply
                  0
                  • H hek

                    turn off DEBUG in MyConfig.h (by commenting it out) before comping you gateway sketch to get rid of debug messages.

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

                    @hek Thank you! I will try it as soon as I go home. Can you tell me what is the expected output from the gateway if I use static id 2 for a relayActuator that I turned on?

                    will it be just "2;1;1;0;2;1" or will "2;255;x;x;x;x" appear? only the read/send data is hidden

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

                      Is it ok to have two gateways?

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      18

                      Online

                      12.0k

                      Users

                      11.2k

                      Topics

                      113.4k

                      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