Pages: [1]   Go Down
Author Topic: Ethernet and nRF24LO1+ Working together?  (Read 3049 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Sr. Member
****
Karma: 1
Posts: 252
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to get together a project that will take weather data (humid, temp, light) from different areas of my house inside and out. I have no real conflict with the nodes ( 4 in total). They will simply be ATmega328 with only what I need broken out to read the three sensors and talk with the nRF24 radio (very much like the one shown here only with two additional sensors).
http://maniacbug.wordpress.com/2011/10/19/sensor-node/

I want the nodes to all talk to one parent UNO, which will have a nRF24 radio, data log with a ds1307 RTC and SD (cs on pin 4) and post the last received sensor data to the web.

Will there be a conflict with the radio and the ethernet?

The ethernet is going to use  DP10 (SS), DP11 (MOSI), DP12 (MISO), DP13 (SCK)...
http://arduino.cc/en/Main/ArduinoBoardEthernet

The radio uses CE=DP8, CSN=DP7, SCK=13, MOSI=11, MISO=12.
http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo

I know that there is some talk about the nRF24 radio and ethernet in a few threads but there does not seem to be much info if someone got this to work.

Thanks in advance.

-Rob
Logged

Seattle, WA
Offline Offline
God Member
*****
Karma: 11
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I have that working, using ENC28J60.  The only tricky piece is the SPI bus parameters.  RF24 sets them to MSBFIRST, MODE0, SPI_CLOCK_DIV4 every time you interact with the radio. If the Ethernet library needs different parameters, and doesn't set them itself, there could be problems.  I've been meaning to tune RF24 to be nicer about the SPI bus parameters, and happy to do it now if you run into problems.
Logged


Offline Offline
Sr. Member
****
Karma: 1
Posts: 252
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'll have to look into what the ethernet needs. I was going to use the standard library for the ethernet and I'm not sure what the call out.
Logged

Offline Offline
Sr. Member
****
Karma: 1
Posts: 252
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

maniacbug,

   Where did you get the board for the sensor node project? I noticed that you said it was $1.00, did you have them made?

I was going to use an IC based proto pcb a local electronics store carries but yours looks much smaller and professional.
Logged

Offline Offline
Sr. Member
****
Karma: 1
Posts: 252
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I checked all of the cpp and h files associated with the ethernet lib including the w5100 files. I did not see any pin assignments. So if I understand the problem, The nRF24 is going to reassign the SPI pins each time it's called and because the ethernet does not reassign them for itself, it will not work. I thought that the wiznet was special because some of the software functionality was encoded in to the hardware, no?
Logged

Seattle, WA
Offline Offline
God Member
*****
Karma: 11
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

   Where did you get the board for the sensor node project? I noticed that you said it was $1.00, did you have them made?

Can you be more specific?  Which board?

Oh do you mean the board referenced on Getting Started with nRF24L01+ on Arduino?  It's from iTeadStudio.  There's a link right to it in the post!  Double Side ProtoBoard 5cm * 7cm

I checked all of the cpp and h files associated with the ethernet lib including the w5100 files. I did not see any pin assignments. So if I understand the problem, The nRF24 is going to reassign the SPI pins each time it's called and because the ethernet does not reassign them for itself, it will not work. I thought that the wiznet was special because some of the software functionality was encoded in to the hardware, no?

No no, RF24 does not change any pin assignments.  It alters the SPI parameters.  They are named in my earlier post.

It's true that the wiznet has the TCP/IP stack in hardware, which makes it much easier to use, but that fact is not relevant for what we're talking about here.  You should just try it.  Like I said, I have a fix in mind anyway, if there are problems.
Logged


Offline Offline
Sr. Member
****
Karma: 1
Posts: 252
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

  Where did you get the board for the sensor node project? I noticed that you said it was $1.00, did you have them made?

Can you be more specific?  Which board?

Oh do you mean the board referenced on Getting Started with nRF24L01+ on Arduino?  It's from iTeadStudio.  There's a link right to it in the post!  Double Side ProtoBoard 5cm * 7cm


Sorry about the confusion, I was asking about the PCB for this project.

http://maniacbug.wordpress.com/2011/10/19/sensor-node/

I am very interested in making a project like this for myself, only with 3 nodes and a base rather than your army of nodes. Once I get the boards built, I may be bugging you for more details.  smiley-wink
« Last Edit: January 23, 2012, 12:52:40 pm by RobDrizzle » Logged

Seattle, WA
Offline Offline
God Member
*****
Karma: 11
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sorry about the confusion, I was asking about the PCB for this project.

http://maniacbug.wordpress.com/2011/10/19/sensor-node/

I am very interested in making a project like this for myself, only with 3 nodes and a base rather than your army of nodes. Once I get the boards built, I may be bugging you for more details.  smiley-wink

Ah, yes...  I had that PCB made using iTeadStudio's PCB service.  They will make 10 copies of a design that size for about $10.  The PCB I designed myself.  You are welcome to use it or modify it, just please be sure to abide by the terms of the CC BY-NC-SA license.

Good luck!
Logged


Offline Offline
Sr. Member
****
Karma: 1
Posts: 252
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

^^Thank you for this and rest assured that I will be respectful of your hard work and effort!!

I was able to download your board file and get it to spit out some gerber files. This is my first time using eagle and the blasted drill layer would not line up!!! After some reading and tinkering I got it to work, it ended up being that the "pos coordinates" check box in the cam processing was buggering everything up.

I would like to take this a step further and report humidity also. You were keen enough to break out a few extra inputs so I don't think I will need to change the board. I am also going to run the node with 2 AAA batteries rather than the coin cell to increase longevity and because the project box enclosure that I will be using will have enough space.
Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have that working, using ENC28J60.  The only tricky piece is the SPI bus parameters.  RF24 sets them to MSBFIRST, MODE0, SPI_CLOCK_DIV4 every time you interact with the radio. If the Ethernet library needs different parameters, and doesn't set them itself, there could be problems.  I've been meaning to tune RF24 to be nicer about the SPI bus parameters, and happy to do it now if you run into problems.

Hi!

I have tried everything I can, and finally find this. But, I have no idea how to use this information to make these work together.
ENC28J60 works fine, but when RF-module is called, that's it.
Running out of hope with this combination....

Any hints, where to look for more knowledge? Thanks!

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 47
Posts: 2177
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have that working, using ENC28J60.  The only tricky piece is the SPI bus parameters.  

I am looking at doing more or less the same thing as RobDrizzle but I have been obliged to put off my foray into NRF24. Is this a (potential) problem with the W5100 Ethernet too?  I didn't realise there could be a conflict.
« Last Edit: April 14, 2013, 08:06:46 pm by Nick_Pyner » Logged

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

nRF24L01 works fine with Ethernet Shield with W5100, but using that instead on small ENC28J60-module would be... cheating...?
smiley-wink

I made this http://www.instructables.com/id/A-credit-card-sized-Ethernet-Arduino-compatable-co/ and I want to use it too.

Well, someday I will understand the problem better, googling googling googling...

Cheers,
Kari
Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

Espoo, Finland
Offline Offline
God Member
*****
Karma: 7
Posts: 586
"Oops, try again..."
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Works beatifully, at least one direction!

I tried this, added it before and after calling nRF;
Code:
void SwitchRfEth()
{
  //Switch ethernet's CS pin state
  digitalWrite(10, !digitalRead(10));
  //Switch radio's CS pin state
  digitalWrite(8, !digitalRead(8));
}

Thanks!!!

Cheers,
Kari

Logged


The only law for me; Ohms Law: U=R*I       P=U*I
Note to self: "Damn! Why don't you just fix it!!!"

Dee Why NSW
Offline Offline
Edison Member
*
Karma: 47
Posts: 2177
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

nRF24L01 works fine with Ethernet Shield with W5100, but using that instead on small ENC28J60-module would be... cheating...?
smiley-wink

God I hope not. I don't want to be changing horses at this stage...
Logged

Pages: [1]   Go Up
Jump to: