NRF24L01+ 2.4gHz communication

Please add any feature requests for Flowcode version 6 here

Moderator: Benj

Forum rules
Only feature requests will be considered here. General questions should not be posted in this forum.
hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

NRF24L01+ 2.4gHz communication

Post by hyperion007 »

Don't know if this qualifies as a feature but I would like to suggest a component is made for these. I have tried my hand at these but there are so many routines and macros needed to get this to work with even the most basic features/functions. That's why I think it would be a good candidate for a actual component. That and the fact that they are dirt cheap. I bought these two for $10 US including shipping: http://www.ebay.com/itm/161130096510?ss ... 1439.l2649

Some library for these on the Arduino: http://maniacbug.github.io/RF24/

Datasheet: http://www.nordicsemi.com/eng/content/d ... on_1_0.pdf

And the pinout of these common modules (available with either PCB antenna or SMA):
Image

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by hyperion007 »

Is this on "the list" Ben? :)

User avatar
JohnCrow
Valued Contributor
Valued Contributor
Posts: 1367
Joined: Wed Sep 19, 2007 1:21 pm
Location: Lincolnshire
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by JohnCrow »

I've got a couple of these in the bit box myself.
Picked them up on ebay for a few £ but not had time to start and look at them yet.

As they are only a few mW output power they are licence free. (UK anyway)

Mine have the PCB antenna.
1 in 10 people understand binary, the other one doesn't !

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by hyperion007 »

I had a go a while back but couldn't get these to work even a little bit :(

As any FC supported Wifi modules are VERY expensive I think these would be great alternatives in many cases. Allowing several nodes to communicate with one master that can then upload data or whatever via WIFI/GSM/Ethernet making it much cheaper.

Here's to hoping support will be added :) again, I can do some testing and such, to help out.


Thanks
/Daniel S

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by hyperion007 »

Here is another link to what seems to be a pretty good library and tutorial for the NRF24L01+ modules:

http://maniacbug.wordpress.com/2011/11/ ... rted-rf24/

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by hyperion007 »

Have you tried these out yet Ben? Or are you stuck with the 3D printer? :)

User avatar
Benj
Matrix Staff
Posts: 14929
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by Benj »

Hello,

Its on the list and I have one of the modules currently sat on my desk. Hopefully get around to looking at these soon but please keep posting reminders if it slips my mind as I've got a lot to dig through at the moment and not the best memory :wink:

aura809
Posts: 3
Joined: Sun Jun 23, 2013 9:31 pm
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by aura809 »

Is there any update about NRF24L01?
:)

MJU
Posts: 471
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by MJU »

Hi BenJ,

Just a reminder... :D
Benj wrote:but please keep posting reminders if it slips my mind as I've got a lot to dig through at the moment and not the best memory :wink:

User avatar
Benj
Matrix Staff
Posts: 14929
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by Benj »

Hello,

Yep I've still got one on my desk and not managed to get it out the bag yet. To be honest the ESP wifi devices totally distracted me off the subject.

I'll put it back on my list to have a look at these and try to make a component.

User avatar
Benj
Matrix Staff
Posts: 14929
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by Benj »

Hello,

I'm quite far on with this now, nearly at the end but the demo code is quite complicated in terms of pipes and pointers and I need to focus on other things this afternoon. So probably sometime next week I will have a workable component.

MJU
Posts: 471
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by MJU »

Did I ever tell you how great you are? :-)
I really hope you can make a component for this piece of hardware!

Thank you BenJ
Benj wrote:Hello,

I'm quite far on with this now, nearly at the end but the demo code is quite complicated in terms of pipes and pointers and I need to focus on other things this afternoon. So probably sometime next week I will have a workable component.

User avatar
Benj
Matrix Staff
Posts: 14929
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by Benj »

Thanks MJU, Much appreciated :D

I'm still waiting on an email so I've plodded on and created the component and a set of examples. No idea if it works or not in practise but it does at least compile so that's a start. Also note that it was a liquid lunch today to say goodbye to Mark so that's probably had an effect :wink:

Here is the component which will need to be placed here "C:\Program Files (x86)\Flowcode 6\components"
nRF24L01.fcpx
(13.82 KiB) Downloaded 358 times
And here is an example of sending and receiving data. The TX program simply sends out strings one after another with delays. The RX program listens for data and if it receives some will display it on a LCD.
nRF24L01_RX.fcfx
(6.93 KiB) Downloaded 353 times
nRF24L01_TX.fcfx
(5.25 KiB) Downloaded 321 times
If anyone tries this on the hardware then please let me know how your getting on. Fingers crossed it will all fire up and work correctly but there may be bugs lurking.

I do have some of these modules to hand so I can rig up a circuit and try it if anyone is struggling. However I can't do it right now as for some reason I only left myself one module at work and one module is not enough to test communications! DOH.

If anyone does try it and your getting nowhere with the examples then something to try might be to change the characteristics of the SPI connection (polarity, phase, sample point). To do this click View -> Component Debugger then tick the box "Expose full component tree" then in the properties window you can access the CAL_SPI component properties using the drop down menu at the top of the window.

