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 increasingly 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 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”

A UPS For Your Pi That’s A Little Different

There are many uninterruptible power supply (UPS) solutions for the Raspberry Pi that take the form of HATs with a battery on board, but they’re not suitable for every situation. Web3-Pi are using the Pi 5 as an Ethereum node, and found the need for a UPS that didn’t sit on top of the Pi. Their solution is the Web3 Pi UPS, a device that sits in the USB power chain.

It’s a box that takes three power inputs, USB-C PD, a barrel jack, or a hot-swappable Sony camera battery, and puts out the constant 5 V at 5 A the Pi requires. The USB output isn’t just for power, it can communicate with the Pi to deliver telemetry and ask the OS to shut itself down if power reserves are failing. Inside are a CH32 RISC-V microcontroller that handles the power circuitry, and an RP2040 that handles control and an OLED screen for a UI. The project’s web site also mentions provision for an LTE add-on for remote monitoring, however this doesn’t at the time of writing appear to be fully implemented in the GitHub repository.

While it’s probable that few of you are mining Ethereum on your PI, we can see that there are plenty of other situations that this project could find a home in. It’s not the first Pi UPS we’ve seen, though some of them are considerably less complex or capable.

Continue reading “A UPS For Your Pi That’s A Little Different”

Pulse: A New VHDL Simulator

With VHDL being arguably more deterministic and bullet-proof than Verilog, it’s good to see another open source VHDL simulator joining the fray that is not a variation of ghdl. Written by [Óscar Grimal] in C++ with an MIT license, the Pulse project is a still in progress package that provides the entire toolchain, from the compiler to the requisite waveform output.

This waveform output is provided in the form of a text-based user interface (TUI), which at the very least helps a lot with making it cross-platform compatible. As dependencies only a C++20 capable compiler and CMake are indicated.

Of course, with VHDL being a rather hefty language especially once you start piling up the associated standard library, the currently supported language and library features are somewhat limited still so that you’re limited to basic IEEE packages and types, with default values are not supported yet.

Per the roadmap on the GitHub project’s Readme more VHDL language features including generics and additional types will be added, along with an enhanced simulation engine. It’s also said that mixed-language support with Verilog will be added, though SystemVerilog looks to be getting the short end of the stick as usual.

It will definitely be interesting to compare this package to ghdl.

Hackaday Europe 2026: Space Oddities

If you’re in motorsport, or maritime, or mining fields, you can always call on a technician to come down and fix something when it’s broken. You can lay hands on the parts, reconfigure things, make repairs, and get something working again. In space, that’s seldom possible. If you’re lucky enough to have a manned mission, you might be able to make some running repairs; if you’re working with an unmanned robot, probe, or satellite, your potions are altogether more limited. If you can’t find a fix, it’s game over—a particularly brutal result when huge budgets and years of work are on the line.

Janelle Wellons came down to Hackaday Europe to talk about space. More particularly, the engineering and debugging operations that keep all sorts of space programs alive. Her talk dives into some of the creative solutions engineers have had to come up with to save million-dollar missions from becoming unrecoverable boondoggles.

Continue reading “Hackaday Europe 2026: Space Oddities”

Fly Brain Connectome Used To Trade Stocks And Play Games

Recently researchers finished mapping the central nervous system (CNS) connectome of not just the female Drosophila melanogaster (i.e. fruit fly) brain, but also that of the male D. melanogaster for a comparative analysis. Here the sexually dimorphic changes turned out to induce specific mating behavior that ensures that there will only be smooching between genetically fit D. melanogaster males and females, while the rest of the connectome remained effectively the same.

Of course, with this connectome in hand it led some people to ask themselves what else one can do with this connectome graph of about 160,000 neurons other than make a fruit fly into a fruit fly. So far we have seen [Nftechie] turn this connectome into a crypto stock trader with the Stonkfly project that uses the connectome’s reward circuits to potentially make profitable trades, though [Nftechie] says that they haven’t verified yet how good a fruit fly is at trading stocks, only that it does said stonks.

Over at [PC Gamer] they summarized a number of things that people have also done, including trying to make the connectome control a game of DOOM and Beat Saber. Each game frame stimulates sensory neurons, with the generated outputs then mapped to game controls, with dopamine-producing reward circuits wired in for reinforcement learning.

Although the D. melanogaster brain is only the merest fraction of the size of the human brain, it does provide us with a glimpse of what actual artificial intelligence research may lead to, as we unravel how even a 160,000 neuron connectome is enough to make these terrors of rotting plant matter do their wonderful things.

Rosy Retrocomputing

Most of us are guilty of romanticizing the past. Do you long to be the captain of a tall ship? Just as long as you don’t mind weevils in your food, vitamin deficiencies, and death from an infection when there were no antibiotics. Want to be a medieval knight? Even worse. But surely, retrocomputing is as fun as we remember, right? Turn your computer on, and it comes up with BASIC! Ready for you to write your own programs. None of this GUI foolishness. Of course, this is just another example of rosy retrospection.

Even if you like BASIC or a similar language today, things have changed. You have a nice text editor, a fast computer, debugging tools, along with things like named functions, no line numbers, and modern control structures. None of those things were very common in the 1980s. At least, not on a hobby-grade computer.

Why am I thinking about this? Well, the Hackaday Retrocomputing Challenge is on, and it occurred to me that I wanted to work with some young students in glorious MBASIC on a CP/M machine I built and modified from a Hackaday project. Perfect, right? Many of us started that way, so why shouldn’t they?

But it quickly got old. Even a simple program gets bogged down with GOTOs and GOSUBs to mysterious line numbers. It made me remember the time back in the early 1980s, or maybe even the late 1970s, that I wrote a BASIC preprocessor to scan BASIC with no line numbers and produce proper source, converting labels to line numbers in two passes.

Continue reading “Rosy Retrocomputing”