• I built a project a couple of years ago with Pico transmitter and Original board receiver using NRF24L01 radios. I upgraded firmware on both to 2v03 a few days ago and the radio link no longer works (I get TX not received XX errors). I have 10uf caps on both NRF modules. I can get the link to work by programming the Original as the transmitter and Pico as the receiver. I've tried swapping the radio modules + replacing them with some extras I have.

    I also tried using different output pins on the Pico to drive the CE and CSN signals, but still get the same results. I'm reasonably confident the SPI interface is working fine on both boards since I can read various registers on the NRF modules including the RX/TX addresses. I've tried different data rates and power levels. I'm running both boards connected to USB and the IDE. So far nothing has worked - I cannot get it to work with Pico as transmitter and Original as receiver. It always works the other way around.

    I've posted some test code below. I would really appreciate any suggestions!

    Pico Transmitter:

    SPI1.setup({sck:B3, miso:B4, mosi:B5});
    var nrf = require("NRF24L01P").connect( SPI1, B14, B13 );
    function onInit() {
      nrf.init([0,0,0,0,1], [0,0,0,0,2]);
      nrf.setDataRate(250000);
      nrf.setTXPower(1);
    }
    onInit();
    var on = false;
    var i = 0;
    setInterval(function() {
      nrf.sendString("Allen"+i);
      var s = nrf.getStatus();
      print(s.toString(16));
      digitalWrite(LED1, on);
      on = !on;
      if (i++ > 8) i = 0;
    }, 2000);
    

    Original Receiver:

    SPI1.setup({sck:A5, miso:A6, mosi:A7});
    var nrf = require("NRF24L01P").connect( SPI1, B0, B1 );
    function onInit() {
      nrf.init([0,0,0,0,2], [0,0,0,0,1]);
      nrf.setDataRate(250000);
      nrf.setTXPower(1);
    }
    onInit();
    
    dataLine = "";
    setInterval(function() {
      while (nrf.getDataPipe() !== undefined) {
        var data = nrf.getData();
        for (var i in data) {
          var ch = data[i];
          if (ch===0 && dataLine!=="") {
            print(dataLine);
            dataLine = "";
          } else if (ch!==0) {
            dataLine += String.fromCharCode(ch);
          }
        }
      }
    }, 50);
    
  • Tue 2019.06.11

    Hello @Allen, while I have no experience with this NRF24L01 packet radio, I do notice a possible area of contention. While your description is detailed and easily understood, to save the reader valuable time in assisting you, it would have been nice had the links to the documentation been included in your post.

    http://www.espruino.com/NRF24L01P
    https://www.espruino.com/Original
    http://www.espruino.com/Pico

    Looking at the commented sections in the source:

    http://www.espruino.com/modules/NRF24L01­P.js

    reveals that C4 and C5 are assigned to _csn and _ce respectively.
    exports.connect = function(_spi, _csn, _ce, _payload)

    As I look over the Espruino Original image, C4 and C5 are ADC only.

    B0 and B1 share ADC with PWM.

    From Line #2 of the Pico code above, B14 and B13 share SPI2 with PWM only. Could it be that A0 and A1, or A5 and A6 should be used on the Pico instead?

    Perusing the source didn't reveal to me the pin type requirement for _csn and _ce, however.

  • Hi @Robin, whether the pins have ADC or PWM shouldn't affect their functionality as GPIO/SPI.

    Do you remember which firmware version you had that actually worked? It's possible that the Pico's JS interpreter has got faster, and that has broken something in the NRF24L01P transmit code that worked previously?

  • @Gordon, I wondered the same thing. I don't remember the previous version - I got the Pico over 2 years ago and never updated it, but it seems like it was 1v7x.
    I will experiment with the send method timing in the NRF module.

  • I just tried here with some I had kicking around on older firmwares (1.69/71/78) and upgraded them - and it does still seem to work for me when sending from the Pico using your code (albeit with the CSN/SE pins changed to how I had things wired).

    Does it work at all for you?

    I did manage to get a TX not received to start happening after a while, but unplugging/replugging fixed that for me (and I think that's the classic capacitor issue because I haven't installed any on mine).

    I was getting TX not received all the time and I thought I'd reproduced it, but it turned out I had the wrong IO pins set up :)

  • I hooked up a storage scope: the timing of CE and CSN signals and even the antenna output of the NRF chip look the same when comparing the Pico and Original boards as transmitters. The radio is definitely transmitting something from the Pico board.

    I'm starting to suspect the Original board as a receiver.

  • I bought a new Pico and everything works. I haven't figured out what's wrong with my old Pico yet, but 2v03 and the NRF24L01 driver are both fine.

  • Wow, that's really strange. Thanks for letting me know though!

    Is it possible that you have some saved code that's interfering with the new code you're putting in? What happens if you type dump() when uploading an empty file?

  • It's empty. I'm going to put my scope back on it and see if 3.3v holds steady throughout the transmission. Wondering if I damaged the regulator.

  • Ahh - is it one of the rev 1.3 Picos?

    It could be the diode on it is frazzled - the early ones used a diode that wasn't that good at high current - if the power lines ever got shorted then it'd (mostly) die and might power the chip but not much else. rev 1.4 added a self-resetting fuse to protect it.

    If you're not planning in using the VBAT pin then you can actually just short it out - or info on replacing it is on http://forum.espruino.com/conversations/­281099/

  • It is 1.3. I'll try shorting the diode - I can add a diode to the battery.


    1 Attachment

    • 20190618_090420.jpg
  • That one is an Espruino Pico 1v4, so you wouldn't have the diode problem on that - you can short it out and the fuse will go first.

    That looks like a really neat little board!

  • Oh, it has the new Pico plugged in right now.

  • Glad you liked my transmitter. Here's the 'receiver'. I originally built them with Arduino, but I am so much happier with Espruino!


    1 Attachment

    • 20190618_100301.jpg
  • Oh wow, that's awesome! I love the way the servos for the hands are also counterweights.

    Have you come across http://forum.espruino.com/conversations/­332911 ? I'm giving a free Espruino to anyone who writes up their Espruino project, and this looks like it'd be perfect!

  • Hello, I have two IskraJS boards(http://wiki.amperka.ru/js:iskra_js – ISKRAJS on the Amperka website) and IskraJSmini(http://wiki.amperka.ru/продукты:iskra-js­-mini – ISKGAJSMIN on the amperka website) and two NRF24l01+ wireless communication modules. I connected the modules to the boards directly using an auxiliary pinout scheme from the sites above and to the module itself to the available SPI interfaces (without IRQ contact):
    MISO – MISO;

    MOSI – MOSI;

    SCK – SCK;

    CSN – CSN;

    CE- CE;

    Vcc – 3.3V;

    GND – GND.

    I used the instructions from the website(http://www.espruino.com/NRF24L01P - description of the connection NRF24l01+ to work via EspruinoIDE), as I understood there was no IRQ connection required, well, I did not connect it…

    In the code for the Iskra JS board, which became the emitter (Master), I prescribed again as from the example (only for the necessary contacts):
    SPI2.setup({sck:B13, miso:B14, mosi:B15});

    var nrf = require("NRF24L01P").connect( SPI2, B0, B1 ); //B0(P6),B1(P5) на схеме

    function onInit() {

    nrf.init([0,0,0,0,2], [0,0,0,0,1]);

    }

    onInit();

    setInterval(function() {

    nrf.masterHandler();

    }, 50);
    And I didn't do anything else – but it is filled into memory every other time (the console falls out when filling the firmware).

    In the code for the Iskra JS mini board, which I have become a receiver (Slave), I prescribed and filled in (the console worked fine in the Espruino ide):
    SPI1.setup({sck:A5, miso:A6, mosi:A7});

    var nrf = require("NRF24L01P").connect( SPI1, B0, B1 );

    function onInit() {

    nrf.init([0,0,0,0,1], [0,0,0,0,2]);

    }

    onInit();

    setInterval(function() {

    nrf.slaveHandler();

    }, 50);
    Here I subtracted everything to SPI1 and, as an example, the names of the pins coincided. But then I don't understand what to do, I tried to output the command to the console from the spark of the LC mini, and on the spark of the LC connected to the power supply from the outlet, I planned to send a message from the example through the button:
    nrf.sendCommand("1+2", function(r) { print("=="+r); });
    the result should be =3
    But this did not happen ... I tried the options from the example and also in the empty.
    The code on Master was like this:
    var knopa = require('@amperka/button').connect(P3);

    SPI2.setup({sck:B13, miso:B14, mosi:B15});

    var nrf = require("NRF24L01P").connect( SPI2, B0, B1 ); //B0(P6),B1(P5) насхемеискры

    function onInit() {

    nrf.init([0,0,0,0,2], [0,0,0,0,1]);}

    onInit();

    setInterval(function() {

    nrf.masterHandler();

    }, 50);

    knopa.on('press', function() {

    nrf.sendCommand("1+2", function(r) { print("=="+r);

    });

    });
    Please tell me what and where I did wrong? And then I got confused and I can't figure out where the error is myself. If it is possible with a detailed description, I am not strong in JS yet, while I am mastering.
    Thank you in advance and apologize for the bedsheet.


    3 Attachments

    • iskrajsminipinout11.JPG
    • iskrajspinout11.JPG
    • nrf24l01pinout11.JPG
  • Hi - thanks for the clear post - however you really need to ask Amperka for help with their boards.

    They're profiting off the Espruino ecosystem and not contributing anything back - I give away the Espruino software and libraries for free, but I can't afford support their customers for free as well.

  • Please tell me how to use the correct code from the instructions for the nrf24l01 module, I do not understand what exactly needs to be prescribed for the slave and master so that they communicate. How should the code look completely?

  • I took an example from: http://www.espruino.com/NRF24L01P

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

NRF24L01 Pico to Original stopped working with 2v03

Posted by Avatar for Allen @Allen

Actions