Also note that the module is 3V3 only, for simplicity I would test using a 3V3 micro to remove the need for extra level shifting circuitry. Saying this the datasheet does say that if you power from a 3V3 voltage source then the signals can be as high as 5.25V so this might be ok.

MJU
Posts: 471
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by MJU »

Thanks BenJ

I'm going to try it as soon as my modules arrive.
They should have arrived already :-s

User avatar
Benj
Matrix Staff
Posts: 14929
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by Benj »

Hello,

Any word on if this component is working with your hardware? I have not got around to testing yet so would be nice to know if I should include the component in the next build or not.

MJU
Posts: 471
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by MJU »

Benj wrote:Hello,

Any word on if this component is working with your hardware? I have not got around to testing yet so would be nice to know if I should include the component in the next build or not.
Hello Ben,

I've had almost the same problem as you had earlier.
I received two modules, tried them and one of them was broken so I was left with only one module.
I have ordered four new ones and hoping to receive them soon.

Just today I, by coincidence, received adapter boards to get them powered with 3.3V.
Meanwhile i hope to get a few more modules soon so I can start testing them.
I really really hope they work as good as people say!
When I have the chance to test them I will let you know ASAP.

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by dazz »

Hi Benj
doesnt appear to work, looking at the openpipe write macro, it has nowhere to add an adress, whereas the readpipe does, can you check and let us know

Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

MJU
Posts: 471
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by MJU »

Received the new modules, hooked them up.
Flashed the Flowcode examples from above into two 16F877A's, but nothing happens. :-s (after changing the target).
The modules need 3.3V max but the datalines are 5V tolerant.

Will try in the next few days to find out why..

MJU
Posts: 471
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by MJU »

dazz wrote:Hi Benj
doesnt appear to work, looking at the openpipe write macro, it has nowhere to add an adress, whereas the readpipe does, can you check and let us know

Regards
Dazz
Didn't see this post..
Same problem here :-(

User avatar
Benj
Matrix Staff
Posts: 14929
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by Benj »

Aha,

Ok I had created a SetPipeAddress macro but not made it public.

The write pipe always uses pipe 0 hence no address.

The read pipe can be 0-5, suggest using 1.
nRF24L01.fcpx
(14.1 KiB) Downloaded 318 times

MJU
Posts: 471
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by MJU »

Benj wrote:Aha,

Ok I had created a SetPipeAddress macro but not made it public.

The write pipe always uses pipe 0 hence no address.

The read pipe can be 0-5, suggest using 1.
nRF24L01.fcpx
Hey thank you BenJ..

What is the correct way to set the Pipe-addresses?
I see that the OpenReadingPipe, SetPipeAddress have got Pipe-addresses.
Can I choose them myself?
They are bytes, so can I give them a number between 0-255?

I hope to play with them soon :-)
Thanks for your work!

User avatar
Benj
Matrix Staff
Posts: 14929
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by Benj »

From looking at the code each data pipe has a 5 byte address.

First you need to create the byte array, so create a byte var named.

bytearray[5]

If you pass in a byte array with 5 index locations then it should look like this.

bytearray

Populating the byte array can be done in a calculation icon like this where each value can be 0-255.

bytearray[0] = 1
bytearray[1] = 2
bytearray[2] = 3
bytearray[3] = 4
bytearray[4] = 5

I believe the transmit and receive pipe addresses have to match to allow data to be sent and received at the other end.

MJU
Posts: 471
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by MJU »

Benj wrote:From looking at the code each data pipe has a 5 byte address.

First you need to create the byte array, so create a byte var named.

bytearray[5]

If you pass in a byte array with 5 index locations then it should look like this.

bytearray

Populating the byte array can be done in a calculation icon like this where each value can be 0-255.

bytearray[0] = 1
bytearray[1] = 2
bytearray[2] = 3
bytearray[3] = 4
bytearray[4] = 5

I believe the transmit and receive pipe addresses have to match to allow data to be sent and received at the other end.
Ok...
On the datasheet page 41 I see the Pipe-address settings.
But in Flowcode I've made a array (byte with 5 values), and filled them with numbers.
Then I try to write this array tot the SetPipeAddress I choose Pipe nr 1 and want to run trough the array with a counter (to set array[counter]), but this doesn't work.

Maybe I'm too tired, but I'm going to stop for now.
If someone has a working example I really want to test it.

User avatar
Benj
Matrix Staff
Posts: 14929
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by Benj »

Looks like I need to rig up a working circuit so I can sign off the code.

Here are the updated examples using the latest component with the address in place. Fingers crossed this works. If not then let me know and I will try and do some further tests here.
nRF24L01_TX.fcfx
(5.89 KiB) Downloaded 303 times
nRF24L01_RX.fcfx
(7.58 KiB) Downloaded 309 times
Thinking about it I have been misdirected by the Arduino code, setting the address as 5 individual bytes would be much easier then passing in an array!

dazz
Posts: 1314
Joined: Sun Jan 15, 2012 3:15 pm
Contact:

Re: NRF24L01+ 2.4gHz communication

Post by dazz »

HI Benj
stoopid question i know but wouldnt it be easier to hardcode the addresses as they are specific to this device, so if you added the set address macro you just need to select the addy you want ie 1 or 2 etc.
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php

Post Reply