Ethernet For Hackers: The Very Basics

Ethernet is ubiquitous, fast, and simple. You only need two diffpairs (four wires) to establish a 100Mbit link, the hardware is everywhere, you can do Ethernet over long distances easily, and tons of the microcontrollers and SoCs support it, too. Overall, it’s a technology you will be glad to know about, and there’s hundreds of scenarios where you could use it.

If you need to establish a high-bandwidth connection between two Linux boards in your project, or maybe a Linux board and a powerful MCU, maybe make a network between microcontrollers, Ethernet’s your friend. It also scales wonderfully – there’s so much tech around Ethernet, that finding cables, connectors or ICs tends to be dead easy. Plus, the world of Ethernet is huge beyond belief. Ethernet as most of us know it is actually just the consumer-facing versions of Ethernet, and there’s a quite a few fascinating industrial and automotive Ethernet standards that flip many of our Ethernet assumptions upside down.

Now, you might be missing out on some benefits of Ethernet, or perhaps misunderstanding how Ethernet works at all. What does it mean when a microcontroller datasheet says “has Ethernet interface”? If you see five pins on an SBC and the manufacturer refers to them as “Ethernet”, what do you even do with them? Why does the Raspberry Pi 4 SoC support Ethernet but still requires an extra chip, and what even is GMII? Continue reading “Ethernet For Hackers: The Very Basics”

All About Cats, And What Ethernet Classifications Mean Beyond ‘Bigger Number Better’

Although it probably feels like forever to many of us since Category 5 Ethernet cabling became prevalent, now that 2.5 and even 5 Gbit Ethernet has trickled into the mainstream, a pertinent question that many probably end up asking, is when you should replace Cat-5e wiring with Cat-6, or even Cat-7. Since most of us are likely to use copper network wiring for the foreseeable future in our domiciles and offices, it is a good question that deserves a good answer. Although swapping a Cat-5e patch cable with a Cat-7 one between a network port and computer is easy enough, replacing all the network cable already pulled through the conduits of a ‘future-proofed’ home is not.

The good news is probably that Category 8 Class II (Cat-8.2) is all you need to run your 40 Gbit Ethernet network with standard twisted pair wiring. The bad news is that you’re limited to runs of only thirty meters before signal degradation begins to kick in. If you take things down a notch to Cat-6A or Cat-7 (ISO/IEC 11801 Class EA and F, respectively), you can do 100 meter runs at 10 Gbit/s just like 100 meters runs at 1 Gbit/s were possible with Cat-5e before. Yet what differentiates these categories exactly?

Continue reading “All About Cats, And What Ethernet Classifications Mean Beyond ‘Bigger Number Better’”

Adapter Board Expands The Pi Zero

The standard Raspberry Pi computers have been in short supply for a while now, so much so that people are going to great lengths to find replacements. Whether it’s migrating to alternative single-board computers or finding clones of the Pi that are “close enough”, there are solutions out there. This method of building a full-size Raspberry Pi with all of the bells and whistles using the much-less-in-demand Pi Zero also stands out as a clever solution.

[SpookyGhost] didn’t build this one himself, but he did stumble across it and write a pretty extensive how-to and performance evaluation for the board, which can be found here. The adapter connects to the Zero’s HDMI and USB ports, and provides all the connectors you’d expect from a larger Pi such as the 3B. It’s not a perfect drop-in replacement though — you don’t get the 3.5 mm audio jack, and the micro SD card location doesn’t match up with where it should be on a “real” Pi.

All things considered, this is one of those solutions that seems obvious in retrospect but we still appreciate its elegance. It might disappear as soon as chip shortages stop being an issue, but for now we’ll take any solutions we can. If you don’t already have a Pi Zero on hand, we’ve seen some other successes replacing them with thin clients or even old smartphones.

Send This FPV Bot Into The Crawlspace To Do Your Dirty Work

The least pleasant space in most houses is likely to be the space below it. Basements tend to be dank, dusty, and full of too many things that have too many legs. And even worse than the full basement is the dreaded crawlspace, which adds claustrophobia to the long list of unpleasantries that lie below. Sadly, though, a crawlspace might be a handy place to run wires, and if you’re hesitant to delve too deeply, this FPV cable-laying rig might be something to keep in mind.

