Doorgaan naar hoofdcontent

UHURA update 3: secure, off-grid and clear over Wi-Fi

In the previous update I wrote down a list of decisions: real encryption, finding each other without the internet, a switchboard of our own, and nothing that depends on the clock. A decision is still just a promise. This week those promises turned into code, and most of it now runs on Linux and Windows 11. And the best news: the sound is now clear over Wi-Fi too.

The UHURA window on Windows 11: status ready to listen, switchboard connected, the stations in the circle and large buttons for talking and the wellbeing call

This is what UHURA looks like now on my sister's laptop. "SB: Verbonden" means the switchboard has been reached.

Done: the secret key I promised

In the first update I admitted that Call & Listen did not use a secret key yet. That is fixed now. Every pair of boxes has its own key, and every packet of sound is encrypted on its own. If the Wi-Fi drops out for a moment, the next packet can simply be read again. To an outsider, or a firewall, every packet is pure noise. Only someone who has been added to Mum's box can open the thirty-second listening window. The "Mijn Code" at the top of the window is the fingerprint of that key; it is fine to show it.

I did this without OpenSSL, with two small C files from Monocypher. The whole Windows app is still a single file of about 955 KB.

Done: still talking when the internet is down

If the fibre in the street is cut, the attic, the living room and the shed must still reach each other. Every five seconds each box now sends a small encrypted beacon over the home network. When another box hears it, they talk to each other directly from then on. And after a power cut without internet a box may think it is 1970, but UHURA never looks at the calendar. So it does not matter.

Done: our own switchboard in Amsterdam

For calls between houses there is now our own switchboard on two servers in Amsterdam, a main one and a spare. It is one small C program that needs nothing else. The switchboard only knows that you belong to the circle; it cannot read names or conversations. A call starts straight away through the switchboard, and as soon as possible the boxes talk to each other directly. At home, everything simply runs over your own network.

Done: clear sound over Wi-Fi

On a network cable everything sounded good from the start. Over Wi-Fi we heard the odd hiccup, even though hardly anything was actually lost. Wi-Fi sends packets in little waves, and our buffer threw away packets that arrived just too late. Now we send slightly larger packets, 50 per second instead of 100, and the buffer waits a little longer and repairs itself. The result: sound over Wi-Fi is now fine.

Two lessons

A silent port thief. During the first test on the server my laptop suddenly saw nothing at all, without a single error message. A test program on the same server had quietly taken over the switchboard's port. The culprit was a setting (SO_REUSEADDR) that you switch on out of habit for TCP, but that does something completely different for UDP. Now UHURA gives a clear tip straight away when this happens.

Strange characters on the screen. The first screenshot showed "—" instead of a dash. Microsoft's standard fix did not help, because Windows ignores it when you start the program from the Linux folder (WSL). The new rule in the project: all text on the screen goes through the Unicode variant (DrawTextW). Now it is right everywhere.

Decided: Android

My sister's first question after the test was: "Can I call Mum from my phone when I don't have my laptop with me?" Soon she can. The same C core also runs on Android, without Google services in between. There will also be a backup route for networks that block UDP completely.

What's next?

The box itself. The software is ready; now Mum needs something with one big button on it: the ESP32 box with a microphone, an amplifier, buttons and lights.

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 3: veilig, zonder internet en helder over wifi

Reacties

Populaire posts van deze blog

Denon DHT T100 DESIGNED TO FAIL : bad caps (ceramic caps this time)

A friend gave me a Denon DHT-T100 to look at. Do not spend much time on it.. ok. It had a problem, it started clicking and ticking after power on, and after some time. (a so called intermittent problem) Sometimes it did not tick or click, but it was basically not usable. The clicking had a sharp click in one channel and repeated after about a second, then sound recovered and it would click and drop out again. He told me, do not spend any time on it, yeah, right. ;-) like I would give up after 15 minutes. I wanted to know what was going on with this thing, I found some schematic online and started measuring the usual things. The power supply, 24V did it drop down when a tick occurred ? Difficult to find out because sometimes the thing would play for hours without a glitch. I eventually found out the 24 V PSU, the step down SMPS on board and the LDO's were all ok, all power rails remained within spec, but it still glitched sometimes. (while power was ok) I inves...

Fixed voltage on cheap buck converter (MP1584) conversion with single 0805 resistor

Everywhere I look on the Ali and Ebays I see these step down converters based on MP1584. I bought a couple and actually they are not bad at all. The output voltage is set by the trimming-resistor in the left top corner of the picture. This works OK, but.. it is dangerous because it is rather sensitive to the touch. I decided that I wanted fixed output, so I had to figure out how this thing worked. The datasheet looks like this : R1 in the datasheet is what I call "R feedback" in my image. The value of R2 is mostly 8.2K Ohm in the boards I have seen.  So to set some common values for output voltage: change R1 to 27K for 3V3 output (actually 3.4 volt, but 27K is a standard value) or change R1 to 43K0 for 5.0 Volt output. (43 K is a standard value) A standard 0805 size resistor fits precisely, how convenient ;-). Make sure the other resistor is really 8.2K because that determines the feedback ratio. This way you can not burn up your circ...

Raspberry Pi, PyFace Digital, the lost documentation, I found it finally

The Raspberry PI or R-pi from  http://www.raspberrypi.org/  is well known these days. It is not an accident that I have one, I have been doing Linux stuff since 1991, and professionally since 1996 I can not skip over these developments, have to keep up with the new kids. :-) Times have changed, hardware has become very affordable, everybody knows the Arduino , Raspberry Pi and Beagle-Bone-Black (BBB). Not everybody knows the stuff that  http://www.acmesystems.it/  aka Acme-Systems and  https://github.com/OLIMEX/OLINUXINO  aka  Olimex make, so I will endorse them here. Since I am an engineer I expect to connect switches and relays to the boards and some documentation with products, not so with the " PiFace Digital " board, it comes without serious documentation, not a even the schematic. All links on their blog point nowhere. People asked them many times, yet nowhere is the schematic to be found. I finally found some info after hours of googl...