New Part Day: An Open Source Ethernet Switch In The Palm Of Your Hand

When you can get a WiFi-enabled microcontroller for $3, it’s little surprise that many of the projects we see these days have ditched Ethernet. But the days of wired networking are far from over, and there’s still plenty of hardware out there that can benefit from being plugged in. But putting an Ethernet network into your project requires a switch, and that means yet another piece of hardware that needs to get crammed into the build.

Seeing the need for a small and lightweight Ethernet switch, BotBlox has developed the SwitchBlox. This 45 mm square board has everything you need to build a five device wired network, and nothing you don’t. Gone are the bulky RJ45 jacks and rows of blinkenlights, they won’t do you any good on the inside of a robot’s chassis. But that’s not to say it’s a bare bones experience, either. The diminutive switch features automatic crossover, support for input voltages from 7 V all the way up to 40 V, and management functions accessible over SPI.

If you want to get up and running as quickly as possible, a fully assembled SwitchBlox is available to purchase directly from BotBlox for £149.00. But if you’re not in any particular rush and interested in saving on cost, you can spin up your own version of the Creative Commons licensed board. The C++ management firmware and Python management GUI isn’t ready for prime time just yet, but you’ll be able to build a “dumb” version of the switch with the provided KiCad design files.

The published schematic in their repo uses a Microchip KSZ8895MQXCA as the Ethernet controller, with a Pulse HX1344NL supplying the magnetics for all the ports in a single surface mount package. Interestingly, the two images that BotBlox shows on their product page include different part numbers like H1102FNL and PT61017PEL for the magnetics, and the Pulse H1164NL for the Ethernet controller.

Make Networks Wired Again

There’s no question that WiFi has dramatically changed the way we connect devices. In fact, there’s an excellent chance you’re currently reading these words from a device that doesn’t even have the capability to connect to a wired network. If you’re looking to connect a device to the Internet quickly, it’s tough to beat.

But WiFi certainly isn’t perfect. For one, you have to contend with issues that are inherent to wireless communications such as high latency and susceptibility to interference. There’s also the logistical issues involved in making that initial connection since you need to specify an Access Point and (hopefully) an encryption key. In comparison, Ethernet will give you consistent performance in more or less any environment, and configuration is usually as simple as plugging in the cable and letting DHCP sort the rest out.

Unfortunately, that whole “plugging in” part can get tricky. Given their size, putting an Ethernet switch into your project to act as an internal bus only works if you’ve got space to burn and weight is of little concern. So as appealing as it might be to build a network into your robot to connect the Raspberry Pi, motor controllers, cameras, etc, it’s rarely been practical.

This little switch could change that, and the fact it’s released under an open source license means hackers and makers will be free to integrate it into their designs. With the addition of an open source management firmware, this device has some truly fascinating potential. When combined with a single board computer or suitably powerful microcontroller, you have the makings of a fully open source home router; something that the privacy and security minded among us have been dreaming of for years.

MQTT And The Internet Of Conference Badges

Today, nearly every modern consumer device wants to connect to the Internet for some reason. From your garage door opener to each individual smart bulb, the Internet of Things has arrived in full force. But the same can’t be said for most of our beloved conference badges. Wanting to explore the concept a bit, [Ayan Pahwa] set out to create his own MQTT-connected badge that he’s calling CloudBadge.

As this was more of a software experiment, all of the hardware is off-the-shelf. The badge itself is an Adafruit PyBadge, which doesn’t normally have any networking capabilities, but does feature a Feather-compatible header on the back. To that [Ayan] added a AirLift FeatherWing which allows him to use the ESP32 as a co-processor. He also added a strip of NeoPixel LEDs to the lanyard, though those could certainly be left off if you’re not looking to call quite so much attention to yourself.

The rest was just a matter of software. [Ayan] came up with some code that uses the combined hardware of the PyPadge and ESP32 to connect to via MQTT. Once connected, the user is able to change the name that displays on the screen and the colors of the RGB LEDs through the cloud service. If you used something like this for an actual conference badge, the concept could easily be expanded to do things like flashing the badge’s LEDs when a talk the wearer wanted to see is about to start.