This one comes to us from [Old Alaska] with very little detail other than what’s in the brief video below. The setup is clear enough — a need to run an Ethernet cable from one side of the house to the other, and a crawlspace to do it in. Also in the toolkit was an RC rock crawler with a field-expedient FPV camera. With Breaking Bad-style access to the crawlspace through a few floorboards, [Old Alaska] was able to deploy the crawler dragging a Cat 5 cable behind it. The terrain under the house made the rock crawler a good choice, with four-wheel-drive, locking differentials, and an articulating frame. The bot’s-eye view also makes it clear that actually crawling in this rubble-strewn crawlspace would be a painful affair.

With very little drama, [Old Alaska] was able to navigate the crawler across the crawlspace to the outer wall of the house, where he could fish the wire out and complete the connection — no fuss, no muss, no bloody knees. The only quibble we’d have is not running an extra length of pull rope with the wire. You never know when it’ll come in handy.

The whole thing reminds us of a more tactical version of [Cliff Stoll]’s subterranean inventory management bot.

Continue reading “Send This FPV Bot Into The Crawlspace To Do Your Dirty Work”

It’s Ethernet, From An SPI Interface

Over the years as microcontrollers have become fast enough to do the heavy lifting, we have become used to 10 megabit Ethernet being bit-banged from interfaces it was never meant to emerge from. We think however that we’ve never seen one driven from an SPI interface, so this one from [Ivan] may be a first. With a cleverly designed transceiver using logic chips, it even offers a chance to understand something about the timing of an Ethernet interface, too.

The differential logic signals derived from a simple Ethernet transceiver can be read by an SPI bus, but for the lack of a clock line. The challenge was then to construct a circuit the would construct the required clock pulses from the state changes on the data line. This would become a monostable with XOR gate, and a shift register to handle the clock during the preamble phase.

The resulting circuitry fits neatly on a shield for the ST Nucleo 64 board, where while it might not be the obvious choice for an Ethernet shield it certainly does the job.

If unexpected Ethernet is your thing, how about the i2s peripheral on an ESP8266?

Power Over Ethernet, Explained

Most readers will be familiar with Ethernet networks in some form, in particular the Cat5 cables which may snake around the back of our benches. In a similar vein, we’ll have used power over Ethernet, or PoE, to power devices such as webcams. Buy a PoE router or switch, plug in a cable, and away you go! But what lies behind PoE, and how does it work? [Alan] has written a comprehensive guide, based on experience working with the technology.

What we get first is a run-down of the various topographies involved. Then [Alan] dives into the way a PoE port polls for a PoE device to be connected, identifies it, and ramps up the voltage. Explaining the various different circuits is particularly valuable. The final part of the show deals with the design of a PoE module, with a small switching power supply to give the required 48 volts.

All in all, this should be required reading for anyone who works with Ethernet, because it’s one of those things too often presented as something of a black box. If you’re thirsty for more, it’s a subject Hackaday have touched on too in the past.

Magnetic jack version of the bit-bang ethernet peripheral for Raspberry Pi Pico

Bit-Banging Bidirectional Ethernet On A Pi Pico

These days, even really cheap microcontroller boards have options that will give you Ethernet or WiFi access. But what if you have a Raspberry Pi Pico board and you really want to MacGyver yourself a network connection? You could do worse than check out this project by [holysnippet] that gives you a bit-banged bidirectional Ethernet port using only scrap passive components and software.

This project is similar to one we shared back in August by [kingyo], but differs in that what [holysnippet] has achieved is a fully-functional (albeit only around 7 Mbps) Ethernet port, rather than a simple UDP transmit device. The Ethernet connection itself is handled by the lwip stack. Connection to the RJ45 socket can be made from any of the Pi Pico pins, provided TX_NEG is followed directly by TX_POS, but the really hacky part is in the hardware.

schematic of Pi Pico bit-banged ethernet peripheral
Schematic showing the empirically-determined passive component values required.

Rather than developing hardware that would protect the Pico, this design admits that it “shamefully relies on the Pico’s input protection devices” to limit the Ethernet voltages to 3.3 V.

You’ll need an isolation transformer from some old Ethernet-enabled gear (either standalone or as part of a magnetic jack), but then it’s only resistors and capacitors from there. There are warnings not to connect this to PoE networks for obvious reasons, and the component layout needs to keep in mind the ~20 MHz frequencies involved, but to get this working at all feels like quite a feat.

Normally, there’d be no reason to go to these lengths, but it’s always educational to see if it can be done and, with the current component shortages, this is another trick to keep up your sleeve for emergencies!

Putting ports where they shouldn’t belong is not a new idea, of course.  Back in the day we even shared an inadvisable ATTINY implementation of bit-banged Ethernet with no protection at all.

Thanks to [biemster] for the tip-off