Enabling Ethernet On The ESP32

The ESP32 is the latest and greatest wonderchip from Espressif. It’s a 32-bit, dual-core chip with WiFi, Bluetooth, and tons of peripherals such as CAN and Ethernet. For most of these peripherals, Espressif already has a few bits of example code, but [Frank Sautter] didn’t like the Ethernet implementation. The ‘stock’ code calls for a TLK110 Ethernet PHY, but that’s an expensive chip when bought in quantity one. A better chip would be the LAN8720, so [Frank] built a board to enable Ethernet on the ESP32 with this chip.

The ESP32 only needs a few components to wire it into an Ethernet network. Just a few resistors, capacitors, and an RJ45 jack will take care of most of the work, but because he’s taking the Ethernet ‘shield’ route, he needs to add his own Ethernet PHY. The Waveshare LAN8720 is the chip for this, but there’s an issue with the pin configuration of the ESP32. GPIO0 on the ESP32 has two functions — the first is pulling it low during startup for serial programming, and the second is the clock input for the EMAC function block. Some bit of circuitry must be devised to allow for both conditions to enable Ethernet on the ESP32.

[Frank]’s solution is to add a few pull-up and pull-down resistors to a breakout board, and use an unused GPIO pin to switch GPIO0 high during startup, but allows a crystal to grab it a bit later. It’s a hack, certainly, but it does allow for some much cheaper chips to be used to give the ESP32 Ethernet.

Raspberry Pi 3 Gets USB, Ethernet Boot

The Raspberry Pi is a great computer, even if it doesn’t have SATA. For those of us who have lost a few SD cards to the inevitable corruption that comes from not shutting a Pi down properly, here’s something for you: USB Mass Storage Booting for the Raspberry Pi 3.

For the Raspberry Pi 1, 2, Compute Module, and Zero, there are two boot modes – SD boot, and USB Device boot, with USB Device boot only found on the Compute Module. [Gordon] over at the Raspberry Pi foundation spent a lot of time working on the Broadcom 2837 used in the Raspberry Pi 3, and found enough space in 32 kB to include SD boot, eMMC boot, SPI boot, NAND flash, FAT filesystem, GUID and MBR partitions, USB device, USB host, Ethernet device, and mass storage device support. You can now boot the Raspberry Pi 3 from just about anything.

The documentation for these new boot modes goes over the process of how to put an image on a USB thumb drive. It’s not too terribly different from the process of putting an image on an SD card, and the process will be streamlined somewhat in the next release of rpi-update. Some USB thumb drives do not work, but as long as you stick with a Sandisk or Samsung, you should be okay.

More interesting than USB booting is the ability for the Pi 3 to boot over the network. Booting over a network is nothing new – the Apple II could do it uphill both ways in the snow, but the most common use for the Pi is a dumb media player that connects to all your movies on network storage. With network booting, you can easily throw a Pi on a second TV and play all that media in a second room. Check out the network booting tutorial here.

Ethernet Controller Discovered In The ESP8266

The venerable ESP8266 has rocked the Internet of Things world. Originally little more than a curious $3 WiFi-to-serial bridge, bit by bit, the true power of the ESP has become known, fully programmable, with a treasure trove of peripherals it seemed that the list of things the ESP couldn’t do was short. On that list, at least until today was Ethernet.

No, despite the misleading title, the ESP does not have a MAC and/or PHY, but what it does have is an incredible 80 MHz DMA-able shift register which can be used to communicate 10BASE-T Ethernet using a new project, espthernet. Join me after the break for video proof, and a deep dive into how this is possible.

Continue reading “Ethernet Controller Discovered In The ESP8266”

Gigabit Ethernet Through The Air

There are a couple of really great things about transmitting data using light as the carrier. It can be focused so that it doesn’t spill all over the neighborhood like radio signals do — giving it both some security against eavesdropping and preventing one signal from stepping on another’s toes. And while you can modulate radio signals up nearly to the carrier frequency, the few gigahertz we normally use for radio just won’t cut it for really high bit rates. Light gets you terahertz.