The modern conference badge has come a long way from simple blinking LEDs, offering challenges that you’ll likely still be working on long after the event wraps up. Concerns over security and the challenge of maintaining the necessary infrastructure during the event usually means they don’t include networking features, but projects like CloudBadge show the idea certainly has merit.

Continue reading “MQTT And The Internet Of Conference Badges”

Introducing The First Cisco Certified Mixologist

You’d be hard pressed to find an IT back office that doesn’t have a few Cisco routers or switches laying around and collecting dust. We’d even bet there are a decent number of people reading this post right now that have a stack of them within arm’s reach. They’re the kind of thing most of us have no practical application for, but we still can’t bear to throw away. But it looks like [Sven Tantau] has found an ideal middle ground: rather than junk his Cisco Catalyst switches, he turned them into automatic bartenders.

Inspired by all those perfect little square openings on the front, [Sven] loaded each switch with a whopping 24 peristaltic pumps, one for each Ethernet port. To fit all his plumbing inside, the switches were naturally gutted to the point of being hollow shells of their former selves, although he does mention that their original power supplies proved useful for keeping two dozen power-hungry motors well fed.

The motors are connected to banks of relays, which in turn are thrown by an ESP32 and an Arduino Nano. [Sven] explains that he wasn’t sure if the ESP32 could fire off the relays with its 3 V output, so he decided to just use an Arduino which he already knew could handle the task. The two microcontrollers work in conjunction, with a web interface on the ESP32 ultimately sending I2C commands to the Arduino when it’s time to get the pumps spinning.

[Sven] mentions his robotic bartenders were a hit at the 2019 Chaos Communication Camp, where we know for a fact the computer-controlled alcohol was flowing freely. Of course, if you don’t intend on carrying your barbot around to hacker camps, you can afford to make it look a bit swankier.

Continue reading “Introducing The First Cisco Certified Mixologist”

Doing 10 Gigabit Networking At Home, The Cheap Way

For the vast majority of us, Gigabit Ethernet is more than enough for daily tasks. The occasional big network file transfer might drag a little, but it’s rare to fall short of bandwidth when you’re hooked up over Cat 6. [Brian] has a thirst for saturating network links, however, and decided only 10 Gigabit Ethernet would do.

Already being the owner of a Gigabit Ethernet network at home, [Brian] found that he was now regularly able to saturate the links with his existing hardware. With a desire to run intensive virtual machines on his existing NAS without causing bandwidth issues, it was time for an upgrade. Unfortunately, the cost of rewiring the existing home network to Cat 6 and procuring hardware that could run 10 Gigabit Ethernet over copper twisted pair was prohibitively expensive.

It’s a little ungainly, but it does the job.

Instead, [Brian] decided to reduce the scope to connecting just 3 machines. Switches were prohibitively expensive, so each computer was fitted with twin 10 Gigabit interfaces, such that it could talk to the two other computers. Rather than rely on twisted pair, the interfaces chosen use the SFP+ standard, in which the network cable accepts electrical signals from the interface, and contains a fiber optic transciever.

[Brian] was able to get the 3 computers networked for just $120, with parts sourced from eBay. It’s an approach that doesn’t scale well; larger setups would be much better served by using a switch and a less zany network topology. But for [Brian], it works just fine, and allows his NAS to outperform a 15,000 RPM server hard disk as far as read rates go.

If you’re curious about improving your own network performance, it might pay to look at your cables first – things are not always as they seem.

Exploring The Dell N1108T-ON Ethernet Switch

In an era where everything seems to be getting “smarter” every year, it will probably come as no surprise to find that even relatively middling networking hardware is now packing advanced features and considerable computational power. A case in point is the Dell N1108T-ON Ethernet switch. Despite only costing around $100 USD on the second hand market, [Ben Cox] discovered this particular switch was capable of a lot more than what was advertised by poking around its onboard operating system.

It all started by plugging into the serial port on the front of the switch, which [Ben] happily notes is an integrated FTDI USB serial adapter to make life easy. Booting into recovery mode gave him local shell access, and some poking around determines it’s the sort of BusyBox-powered Linux system that you’d expect on an embedded device. The biggest discoveries were that it was running a relatively recent kernel (3.8.1), and that it apparently had Python installed.

