Fixing Arduino Ethernet and RFM12 Communication

Unfortunately, Arduino’s Ethernet shield does not play very nice with other devices that want to use its select pins. After many searches, I came across jcw’s discussion board and Martin’s implementation doc.

Because the ethernet shield uses digital pin 10 select, RF12 select line needs to use digital pin 9. You also need to disable interrupts. As such, you need to modify both your w5100 and rf12 libraries.

Based on jcw and Martin’s posts.
Martin’s post
jcw post
Another great post explaining SPI

Step 1:
Change w5100.h


Step 2:
Change RF12.cpp



Step 3:
You also need to change the order of your includes. You must include Ethernet.h before JeeLib.h

You also need to change your initialization sequence. You must initialize rf12 before ethernet.

Example of timedRecv that works:

You may also like...