NRF24L01 coupled with ethernet shield

I am having trouble pairing my ethernet shield and NRF24L01. They are both spi interfaces so I have the radio on pins 8,9 for CSN and CE. I am wanting to receive messages from my sensor nodes to the base station which has the radio and ethernet shield so that I can then send the messages out on the internet. Are there any other work arounds so that I possibly don't have to use the ethernet shield?

Is this a network of several Arduino+sensor+NRF feeding into a base station, or several sensors feeding into a single remote Arduino that then sends the data to a base station?

It is a network of about 10 nodes that each consist of an arduino+sensors+rf24l01 that send the sensor data to a base node. I want my base node connected to Internet but the radio and Ethernet shield are not playing nicely. The code seems easy enough; When radionetwork is available read in data When data is new and ethenet network is available send it out over the Ethernet.

I have gotten the radios (using Maniacbugs RF24 Network library) and Ethernet shield (from Ethernet library) working correctly by themselves just not with each other.

huskerwr38:
It is a network of about 10 nodes that each consist of an arduino+sensors+rf24l01 that send the sensor data to a base node.

I have gotten the radios (using Maniacbugs RF24 Network library) and Ethernet shield (from Ethernet library) working correctly by themselves

That sounds like quite a triumph.

I was going to suggest bypassing the base station and send the stuff out by WiFi repeater but it is surely better to persevere. I imagine the problem is down to clash of pins but you seem to have already accounted for that.

Hi,

Hope you dont mind me asking a quick question....

Im looking to do something similar (without the Ethernet though - using NRF24L01 to talk to a raspberry PI instead).

I was wondering how you handled the 10 devices (the RF24 allows upto 6 connections at one time using shockburst). Are you alternating between listening to each of the 10 devices? Or are you splitting them into sets (eg 5 and 5) which you monitor in turn?

How do you handle missing packets?

Thanks

Kihon

I'm using maniacbugs network library, it allows 1000s of nodes to be connected.

Nick_Pyner:

huskerwr38: It is a network of about 10 nodes that each consist of an arduino+sensors+rf24l01 that send the sensor data to a base node.

I have gotten the radios (using Maniacbugs RF24 Network library) and Ethernet shield (from Ethernet library) working correctly by themselves

That sounds like quite a triumph.

I was going to suggest bypassing the base station and send the stuff out by WiFi repeater but it is surely better to persevere. I imagine the problem is down to clash of pins but you seem to have already accounted for that.

Yea, through my research it seems like it's just hard to pair up the Ethernet shield with other spi devices. So I'm going to have to research other avenues to get my data to the Internet.

I think what I'm going to do is just use two Arduinos, one for the RF24L01 and one for the ethernet shield. This is about the easiest way I can think of.

I found a solution that should be more simplified, the iBoard from iteadstudio http://imall.iteadstudio.com/im120410001.html. It has an NRF24L01 interface with ethernet and arduino for only $17.50. Someone has already written the code for the RF24 Network library to work with this board. So we'll see how it goes.

That doesn't sound like a good idea. All that shield does for you is tell you that the NRF and the Ethernet can live together, something you probably knew already. You already have the gear and all you have to do is find out how to put it together. You may find iteadstudio is forthcoming on this for free.

You may find that the connections are indeed 100% kosher and the problem is a minor organisation glitch in the code, which I don't recall seeing. By organisation I mean something quite simple like having the Ethernet active when the NRF is being used.

It's not a good idea because I already have the hardware? Also, the iBoard is not a shield, it's a stand alone board that can be used with the Arduino IDE. But you may be right, perhaps I can use the code that is already written for this board to be able to interface the Arduino+Ethernet Shield+NRF24 that I already have. Good idea!

I found this

https://github.com/andykarpov/iBoardRF24

here you can assign pins to MOS MISO etc . . . for the radio

Maybe it works with the ethernet shield it's forked from the RF24 library.

it seem all the same except the pin assign . . .

maybe simple solution.

I've also heard Ethernet shields don't play well with other SPI devices, but don't know for certain. It should however be possible to use shiftin/out cmds for the nRF2401.

Also, what distances are being used with all these nodes? I found nRF2401 were only good for about 10m range.

:P

I can confirm that this libary i mentioned before works perfect with ethernetshield and NRF24L01

i have made my SPI pins for the NRF24L01 to 30,31,32,33,34,35

I can receive data from the module and send it to the mysql server

So . . . Here is the solution :-)

Hello,

I tried running the IBoardRF24 but I am getting some error's and I have no idea why i am getting them when I try to compile.

C:\Program Files (x86)\Arduino\libraries\iBoardRF24\iBoardRF24.cpp: In member function 'void iBoardRF24::csn(int)': C:\Program Files (x86)\Arduino\libraries\iBoardRF24\iBoardRF24.cpp:20: error: 'digitalWriteFast2' was not declared in this scope C:\Program Files (x86)\Arduino\libraries\iBoardRF24\iBoardRF24.cpp: In member function 'void iBoardRF24::ce(int)': C:\Program Files (x86)\Arduino\libraries\iBoardRF24\iBoardRF24.cpp:27: error: 'digitalWriteFast2' was not declared in this scope C:\Program Files (x86)\Arduino\libraries\iBoardRF24\iBoardRF24.cpp: In member function 'unsigned char iBoardRF24::SPI_RW(unsigned char)': C:\Program Files (x86)\Arduino\libraries\iBoardRF24\iBoardRF24.cpp:34: error: 'digitalWriteFast2' was not declared in this scope C:\Program Files (x86)\Arduino\libraries\iBoardRF24\iBoardRF24.cpp:36: error: 'digitalWriteFast2' was not declared in this scope C:\Program Files (x86)\Arduino\libraries\iBoardRF24\iBoardRF24.cpp:38: error: 'digitalWriteFast2' was not declared in this scope C:\Program Files (x86)\Arduino\libraries\iBoardRF24\iBoardRF24.cpp:40: error: 'digitalReadFast2' was not declared in this scope

Can anybody help me. I saw helmuteke managed to make this library work on arduino.

Right - Ethernet shield and the radio boards DO work well together, there is nothing wrong with the SPI interface - I have a project by the sound of it not unsimilar to you - I'm using the Ethernet board, the NRF24L01 in a network - and I'm using digitalWritefast. I use 8 and 9 for the CE etc on the radio and obviously 10 for the Ethernet. In the case of the 1284 chip I use PB4 for the Ethernet and PC6 and PC7 for the radio. Let me assure you there is nothing wrong with that - assuming you're using something like RF24 and RF24Network for the radios - and ETHERNET library for the Ethernet. When I first started I was using ETHERCARD using the ENC chip and the radios.. That too worked perfectly.

helmuteke: :P

I can confirm that this libary i mentioned before works perfect with ethernetshield and NRF24L01

i have made my SPI pins for the NRF24L01 to 30,31,32,33,34,35

I can receive data from the module and send it to the mysql server

So . . . Here is the solution :-)

What is the order of the pin out in the coding? I see where you can change what pins you use to control the nrf24l01 but i am not sure as to which pin on the UNO goes to the nrf.

// Set up nRF24L01 radio on iBoard
iBoardRF24 radio(3,8,5,6,7,2);