The reverse shell Python script

From there, [Ben] found out that these switches have a feature where the administrator can install and run Python “applications” by packaging them up as tarballs and copying them from a USB flash drive. So he wrote up a simple Python program that used the socket library to open up a reverse shell to his desktop computer, and to his surprise, it worked perfectly on the first try. Now with root access, the fun really started.

The next step was getting an SSH installed and running on the switch, so that he didn’t have to do the reverse shell trick every time. He then started installing the packages necessary to turn the switch into a secure VPN tunnel with Wireguard. This took a little fiddling as [Ben] didn’t have the option of installing the normal Wireguard kernel module, but he eventually got the necessary tools modified and cross-compiled to ARM. He believes this is just the start of what’s capable on devices like this, and we’re interested in seeing where the community goes from here.

We’ve seen hackers add management capability to a “dumb” unmanaged switch in the past, but software modifications like this promise to make the creation of custom, secure, networks far easier even on a hacker’s budget. A lot has certainly changed since the last time we saw somebody really dive into a professional Ethernet switch.

Cheap Power Over Ethernet For The ESP32

While most projects we see with the ESP32 make use of its considerable wireless capabilities, the chip can be connected to the wired network easily enough should you have the desire to do so. [Steve] liked the idea of putting his ESP32s on the wired network, but found the need for a secondary power connection burdensome. So he took it upon himself to modify some cheap Power Over Ethernet (PoE) hardware and create a single-cable solution (Google Translate).

[Steve] bought a PoE module intended for security cameras and ran a close eye over the board to figure out what kind of hardware it was using to generate the nominal 12 V output. He identified an MP2494 step-down converter, and with the datasheet in hand found how the output voltage is configured by changing the values of resistors in the circuit. Swapping out the stock 21.5 kΩ resistor for a 57.1 kΩ one changed the output of the converter to the 5 V necessary for his electronics.

But of course that was only half of the problem solved; he still had to connect the Ethernet side of the PoE device to the Waveshare LAN8720 board that’s providing Ethernet for the ESP32. So he removed the RJ45 jack from the LAN8720 completely, and wired that directly to the connector on the PoE board. Helpfully, the PoE board had all the pins labeled on the bottom side so this wasn’t nearly as tricky to figure out as you might expect (if only it was always that easy).

We’ve previously covered the Waveshare LAN8720 board for anyone who’s interested in the ins and outs of getting their ESP32 talking Ethernet. If you’re wondering how you can put PoE to work for you, our very own [Jonathan Bennett] has been showing off his home Raspberry Pi infrastructure which makes extensive use of the new PoE hat.

Jittery Back Off To Speed Up

In systems where there are multiple participants who need to interact with a shared resource some sort of concurrency protection is usually appropriate. The obvious technique is to use locking (and fun words like “mutex”) but this adds a constant performance hit as every participant needs to spend time interacting with the lock regardless of the number of other participants. It turns out this is actually a Big Problem that garners original research, but there are techniques that can yield great effect without a PhD. Years ago [Marc] posted a great walkthrough of one such method, exponential backoff with jitter, to Amazon’s AWS blog which is a great introduction to one such solution.

The blog post was written specifically to deal systems using a specific technique called optimistic concurrency control (OCC) but that doesn’t mean the advice isn’t generally applicable. OCC refers to a method where each writer checks for a write collision only after performing the write (but before committing it), which works well in scenarios where writes are relatively uncommon. [Marc] observed that even in systems where this is a safe assumption things bog down significantly when there are too many writers clamoring for attention all at once.

The traditional solution to such a problem is for each writer to pause for an exponentially increasing amount of time before trying again, but as writers come back in big groups the same problem can recur. He provides a discussion of simple modifications to that strategy which result in significantly reduced wait times for writers.

Problems like this are not especially relevant for single Arduino sensor networks, but even small groups of systems can have concurrency trouble and it’s nice to see such an accessible write up with solutions which are viable even for simple systems. Bonus points to [Marc] for posting source to his test tool online. It doesn’t require anything outside of your computer to run (no AWS required) so if you have any brainwaves about speeding up multi-writer environments it might make a nice test environment! Maybe don’t mention the blog post in your PhD applications though.