[Alex@Raspi.tv] had the misfortune of blowing the USB hub and Ethernet port on a Raspberry Pi B+. He thought about using a cheap SPI to Ethernet board to rescue it, and while he bought the board, he never got around to interfacing it to the broken Pi. However, when he saw the Raspberry Pi Zero arrive and noticed that everyone wanted to connect it to the network, he remembered the SPI board, rescued it from his junk box, and a few hours later had Ethernet via Raspberry Pi GPIO working.
To make things easier, he got it all working on a Pi A first and then moved to the Zero. You’d think performance would not be very good, but measurements [Alex] made show it isn’t bad at all, considering:
Pi Zero at 12 MHz 3.33 Mbaud down, 2.82 Mbaud up, 39.956 ms latency, 52.19km
Pi Zero at 16 MHz 3.67 Mbaud down, 2.90 Mbaud up, 37.749 ms latency, 43.57km
Pi Zero at 20 MHz 3.88 Mbaud down, 3.10 Mbaud up, 42.474 ms latency, 43.57km
[Alex] notes that the Pi’s official 3.3V rail capacity doesn’t meet the requirements of the SPI Ethernet module he used. However, he also says it works, and he’s heard “unofficially” that it probably should work. We were not sure if he meant he heard the Pi’s 3.3V supply is underrated or if the consumption of the Ethernet chip is overstated.
We’ve seen a lot of Pi Zero hacks in the last week or two. The WiFi hack is similar, and there was an audio hack, too. Of course, there’s also the lively debate about if you should try to extend a Zero anyway.
22 thoughts on “Pi Zero Ethernet The Hard Way”
Neat hack! I’m shocked at how easy adding the enc28j60 kernel module to Raspbian was!. This is why the Raspberry Pi boards are the ones that I recommend to makers, hackers and Linux noobs….despite my issues with the Rpi Zero board.
Should work with pretty much any ARM platform that uses device trees, which is most or all of the ones supported by upstream Linux. The feature that makes this so easy to do (device tree overlays) was developed for the Beaglebone originally, and you should be able to do the same thing on the C.H.I.P or many other boards too. (Incidentally, this wouldn’t have worked for the Pi in the first couple of years after it launched because they didn’t support device trees back then.)
Also this interesting hack using a stripped down ESP8266 interfaced to the GPIO connector using SDIO. I am hoping there will be more detail to come.
That looks pretty sweet. Could drive down the price of wireless access for all Pis, but is especially relevant in the Zero. It’s discouraging to spend more on the Internet access than the computer itself. Thanks for that link, I’ll be following that project. I’m always amazed at the new stuff I see everyday on the community site, and I’m sure I’m missing plenty of it
I agree with you in 100%. It’s indeed very discouraging especially that we have only one USB port available.
I played with using ESP8266 as a WiFi dongle and have some success in it.
If anyone is interested how this could be done I prepared little text here: pwiatrowski.com/technology/raspberry-pi-zero-esp8266-internet/
In short it requires esp-link firmware, socat and slattach.
you have 2MB almost thumbnail on this page
you’re right – thanks – it should be fixed now :)
I think you meant _the awesomo way_
The enc28j60 is a 10BASE-2 interface, theoretical max speed is 10 Mb/s but the practical one is lower, say 6Mb/s, so the speed benchmark results although not spectacular aren’t bad at all.
That was 10BASE-T, sorry.
Neat, I wonder whether I could reuse that cheap chinese enc28j60 Arduino network shield I still have somewhere in the same way.
How hard/easy would it be to make it coexist with a spi display (pitft for example)?
I also noticed a secondary spi interface on the gpio port, numbered in the 30s.
There are actually two chip select pins (the second is GPIO7, on pin 26) so I would have thought quite easy!
This is brilliant. I saw it posted in the comments of an earlier article and I’m glad that it got its own post.
That being said, it seems like every post about the Zero is adding back something removed from the B, negating its size and cost benefit. I can’t wait for a Zero project that takes advantage of the size for something that the B wouldn’t be able to do.
Again, this project is great (and dead simple, love it) and my above comment is in no way meant to detract from that.
I recognize that the Zero is in fact smaller but I don’t see how there is a size benefit. The regular Pi are so small already! Maybe if the Zero was down to implantable sizes or something… I only see the Zero as having a cost benefit not a cost one.
Then again.. I have had thoughts about using a Pi in projects where I would desolder many of the connectors in order to reduce the height of the board. That isn’t the same as actually removing those features though as I would still be using them but with soldered jumpers rather than plug in connectors. I often wished they would come up with something just like the 2 but all the connectors would be in a baggie, not pre-soldered.
Shameless self promotion: http://www.philipstrong.co.uk/doku.php/raspberry-pi;ethernet
I’ve popped it all on one nice tidy PCB :)
So anyone know of a cheap USB OTG WiFi Dongle?
Please correct your units of data throughput. Baud is the signalling rate at the physical layer. I don’t believe Ethernet has variable signalling rates; it’s either 10Mbps, 100Mbps, etc..
The actual throughput, depending on processing delays, half-duplex timing and perhaps collisions, will vary.
You could use this for out-of-band signalling/management of your pi. It is not a completely out-of-band as per the wikipedia article ( https://en.wikipedia.org/wiki/Out-of-band_management ). I believe that a raspberry can’t be competently remote controlled as a true out-of-band management solution would require.
It could also be useful for security. If you used a C/Python library to access the network, you would not have to worry about any Linux or other software exploits.
ENC28J60 is now also available in PI Zero’s form-factor: http://kck.st/1Q7yE1U
The chip on that board is now also available in Zero-form factor (plus includes power regulator not using the 3V3 rail, but 5V rail from the PI) http://kck.st/1Q7yE1U
Please be kind and respectful to help make the comments section excellent. (Comment Policy)