[solved] TX not received 255? (NRF24L01+)

Posted on
  • Hello everybody,

    the tutorial on "NRF24L01+" is not working for me:
    http://www.espruino.com/NRF24L01P

    It's driving me crazy, because I always get the following message on the master:

    >nrf.sendCommand("1+2", function(r) { print("=="+r); });
    TX not received 255
    TX not received 255
    TX not received 255
    =undefined
    

    Any suggestion are welcomed very much, as I need an working NRF24L01+ for a futur project!

    Thank you very much,

    Stefan

    My connections:

    NRF24L01+	Name	Espruino	Type
    1		GND	GND		GND
    2		3.3V	3.3		3.3v
    3		CE	A0		GPIO Out
    4		CSN	A1		GPIO Out
    5		SCK	B3		SPI SCK
    6		MOSI	B4		SPI MOSI
    7		MISO	B5		SPI MISO
    8		IRQ	unused		GPIO In
    

    My testcode:

    Slave:

    SPI1.setup({sck:B3, miso:B4, mosi:B5});
    var nrf = require("NRF24L01P").connect( SPI1, A1, A0 );
    function onInit() {
      nrf.init([0,0,0,0,1], [0,0,0,0,2]);
    }
    function toggle1(){
      on1=!on1;
      digitalWrite(LED1,on1);
    }
    onInit();
    setInterval(function() {
      toggle1();
      nrf.slaveHandler();
    }, 50);
    

    Master:

    SPI1.setup({sck:B3, miso:B4, mosi:B5});
    var nrf = require("NRF24L01P").connect( SPI1, A1, A0 );
    function onInit() {
      nrf.init([0,0,0,0,2], [0,0,0,0,1]);
    }
    onInit();
    setInterval(function() {
      nrf.masterHandler();
    }, 50);
    
  • Looks to me like you've wired up SPI MOSI and MISO around the wrong way - see http://www.espruino.com/ReferenceESPRUINOBOARD.

    Just swap B4 and B5 and you should be sorted...

  • Hello Gordon,

    you rock!! I've review the wiring in this particular part and now it works great for me! I'm now able to plug the NRF24L01+ in on my Espruino with a bunch of female-to-female-wires.

    One additional question: What are your experiences with range of NRF24L01+? How can you increase it?

    Thank you very much,

    Stefan

    The correct wiring:

    NRF24L01+   Name    Espruino    Type
    1       GND GND     GND
    2       3.3V    3.3     3.3v
    3       CE  A0      GPIO Out
    4       CSN A1      GPIO Out
    5       SCK B3      SPI SCK
    6       MOSI    B5      SPI MOSI
    7       MISO    B4      SPI MISO
    8       IRQ unused      GPIO In
    
  • Great!

    If I'm honest range is not fantastic (with the simple on-board aerial modules). If I put one in the middle my my house I can pretty much do every room, but it won't really go outside.

    By default, the boards run at full power transmit already, but you can increase the timeout and also the number of retries, and you can also decrease the transmit speed - all of which will help. I've actually just updated the driver to increase timeout and retry (I'd done it here for some tests), and I also added a setDataRate function so you can do:

    nrf.setDataRate(250000);
    
  • Thank you Gordon! I'll try it out!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

[solved] TX not received 255? (NRF24L01+)

Posted by Avatar for Stefan @Stefan

Actions