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. RaspBerry PI3 B + Dragino HAT ( RF95 / RFM95 ) = RF24_NOP error

RaspBerry PI3 B + Dragino HAT ( RF95 / RFM95 ) = RF24_NOP error

Scheduled Pinned Locked Moved Troubleshooting
5 Posts 3 Posters 2.0k 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.
  • exdj21E Offline
    exdj21E Offline
    exdj21
    wrote on last edited by
    #1

    I'm trying to use the mysensors library 2.1.1, but it is giving this error:

    In file included from ./MySensors.h:304:0,
                     from examples_linux/mysgw.cpp:74:
    ./drivers/RFM95/RFM95.cpp: In function ‘uint8_t RFM95_spiMultiByteTransfer(uint8_t, uint8_t*, uint8_t, bool)’:
    ./drivers/RFM95/RFM95.cpp:58:13: error: ‘RF24_NOP’ was not declared in this scope
        *ptx++ = RF24_NOP;
                 ^
    In file included from ./MySensors.h:304:0,
                     from examples_linux/mysgw.cpp:74:
    ./drivers/RFM95/RFM95.cpp: At global scope:
    ./drivers/RFM95/RFM95.cpp:494:12: warning: ‘void RFM95_ATCmode(bool, int16_t)’ defined but not used [-Wunused-function]
     LOCAL void RFM95_ATCmode(const bool OnOff, const int16_t targetRSSI)
                ^
    Makefile:114: recipe for target 'build/examples_linux/mysgw.o' failed
    make: *** [build/examples_linux/mysgw.o] Error 1
    

    What I am using:

    • Raspberry pi3 B
    • Linux Raspbian
    • Dragino HAT v1.3 ( RF98 - 433Mhz )
    • MySensors library 2.1.1

    What I have made so far:

    pi@pi:~ $ sudo git clone https://github.com/mysensors/MySensors.git --branch master
    Cloning into 'MySensors'...
    remote: Counting objects: 13994, done.
    remote: Compressing objects: 100% (54/54), done.
    remote: Total 13994 (delta 13), reused 0 (delta 0), pack-reused 13940
    Receiving objects: 100% (13994/13994), 9.71 MiB | 141.00 KiB/s, done.
    Resolving deltas: 100% (8441/8441), done.
    Checking connectivity... done.
    pi@pi:~ $ cd MySensors
    pi@pi:~/MySensors $ sudo ./configure --my-gateway=ethernet --my-port=5003 --my-transport=rfm95
    [SECTION] Detecting target machine.
      [OK] machine detected: SoC=BCM2836, Type=RPi3, CPU=armv7l.
    [SECTION] Detecting SPI driver.
      [OK] SPI driver detected:BCM.
    [SECTION] Detecting init system.
      [OK] init system detected: systemd.
    [SECTION] Saving configuration.
    [SECTION] Cleaning previous builds.
    [OK] Finished.
    pi@pi:~/MySensors $ sudo make
    .
    .
    .
    .
     examples_linux/mysgw.cpp -o build/examples_linux/mysgw.o
    In file included from ./MySensors.h:304:0,
                     from examples_linux/mysgw.cpp:74:
    ./drivers/RFM95/RFM95.cpp: In function ‘uint8_t RFM95_spiMultiByteTransfer(uint8_t, uint8_t*, uint8_t, bool)’:
    ./drivers/RFM95/RFM95.cpp:58:13: error: ‘RF24_NOP’ was not declared in this scope
        *ptx++ = RF24_NOP;
                 ^
    In file included from ./MySensors.h:304:0,
                     from examples_linux/mysgw.cpp:74:
    ./drivers/RFM95/RFM95.cpp: At global scope:
    ./drivers/RFM95/RFM95.cpp:494:12: warning: ‘void RFM95_ATCmode(bool, int16_t)’ defined but not used [-Wunused-function]
     LOCAL void RFM95_ATCmode(const bool OnOff, const int16_t targetRSSI)
                ^
    Makefile:114: recipe for target 'build/examples_linux/mysgw.o' failed
    make: *** [build/examples_linux/mysgw.o] Error 1
    
    

    The RFM95.cpp code part:

    #if defined(LINUX_SPI_BCM)
    	uint8_t * prx = spi_rxbuff;
    	uint8_t * ptx = spi_txbuff;
    	uint8_t size = len + 1; // Add register value to transmit buffer
    
    	*ptx++ = cmd;
    	while (len--) {
    		if (aReadMode) {
    			*ptx++ = RF24_NOP;
    		} else {
    			*ptx++ = *current++;
    		}
    	}
    	_SPI.transfernb((char *)spi_txbuff, (char *)spi_rxbuff, size);
    	if (aReadMode) {
    		if (size == 2) {
    			status = *++prx;   // result is 2nd byte of receive buffer
    		} else {
    			status = *prx++; // status is 1st byte of receive buffer
    			// decrement before to skip status byte
    			while (--size) {
    				*buf++ = *prx++;
    			}
    		}
    	} else {
    		status = *prx; // status is 1st byte of receive buffer
    	}
    #else
    	status = _SPI.transfer(cmd);
    	while (len--) {
    		if (aReadMode) {
    			status = _SPI.transfer((uint8_t)0x00);
    			if (buf != NULL) {
    				*current++ = status;
    			}
    		} else {
    			status = _SPI.transfer(*current++);
    		}
    	}
    #endif
    
    

    any idea?

    mfalkviddM 1 Reply Last reply
    0
    • exdj21E exdj21

      I'm trying to use the mysensors library 2.1.1, but it is giving this error:

      In file included from ./MySensors.h:304:0,
                       from examples_linux/mysgw.cpp:74:
      ./drivers/RFM95/RFM95.cpp: In function ‘uint8_t RFM95_spiMultiByteTransfer(uint8_t, uint8_t*, uint8_t, bool)’:
      ./drivers/RFM95/RFM95.cpp:58:13: error: ‘RF24_NOP’ was not declared in this scope
          *ptx++ = RF24_NOP;
                   ^
      In file included from ./MySensors.h:304:0,
                       from examples_linux/mysgw.cpp:74:
      ./drivers/RFM95/RFM95.cpp: At global scope:
      ./drivers/RFM95/RFM95.cpp:494:12: warning: ‘void RFM95_ATCmode(bool, int16_t)’ defined but not used [-Wunused-function]
       LOCAL void RFM95_ATCmode(const bool OnOff, const int16_t targetRSSI)
                  ^
      Makefile:114: recipe for target 'build/examples_linux/mysgw.o' failed
      make: *** [build/examples_linux/mysgw.o] Error 1
      

      What I am using:

      • Raspberry pi3 B
      • Linux Raspbian
      • Dragino HAT v1.3 ( RF98 - 433Mhz )
      • MySensors library 2.1.1

      What I have made so far:

      pi@pi:~ $ sudo git clone https://github.com/mysensors/MySensors.git --branch master
      Cloning into 'MySensors'...
      remote: Counting objects: 13994, done.
      remote: Compressing objects: 100% (54/54), done.
      remote: Total 13994 (delta 13), reused 0 (delta 0), pack-reused 13940
      Receiving objects: 100% (13994/13994), 9.71 MiB | 141.00 KiB/s, done.
      Resolving deltas: 100% (8441/8441), done.
      Checking connectivity... done.
      pi@pi:~ $ cd MySensors
      pi@pi:~/MySensors $ sudo ./configure --my-gateway=ethernet --my-port=5003 --my-transport=rfm95
      [SECTION] Detecting target machine.
        [OK] machine detected: SoC=BCM2836, Type=RPi3, CPU=armv7l.
      [SECTION] Detecting SPI driver.
        [OK] SPI driver detected:BCM.
      [SECTION] Detecting init system.
        [OK] init system detected: systemd.
      [SECTION] Saving configuration.
      [SECTION] Cleaning previous builds.
      [OK] Finished.
      pi@pi:~/MySensors $ sudo make
      .
      .
      .
      .
       examples_linux/mysgw.cpp -o build/examples_linux/mysgw.o
      In file included from ./MySensors.h:304:0,
                       from examples_linux/mysgw.cpp:74:
      ./drivers/RFM95/RFM95.cpp: In function ‘uint8_t RFM95_spiMultiByteTransfer(uint8_t, uint8_t*, uint8_t, bool)’:
      ./drivers/RFM95/RFM95.cpp:58:13: error: ‘RF24_NOP’ was not declared in this scope
          *ptx++ = RF24_NOP;
                   ^
      In file included from ./MySensors.h:304:0,
                       from examples_linux/mysgw.cpp:74:
      ./drivers/RFM95/RFM95.cpp: At global scope:
      ./drivers/RFM95/RFM95.cpp:494:12: warning: ‘void RFM95_ATCmode(bool, int16_t)’ defined but not used [-Wunused-function]
       LOCAL void RFM95_ATCmode(const bool OnOff, const int16_t targetRSSI)
                  ^
      Makefile:114: recipe for target 'build/examples_linux/mysgw.o' failed
      make: *** [build/examples_linux/mysgw.o] Error 1
      
      

      The RFM95.cpp code part:

      #if defined(LINUX_SPI_BCM)
      	uint8_t * prx = spi_rxbuff;
      	uint8_t * ptx = spi_txbuff;
      	uint8_t size = len + 1; // Add register value to transmit buffer
      
      	*ptx++ = cmd;
      	while (len--) {
      		if (aReadMode) {
      			*ptx++ = RF24_NOP;
      		} else {
      			*ptx++ = *current++;
      		}
      	}
      	_SPI.transfernb((char *)spi_txbuff, (char *)spi_rxbuff, size);
      	if (aReadMode) {
      		if (size == 2) {
      			status = *++prx;   // result is 2nd byte of receive buffer
      		} else {
      			status = *prx++; // status is 1st byte of receive buffer
      			// decrement before to skip status byte
      			while (--size) {
      				*buf++ = *prx++;
      			}
      		}
      	} else {
      		status = *prx; // status is 1st byte of receive buffer
      	}
      #else
      	status = _SPI.transfer(cmd);
      	while (len--) {
      		if (aReadMode) {
      			status = _SPI.transfer((uint8_t)0x00);
      			if (buf != NULL) {
      				*current++ = status;
      			}
      		} else {
      			status = _SPI.transfer(*current++);
      		}
      	}
      #endif
      
      

      any idea?

      mfalkviddM Online
      mfalkviddM Online
      mfalkvidd
      Mod
      wrote on last edited by mfalkvidd
      #2

      @exdj21 welcome to the MySensors community! Seems like you missed running ./configure before make?
      If you haven't already, take a look at the documenation for the MySensors raspberry pi gateway at https://www.mysensors.org/build/raspberry

      EDIT: sorry, I see now that you ran configure.

      1 Reply Last reply
      0
      • exdj21E Offline
        exdj21E Offline
        exdj21
        wrote on last edited by
        #3

        @exdj21 said in RaspBerry PI3 B + Dragino HAT ( RF95 / RFM95 ) = RF24_NOP error:

        RF24_NOP

        What is "RF24_NOP" and what is it used for?

        mfalkviddM 1 Reply Last reply
        0
        • exdj21E exdj21

          @exdj21 said in RaspBerry PI3 B + Dragino HAT ( RF95 / RFM95 ) = RF24_NOP error:

          RF24_NOP

          What is "RF24_NOP" and what is it used for?

          mfalkviddM Online
          mfalkviddM Online
          mfalkvidd
          Mod
          wrote on last edited by
          #4

          @exdj21 it seems to be something used by the nrf24 radio. https://github.com/mysensors/MySensors/blob/2e0f6b62295dbe884386ee23ae312a2c02bdea20/drivers/RF24/RF24.h#L169

          See if adding that define to your code (before including mysensors) helps.

          @tekka might be able to shed a light.

          T 1 Reply Last reply
          0
          • mfalkviddM mfalkvidd

            @exdj21 it seems to be something used by the nrf24 radio. https://github.com/mysensors/MySensors/blob/2e0f6b62295dbe884386ee23ae312a2c02bdea20/drivers/RF24/RF24.h#L169

            See if adding that define to your code (before including mysensors) helps.

            @tekka might be able to shed a light.

            T Offline
            T Offline
            tekka
            Admin
            wrote on last edited by tekka
            #5

            @mfalkvidd @exdj21 Thanks for reporting, bugfix submitted: https://github.com/mysensors/MySensors/pull/800

            For an immediate fix in 2.1.1/RFM95.cpp line 58, change to:

            *ptx++ = (uint8_t)0x00;
            
            1 Reply Last reply
            1

            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


            19

            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