The Koruza project is an open-source, “inexpensive” system that aims to transmit 1 Gb/sec over distances around 100 meters, using modulated infrared light. The intended use-case is urban building-to-building communication at speeds that would otherwise require laying fiber-optic cables. Indeed, the system piggy-backs on existing fiber-optic equipment to get the job done, but the hard part is aligning the units to get maximum signal from point A to point B.

koruza-spec-info

Koruza does this by including motorized lenses on the 3D-printed chassis. You make a rough alignment with a visible green laser, and then fine-tune the IR beams from a web console where you get immediate feedback on how the received signal strength is changing. Both Koruza boxes have a Raspberry Pi inside and use normal networking for calibration and signal-strength statistics. It’s a really neat system, and it’s fully DIY’able except for the commodity fiber-optic bits.

We’ve always had a soft-spot in our heart for transmitting data over light beams. The Ronja project has been doing so since 2001, and over longer distances, with completely DIY hardware, if at a slower bitrate. And now that Li-Fi seems to be getting traction, we might see an unfocused equivalent running inside our homes.

Thanks [Pavel] for the tip!

Giving The Pi Zero USB, Ethernet, And Serial Over USB

Just as the USB port on your phone can serve as a serial connection, mass storage device, and a network connection, the Pi Zero can do the same. We’ve seen a few people turn the Zero into a single USB gadget, but what about turning the Zero into a USB HID device, network connection, and serial port all at the same time? That’s what [Tobias] did, and his method is even easier than the old one.

The old method of turning the Pi Zero into a USB device required the user to modify and recompile the kernel. Obviously, this isn’t an ideal solution. [Tobias]’ implementation fixes this by putting everything into userland. Everything is configurable through a script and a few tweaks to how the Pi starts up.

The result is a Raspberry Pi Zero that will appear as any USB peripheral. [Tobias] goes through the usual examples: setting the Pi up as a serial device for hacking and code cracking in a terminal, as an Ethernet device to give the Pi Zero networking capabilities, as a keyboard to send keypresses to another computer, and as a mass storage device so that other computers can read a small portion of the Pi’s SD card.

There are plenty more USB gadgets the Pi can emulate, from printers to audio devices to MIDI adapters to webcams. If you can wrap your head around what a Pi Zero could do when configured as one of these devices, drop a note in the comments.

Is Your Cat 6 Ethernet Cable Cat 6? Probably Not.

Though we’ve never used their cables, [Blue Jeans Cable] out of Seattle, WA sure does seem to take the black art of cable manufacture seriously. When they read the Cat 6 specification, they knew they couldn’t just keep building the cables the way they used to. So they did some research and purchased a Fluke certification tester for a measly 12,000 US dollars. While they were purchasing the device, they ran across an interesting tidbit in the fluke knowledge base. Fluke said that 80% of the consumer Cat 6 cables they tested didn’t begin to meet the Cat 6 specification.

This is the part where [Blue Jeans Cable] earns our respect; like good scientists, they set out to replicate Fluke’s results. Sure enough, 80% of the Cat 6 cables they tested from big box stores etc. failed the specification. More surprising, many of them didn’t even pass the Cat 5e specification. [Blue Jeans Cable] asserts that this is possible because the Ethernet cable specification is policed via the honor system, allowing manufacturers to be fairly brazen about what they label as Cat 6.

Zedboard Multiport Ethernet

The Zedboard uses Xilinx’s Zynq, which is a combination ARM CPU and FPGA. [Jeff Johnson] recently posted an excellent two-part tutorial covering using a Zedboard with multiple Ethernet ports. The lwIP (light-weight Internet Protocol) stack takes care of the software end.

Vivado is Xilinx’s software for configuring the Zynq (among other chips), and the tutorial shows you how to use it. The Ethernet PHY is an FPGA Mezzanine Card (FMC) with four ports that is commercially available. The project uses VHDL, but there is no VHDL coding involved, just the use of canned components.

The real issue when using an FPGA and a CPU is the interface between the processor and the FPGA circuitry. In this case, the ARM standard AXI bus does this task, and the Ethernet component properly interfaces to that bus. The IP application in the second part of the post is an echo server.

We’ve seen the Zynq used in flying machines and also in a music synthesizer. Although this project doesn’t use any Verilog or VHDL that you create, it is still a great example of configuring using Vivado and using common components in a design.