Categories

Meta

Advertisement

Tag: ethernet shield

This past summer, I had quite a few problems with some of my ethernet shields when the temperatures got hot. I had intermittent connectivity and sometimes the shields would need to be reset, or would only work randomly whenever ambient temperatures were up above 80 degrees F or so (I have a few in the garage). It took me a while to figure out that the problem was with the w5100 chip on the shields. They get hot (or at least the inexpensive eBay knock-off versions I have been buying do).

I was able to make them work in a completely reliable fashion by attaching a small heatsink directly to the w5100 chip with some thermal paste (cpu paste). I was able to get some 11x11x5mm heatsinks from eBay for about $2.50 shipped for five of them.

Anyhow, if you have experienced unreliable results with Arduino Ethernet Shields, you might try this. It worked perfectly for me.

After much searching, and much experimenting, I finally found a workaround that seems to be working reliably for me. The solution was to use ‘software’ or ‘bit-banged’ SPI. This allows the Ethernet shield to happily commandeer the hardware SPI pins, while the nrf24l01 (or any other peripheral, I suppose) to operate on a separate, emulated SPI bus.

The credit for this goes to a user on the Arduino forums, nicoverduin, who suggested using some software SPI libraries already available and modifying maniacbug’s nrf24 library to use the software spi interface.

Here is the step by step:

1.) Download the modified maniacbug library and softSPI libraries here.
2.) Copy the libraries to your Arduino libraries folder.
3.) Configure your Arduino/Ethernet-shield/nrf24l01 like this (you can also modify the pin configuration if needed. Instructions are in the readme file on the linked github repository):

Once you have completed the above steps, you can upload your sketch to the Arduino and you should be able to browse to the IP of your Arduino with Ethernet shield and you will see a web page that tells you the last message received over the nrf24l01.

There is one major caveat to all of this, however. I have found that sometimes when I am working with the softSPI version of the nrf24 library and then I switch back to the regular/hardware version (e.g. when I work on the sending device, which in this case has no ethernet shield, after I upload a sketch to the one with the ethernet shield), the hardware-based SPI nrf24l01 breaks. This seems to be happening because the Arduino IDE is holding on to the softSPI version of the rf24 library. I am just speculating on that, but it kind of makes sense since the internal naming is identical between the libraries.

The fix for this problem is simple, if a bit inconvenient. I have been removing my modified version of the rf24 library from the Arduino libraries folder before working with the hardware-SPI version. I am sure there is a smarter way of fixing this, and if someone could point it out to me, I would be glad to post the solution here.