Running Linux 6.11 On The ESP32-S3 With A Few Tweaks

With the Xtensa Lx7 twin CPU cores in the ESP32-S3 running at a relatively zippy 240 MHz and accompanying PSRAM of up to 16 MB, you might find yourself wondering whether it could run Linux. As [Paulneja] demonstrates with Linux kernel 6.11, the answer is a ‘yes’, though with the usual caveats.

What complicates matters with the ESP32-S3 is that it lacks certain amenities that spoiled OSes like Linux have come to take for granted, such as a Memory Management Unit (MMU). To deal with this, the NOMMU Linux configuration was used, along with a custom fork() implementation. Although the previous 0.7 version sort-of worked, the current 0.8 release is the first that manages to actually boot reliably and has a usable amount of RAM available after boot.

You can see the comparison between the two versions in the header image, with v0.8 having a blistering 3.7 MB available after booting and with overall resource usage and performance having improved massively. Note that only one core is available to Linux, with the other used by the typical FreeRTOS ESP-IDF stack to provide WiFi and Bluetooth.

This was all run on an ESP32-S3 with the N16R8 configuration, meaning 16 MB Flash that’s also used for writable storage and 8 MB of octal PSRAM. As for practical applications, it’s noted by [Paulneja] that this is a research project, though one could imagine this being an embedded Linux project along the lines of a network router running something like BusyBox.

Linux Fu: Speak Up!

Apparently, people hate typing. As every movie and TV show suggests, the future is talking to computers. There was a time when speech recognition was complex and not very good. But these days, even our lowly phones can do a pretty good job of speech recognition. Of course, one problem is that your phone probably isn’t actually doing the speech recognition. It sends it to the big business of your choice to interpret. I’ve been using Handy, a speech recognition system that works well for me. I’ve also looked at some that didn’t.

After all, it is sometimes nice to dictate to your computer, and it would be even nicer if you could keep your data local. On Windows, oddly enough, there is a well-developed speech feature that, as far as I can tell, almost no one talks about or uses. One video estimates that 99% of users don’t use it. Linux, of course, has many options, but historically, these have been difficult to set up or finicky.

Of course, the good news is that many of the Linux tools are open source and the models are quite good. That means other people have had the freedom to fork the tools and make them easier to use, at least in theory. The licensing of the models themselves may be different, but those will be hard to modify, anyway and they generally work well. The biggest problems on Linux isn’t the technology itself, but the tremendous variety of systems and setups.

Suppose you want to write a speech-to-text program. Will it work on ARM? What desktops will it integrate with? Can it use a GPU? What kind? What about specialized instructions in some CPUs? Then there’s the forced input situation; typing into arbitrary programs once you know what the user said. On X11, it is easy, but Wayland needs different handling.

A Shortcut

I’ve thought about using my phone with KDE Connect, which is an excellent program. It can let you use your phone as a keyboard and mouse for your Linux computer. Unfortunately, it is aimed at character-at-a-time input, and I’ve never found a way to make it work with voice.

Besides, the phone is beaming all the data to “the cloud.” You probably type things you’d rather not broadcast to the ether.

I had looked at Speech Note before, but it is sort of a speech recognition notepad. I didn’t find it seamless, and it didn’t work well on my system anyway. Vocalinux looks nice, but a quick test kept complaining that my Intel extensions were not available. Makes sense, since I have an AMD CPU. Even though the documentation said it should work, I was never able to get it to work.

The Easy Way

Turns out the application that worked readily on my machine was Handy. Keep in mind, Handy is just another tool that uses one of several models out there, along with other open-source tools. You might need to install some tools to deal with your system like xdotool or dotool, but they are probably already installed anyway. That isn’t to minimize the value of Handy. It is — well — Handy. You don’t have to load and configure models, set up a bunch of system-level hooks, or install a bunch of libraries. You install it, and it works.

You can configure it. The best model for you, for example, may depend on your machine and the languages you speak. You can configure the hotkeys and how the app types into your computer. But it does all the work of downloading and configuration. Continue reading “Linux Fu: Speak Up!”

Every ZX81 Expansion Card You Ever Wanted, All At Once

The Sinclair ZX81 was a masterpiece of Sir Clive’s desire to get the most out of the least hardware, being about as minimalist as it was possible to get and still be a home computer in 1981. As such it has a keyboard, a Z80, TC and cassette interfaces, 1K of memory, and that was it. There were any number of add-ons for it, but if you were a 1980s kid the chances are you couldn’t afford them. So 45 years later here’s [adam.klotblixt] with OpenSpand — every ZX81 expansion you could think of, all in one!

For a start there’s a RAM expansion. Not the paltry 16K of old, this is user-configurable and has the whole 64K address space minus the ROM to play with. Then there’s SD card storage, hijacking Sinclair BASIC’s LOAD and SAVE commands. It’s got high-res graphics, emulated sound chips, a joystick port, serial ports, a choice of ROMs, and a composite video output. Perhaps the only thing it doesn’t have from back in the day is a printer interface, but we’re sure the serial port could be pressed into service somehow.

It does this all as you might expect these days, with an RP2350 emulating the real parts. The microcontroller disables the onboard RAM and ROM and emulates those too, such is the disparity in power between it and a Z80. We would have done anything for this expansion, back in the day.

The ’81 features here quite often, most recently in a look at Sinclair’s own RAM expansion.

