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
Has thanked: 49 times
Been thanked: 101 times
Contact:

NRF24L01+ 2.4gHz communication

Postby hyperion007 » Sat Mar 15, 2014 6:37 pm

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
These users thanked the author hyperion007 for the post (total 2):
Benj (Mon Mar 17, 2014 1:18 pm) • medelec35 (Sat Apr 04, 2015 12:39 pm)
Rating: 11.11%
 

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby hyperion007 » Sun Jun 08, 2014 11:03 am

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
Has thanked: 381 times
Been thanked: 714 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby JohnCrow » Sun Jun 08, 2014 12:04 pm

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
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby hyperion007 » Sun Jul 13, 2014 7:25 am

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
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby hyperion007 » Tue Jul 29, 2014 7:31 pm

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/
These users thanked the author hyperion007 for the post (total 2):
Rudi (Tue Aug 12, 2014 2:20 pm) • medelec35 (Sat Apr 04, 2015 12:39 pm)
Rating: 11.11%
 

hyperion007
Posts: 528
Joined: Sat Dec 01, 2012 1:23 pm
Location: Sweden
Has thanked: 49 times
Been thanked: 101 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby hyperion007 » Wed Aug 20, 2014 2:41 pm

Have you tried these out yet Ben? Or are you stuck with the 3D printer? :)
These users thanked the author hyperion007 for the post:
Rudi (Thu Aug 21, 2014 3:01 pm)
Rating: 5.56%
 

User avatar
Benj
Matrix Staff
Posts: 14151
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4079 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby Benj » Wed Aug 20, 2014 4:36 pm

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:
These users thanked the author Benj for the post:
Rudi (Thu Aug 21, 2014 3:01 pm)
Rating: 5.56%
 

aura809
Posts: 3
Joined: Sun Jun 23, 2013 9:31 pm
Has thanked: 1 time
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby aura809 » Mon Dec 22, 2014 9:03 pm

Is there any update about NRF24L01?
:)

MJU
Posts: 425
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 102 times
Been thanked: 94 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby MJU » Wed Feb 18, 2015 5:03 pm

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: 14151
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4079 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby Benj » Wed Feb 18, 2015 5:34 pm

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: 14151
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4079 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby Benj » Thu Feb 19, 2015 4:15 pm

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.
These users thanked the author Benj for the post (total 2):
MJU (Thu Feb 19, 2015 4:18 pm) • JohnCrow (Thu Feb 19, 2015 4:39 pm)
Rating: 11.11%
 

MJU
Posts: 425
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 102 times
Been thanked: 94 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby MJU » Thu Feb 19, 2015 4:18 pm

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.
These users thanked the author MJU for the post:
Benj (Thu Feb 19, 2015 4:51 pm)
Rating: 5.56%
 

User avatar
Benj
Matrix Staff
Posts: 14151
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4079 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby Benj » Thu Feb 19, 2015 5:30 pm

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 304 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 304 times

nRF24L01_TX.fcfx
(5.25 KiB) Downloaded 278 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.
These users thanked the author Benj for the post (total 2):
MJU (Thu Feb 19, 2015 6:25 pm) • dazz (Mon Mar 30, 2015 10:50 pm)
Rating: 11.11%
 

MJU
Posts: 425
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 102 times
Been thanked: 94 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby MJU » Thu Feb 19, 2015 6:26 pm

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: 14151
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4079 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby Benj » Mon Mar 30, 2015 3:41 pm

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: 425
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 102 times
Been thanked: 94 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby MJU » Mon Mar 30, 2015 11:04 pm

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
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby dazz » Fri Apr 03, 2015 3:07 pm

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: 425
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 102 times
Been thanked: 94 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby MJU » Fri Apr 03, 2015 11:56 pm

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: 425
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 102 times
Been thanked: 94 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby MJU » Fri Apr 03, 2015 11:58 pm

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: 14151
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4079 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby Benj » Tue Apr 07, 2015 3:16 pm

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 276 times
These users thanked the author Benj for the post:
MJU (Tue Apr 07, 2015 5:30 pm)
Rating: 5.56%
 

MJU
Posts: 425
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 102 times
Been thanked: 94 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby MJU » Tue Apr 07, 2015 5:29 pm

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: 14151
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4079 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby Benj » Tue Apr 07, 2015 6:19 pm

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: 425
Joined: Wed Nov 07, 2007 6:51 pm
Location: Antwerp Belgium
Has thanked: 102 times
Been thanked: 94 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby MJU » Wed Apr 08, 2015 12:15 am

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: 14151
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4330 times
Been thanked: 4079 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby Benj » Wed Apr 08, 2015 11:06 am

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 263 times

nRF24L01_RX.fcfx
(7.58 KiB) Downloaded 269 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
Has thanked: 514 times
Been thanked: 467 times
Contact:

Re: NRF24L01+ 2.4gHz communication

Postby dazz » Wed Apr 08, 2015 5:21 pm

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