Listen to the blog as audio here
I’ve already written about the need for encrypted communications and encrypted communicators. However, my focus has been on communication between people – whether written, voice, video or in groups. However, for me, communication between a computer and a human – specifically me – is also an interesting topic. Back in the day, when I was doing systems administration, I needed to receive notifications that something had gone wrong.
Now I use a simple system for that, which is optimized to run on small devices (routers, NAS) and doesn’t need a complex infrastructure. I created signal-monitoring that handles this task well enough for me.
What remains to be solved is how to simply and reliably deliver notifications when the script figures out that something has gone wrong.
Other than that, I often run some longer processes (often local inference using AI) and then I leave the computer to do something else. I’d like to either know that the process has finished or ideally get the output straight away (in markdown format, for example).
We have a number of options to solve both of these problems.
Signal
We can use Signal with the signal-cli tool. I originally used it in the monitoring script, that’s why it’s called signal-monitoring. However, it has several practical problems.
The first problem is that signal-cli is in Java, and despite the dreams of the authors of this programming language, it just doesn’t run everywhere. At least not that easily. Eventually, though, I managed to get signal-cli to run everywhere, including the OpenWRT router, so I somehow overcame this problem.
The other problem is the need to create accounts and thus the need for a phone number. I’ve solved that too, but now I have to worry about anonymous prepaid SIMs, which ideally shouldn’t expire, which prepaid SIMs usually do if you don’t top them up regularly.
The third problem that made me start looking at alternatives is that Signal’s anti-spam solution sometimes requires a CAPTCHA – and I can’t rely on that from a scripting perspective. Admittedly, I haven’t needed CAPTCHA for notifications yet, but I couldn’t automate this situation well enough for me.
Matrix/Element/Matrix-commander
Another option I’ve tried is to use matrix-commander and the Matrix communication network. The downside is the need to create accounts on Matrix servers and possibly the need to run your own server. The infrastructure also depends on the specific Matrix servers.
Yet this option works very well in practice. Just creating accounts is inconvenient. If I have one router, NAS, server, laptop, then I have to have four different accounts that have to have some passwords, register somewhere, have keys, and communicate with my devices.
Matrix has had its issues with encryption key synchronization, although in this particular use-case they haven’t manifested themselves yet.
The downside is the need for Python, but I have that everywhere, including on the router, so it hasn’t practically manifested as a problem.
Telegram
Lol
LXMF
LXMF is the encrypted communication protocol of the Reticulum network. I added it mainly as a proof of concept, but for example, a notification that my internet is down can come to me over the local network (thanks to the mesh properties of the Reticulum network). The fact that I can send a message over LoRA radio over a fairly long distance is also nice for notifications about, for example, temperature, barn status, etc.
One of the fun projects I wanted to implement with this protocol is a notification that physical mail has arrived in my mailbox. A battery-powered micro device with a Lora module and a motion detector and possibly a small camera with flash.
Messages come into a communication tool like Meshchat or Sideband on mobile. If I have well connected nodes along the way, the message will find its way even if some of the infrastructure fails.
The downside is the need for Python, but I have that everywhere, including on the router, so it’s virtually nonexistent. And I don’t have that much use-case for it. I’d rather have some messenger that I use for day-to-day communication so that I notice a malfunction early – for example, the way LXMF works you need to run the app, since push notifications may not come through.
I send messages with a simple Python script.
Nostr
Nostr is relatively fine for this use case, although the reliability and stability of the relays is still questionable. Push notifications are not so reliable yet. On the other hand, you don’t need to create accounts that much (just a key pair), you can redundantly deliver messages to a couple of relays.
The downside is the lack of privacy, the metadata (who sent a message, when and to whom) is visible to everyone on the relays. There are newer standards for better privacy of messages, but they are not as well distributed yet.
Practically speaking – I usually notice incoming Nostr messages when I manually look in my messages tab, not as a notification.
BTW: I have a cool podcast episode How to fix the Internet – Nostr, Reticulum and other ideas
SimpleX
There is a CLI client for sending messages via SimpleX. The advantage is that no accounts need to be created. You start the client, type “name” and join the group using the invite link. I send messages directly to the group where also my mobile devices and laptop are members.
The downside is that if the message is not sent by the time the program finishes, SimpleX does not guarantee delivery. The program run can be extended (with the -t parameter), but even delivery in 10 seconds may not be enough, especially if it is a file. Therefore, it may be a good idea to let the program run longer (even a minute) and just send it to the background.
If the message is not sent in time, it will be sent when the client is started again (for example with plain “simplex-chat -t 20”, or when sending another message), as the message is stored in the local database before being sent.
Because it is always necessary to create connection requests for communication and explicitly accept each connection request, SimpleX does not (have to) deal with spam in any way, so there is no CAPTCHA. There is also no need to worry about keys, email addresses and accounts. This is ultimately the solution I chose (with backup via Matrix for really important notifications).
On my machines I also have functions called simplex-msg and simplex-file:
export SIMPLEX_DESTINATION="#monitoring"
function simplex-msg { (simplex-chat -t 20 -e "${SIMPLEX_DESTINATION} $*" > /dev/null &) ; }
function simplex-file { (simplex-chat -t 20 -e "/f ${SIMPLEX_DESTINATION} $*" > /dev/null &) ; }
These allow me to send a message or file from the script, no matter which server or machine I’m on. I don’t have to deal with the recipient (or group name), I have this all preconfigured already.
Simplex-chat won with me after they started publishing compiled binaries for the command-line interface. The downside is that it’s not that easy to compile this tool. And unfortunately it is not in homebrew either, so it will need to be manually updated from time to time (yes, I use homebrew as a user – not under root – even on Linux).
For backups, I use restic by the way, which is also a single standalone binary (although I also use it occasionally with rclone, which supports the pcloud backend)
Conclusion
I was looking for a simple portable messenger that works from the command-line, as easy as possible and without the need for creating accounts, registration or possible CAPTCHA. And ideally without having to run any server infrastructure or install any cumbersome frameworks (the goal is to make it work on the least powerful device possible).
Simplex has its bugs, so I don’t rely on it 100% yet, but it has a good balance of ease of use (no registrations, one simple binary, no need to run infrastructure, …), security and privacy (encryption, metadata protection).
It’s also possible to use ntfy, which is a tool for exactly what I want. But it has a few drawbacks, such as worse privacy (or having to self-host the backend – what if that one goes down?). However, it also bothers me that it’s a standalone app, I’d like to use messenger, which I already use for something anyway, so that I don’t forget to install or run it somewhere.