Fixing A Ubiquiti 16-Port PoE Switch With An Extra Hole

After saving a £300, 16-port Ubiquiti network switch from getting tossed into the trash, [Buy It Fix It] got the honor of trying to repair it. With four ports and their associated PoE function having some major issues it looked like it might take some debugging, but after taking the lid off, the cause seemed rather obvious.

One of the Broadcom BCM5911 controller chips had a rather suspicious chip of the plastic packaging missing, with additional probing of connected components showing that numerous MOSFETs and a diode having had their proverbial guts blown out and were shorted as well. Whatever happened to some connected Ethernet device would appear to have left a serious trail of damage that nearly wrecked the entire switch.

The biggest challenge here was probably to find a replacement for the Broadcom IC, as this isn’t an IC that stores like Digikey or Mouser stock any more. Fortunately it was still available for sale over at AliExpress for £1.84, with the usual caveat that it could be salvage, fake, a factory reject, etc. In this case it appears that it was a legit Broadcom IC, with the four affected ports springing back to life including powering a PoE camera.

With a total cost of about £5 plus the time invested it wasn’t a bad deal to save a pretty nice PoE switch with 16 Ethernet and 2 SFP ports.

Continue reading “Fixing A Ubiquiti 16-Port PoE Switch With An Extra Hole”

An Open Heart Rate Monitor

If you spend any time near a gym, you may be familiar with Bluetooth heart rate monitors — a small pack of electronics mounted on a strap round the chest which can relay heart rate data to an external logger or display. We’re pleased to see [Milos Rasic]’s project then, an open-source version of one of those monitors.

The heart rate capture is done by an AD8232, while the Bluetooth part is handled by a Seeed Studio XAIO ESP32 board. Power is provided by a single 3.7 V cell, with a boost converter to push that up to 5 V. The design omits a charge controller to keep things simple, so figuring out how to top off the cell is left as an exercise — no pun intended — for the user. Software is loaded through the Arduino IDE, which raises the possibility that other ESP32 CPUs could be supported with a bit of modification. All in all it’s a surprisingly simple project, and while the manufactured version is cheap enough it’s still very much worth having one that’s open source.

If you’d like to know more about his quest to develop open medical devices, check out the talk [Milos] gave on the intricacies of blood pressure monitoring earlier this year at Hackaday Europe.

Continue reading “An Open Heart Rate Monitor”

Writing An ESP32 Bluetooth Printer Driver In Two Acts

[Bas BotBerg] wanted to use a portable Bluetooth thermal printer to run off reports on sensor data collected by an ESP32-C3 microcontroller. But as is so often the case these days, the only official way to interface with the printer was through a proprietary smartphone application provided by the manufacturer. With no documentation on how the thing works, he set out to reverse engineer the printer’s communications protocol so he could control it from the MCU — but the route he took to get there was a bit different than what we usually see, and is an excellent case study for those who might have similar projects in mind.

The standard procedure for something like this, if it can be called that, is to use Android’s built-in debugging capability to log Bluetooth communications while running the manufacturer’s application. The resulting file can be fed into Wireshark, and with patience and some educated guesses, you can usually work out the various commands and values that get passed to the hardware.

But in this case, [Bas BotBerg] ignored the manufacturer’s software and instead used an application that can query a device and list its Bluetooth Low Energy services and characteristics. Specifically, he looks for services that are marked as writable, and starts pushing data into them to see how the printer responds. For this he uses Python with the Bleak library, as it allows him to rapidly iterate and adapt his code. After a bit of poking and experimentation, he finds the proper incantation to get the printer’s motor to kick on an advance the paper — a critical first milestone that tells him he’s on the right path.

Once [Bas BotBerg] mapped out what data needed to be sent to what endpoints to operate the printer in Python, it was a relatively straightforward process to send those same payloads using C++ code on the ESP32. For extra style points he also brought in the Adafruit GFX library so he could produce icons and more easily format the output of the printer.

It doesn’t look like [Bas BotBerg] has released the code in this case (perhaps if we all ask nicely), but we’ve seen similar efforts to bring open source drivers to these cheap Bluetooth printers for the good of the community.

How High-Voltage Current Transformers Monitor The Grid

Being able to monitor voltages and currents is essential for many applications, with the national electrical grid being no exception. The obvious complication here is that the voltages and currents are massively higher than for those other applications, making safely monitoring these somewhat of an engineering challenge. The used systems for current monitoring are detailed by [Jordan Taylor], also known as [The Electric Brit], in an explainer of grid-level current transformers (CTs) and associated elements that help to provide galvanic isolation for safe current measurements.

Even if the basic principles remain the same, when you’re dealing with currents of 5 kA and more, the associated clearances and penalties for getting a detail wrong increasing correspondingly. The CTs help to implement over-current protection (OCP), over-voltage protection (OVP) as well as differential protection, which is useful to detect leakage and shorts, which could also happen inside the CT if the windings become damaged.

Any such failure condition can trigger a circuit breaker to be tripped, or other corrective measures to be taken. Incidentally this is also how it can be detected when someone is tapping off power in an illicit manner. As with all transformers they’re never perfect due to issues like core saturation, and thus performing accurate measurements and picking the right type of transformer is an art in itself, as explained in the video.

Ultimately CTs and the associated equipment are what makes an AC power grid responsive to any changes and with it into the reliable foundation of modern-day society.

Continue reading “How High-Voltage Current Transformers Monitor The Grid”