NRF24L01 library problems #436
Replies: 14 comments
-
Posted at 2014-03-05 by @gfwilliams I'd perhaps try and compare: https://github.com/maniacbug/RF24/blob/master/RF24.cpp and https://github.com/espruino/EspruinoDocs/blob/master/devices/NRF24L01P.js Espruino uses the default clock rate - so you could either modify the Espruino library, or you could modify the Arduino one to stop it setting the rate away from the default. First thing I'd try is to set Espruino's payload size to 32 bytes though - Espruino defaults to 16 but the module you link to seems to use 16. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-06 by ArthurGuy I spent a while after posting this digging through the datasheet looking for the defaults with the assumption that the espruino library doesn't change them. There are still a number of naming convention differences I haven't gotten my head around but I will take another stab at it. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-17 by conor I've been struggling with exactly the same setup and libraries. I've ended up dumping out the register contents of the NRF24L01+ from both the Espruino side and the Arduino side and tried to line them up. There were some basic differences like bit rate and channel which I've sorted out but still almost no joy. I've managed to go from silence to maybe one transmit in 30 or 40 being received by the Arduino if the Espruino is sender and similar success rate if I swap them around. The RF24 Arduino code works perfectly on a mix of Pro Minis, Unos and DigiX but just getting no joy on Espruino. The only thing I can think of at the moment, in lieu of an oscilloscope, is to get a second Espruino and see if they can at least see each other. Register Dump from Arduino: Register Dump from Espruino: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-17 by ArthurGuy I tried doing the same thing, I read out the registers and matched up as much as possible but I couldn't get anywhere. I assume the library is good enough to get two espruino's talking but that wasnt what I was interested in. In the end I switched from using an espruino as the main device in my project to using a spark core. Not quite as nice but it just worked. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-18 by conor I'm aiming for full interoperability between a range of Arduinos, Espruino and RaspberryPi so I'd love to get to the bottom of this. Oddly, it's reassuring that you are having the same problems as it means I probably don't need to worry about wiring or a dud module any more! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-18 by ArthurGuy The problem as I see it is the library doesn't expose any of the settings required to use the device, it just relies on the default while the RF24 library used elsewhere intentionally resets every setting to something else. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-18 by @gfwilliams It looks from the dump above like the RX and TX addresses are different. I guess you've at least set those up correctly first? The NRF module will talk to other Espruinos just fine - I don't think I was even aware of the RF24 module when I wrote it though so I guess it's not a big surprise that they don't talk. Can you not modify the Espruino library to go through exactly the same steps for setup? You can just add It shouldn't take that much work to fix it - it'd be great if you could issue a pull request if you get it working... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-18 by conor Thanks Gordon, I've done a lot of playing with addresses at both ends as per the IC spec without much luck. I've been trying to make Arduino settings more like Espruino, but as you suggest, maybe the other way around might be better. I'll play more this week. Will do pull request if I get to the bottom of it. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-18 by @gfwilliams Thanks - I guess the ideal outcome would be that Espruino could talk to an Arduino that hadn't had any Espruino-specific changes made to it - but I don't know how hard it'll be to make that happen. It might be worth changing the 4th 'payload' argument into an object, which could have various other initialisation options which could bring it more in line with Arduino. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-12 by conor @ArthurGuy I finally got back to trying this out again and made some progress. I can now successfully transmit from Arduino to Espruino completely reliably. On Espruino:
On Arduino:
The only change I really made since previously was to set the Payload to 16 on Arduino as suggested by @gordon. I also tried setting Dynamic Payload in both cases and that seems to work too. However making the Arduino the receiver and the Espruino the transmitter is proving more difficult. The Arduino says that it has received a payload every time one is sent from the Espruino, but the contents are all zeros. The Espruino also gives a "TX not received 82" after every transmit. So at least we know there is no fundamental incompatibility here but I'm running out of ideas on the Arduino-RX side of things. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-12 by mikewop @conor Thanks for posting this code! Great you got it to work (at least one way). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-12 by DrAzzy How much does the NRF need? The espruino board can supply 150ma at 3.3v... People have reported success talking between two espruinos though, so I don't think it's that... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-13 by tickTock @drazzy: The nrf draws less than 15mA (0 dBm TX power, 2 Mbps air data rate). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-04-13 by conor I'm pretty sure it's not power. It may be something very simple that is still configured differently between the two. More investigations required by me! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-03-04 by ArthurGuy
Hi all,
I am attempting to communicate between an espruino and an arduino using the NRF24L01+ modules.
I have followed the examples on the espruino website and I am using the RF24 library on the other end.
http://maniacbug.github.io/RF24/
The problem I am having is that the two systems seem completely different, I am guess the espruino library doesn't implement many features but even using the ones it does I should be able to get this to work.
Has anyone managed anything like this?
Does anyone know what channel and data rate is used, how do these correspond to the addresses passed into the init function?
Any advice would be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions