In the previous update I wrote: the software is ready, now Mum needs something with one big button on it. That step has started. For the first time UHURA runs on a real ESP32 board, and it taught me three lessons straight away.

The Louder-ESP32 that UHURA now runs on. Photo: Seeed Studio. My board (rev H9) has 8 MB of flash instead of the 16 MB in the photo.
First a board that already exists
Later I will design my own circuit board for Mum's box. But you don't start by soldering; you start with a board that already works. I chose the Louder-ESP32 from Sonocotta: an ESP32 with 8 MB of extra memory and a decent amplifier on board. It is the same board I use for Audio Jarvis.
I set up the software so that my own board can simply be added next to it later. Every board gets one small file with its pins and parts. The core of UHURA, the same code that runs on Linux and Windows, goes onto the ESP32 without a single copied file.
Step by step, not everything at once
It is tempting to switch on Wi-Fi, microphone, amplifier and buttons all at once. But when it crackles or hangs, you have no idea why. So I cut it into four steps. Step 1 is only this: boot, check the memory and measure whether the chip can keep up with the work. The amplifier stays off, so nothing can go bang.
Within ten minutes that small test found three problems that would otherwise have cost hours of searching.
Three hidden bombs
A firmware that was 98 KB too fat. I had given the sound buffers a label to make sure they stayed in the fast internal memory. That label turned out to put them into the firmware as empty data as well. Without the label the linker gets it right by itself, and the firmware became 98 KB smaller.
A sound codec that quietly ate the stack. The Opus codec never asks for memory, but it does put its temporary work on the stack, in a way my project rules forbid. Now Opus gets its own fixed workspace in the extra memory. And if it ever does ask for memory, the program stops at once. That way I know for sure it never happens.
Too slow. With the PC settings the ESP32 needed 33 milliseconds for a 20-millisecond piece of sound. That obviously doesn't work. With a setting meant for speech on a small chip, and faster flash memory, sending now takes 12 ms and receiving 3.5 ms. Well in time, and the box still talks to the laptops as before.
The board knows where its power comes from
A nice detail: the board measures its own supply voltage. On just a USB cable it cannot get enough current for the amplifier at full power. The board sees that by itself and will limit the volume to 25%. On a 12 V adapter it may play loud. For Mum that is exactly right: loud where it can be, safe where it must be.
How much data does it use?
I also worked out how much data UHURA uses when a box stays online through a 4G SIM card. At rest, when nobody talks, it is 165 to 240 MB per month for a circle of three stations. One minute of talking costs about half a megabyte. A cheap 500 MB-per-month SIM is plenty.
What's next?
Step 2: switch the amplifier on in exactly the right order, so there is no pop from the speaker, and play the first UHURA chime. Then come the buttons and the microphone, and then this board will talk to my sister's laptop and mine.
All designs are in the docs folder of chat-l18l/uhura_intercom. You can also follow UHURA on Elektor Labs.
This article is part of the series Building with AI agents: projects I build together with AI agents. That link takes you to every part of the series, including new ones.
Lees dit artikel in het Nederlands: UHURA-update 4: het eerste echte kastje komt tot leven
Reacties