Andreas Spiess' LoRa Mailbox Notifier Uses a Smart Bidirectional ARQ System for Reliability
Powered by a Microchip ATtiny1614 and an Espressif ESP32, this point-to-point protocol ensures notifications get through in any weather.
Maker Andreas Spiess has built a bidirectional Home Assistant-compatible mailbox notifier with a long-range wireless transmission system — thanks to a pair of LoRa transceivers connected to a Microchip ATtiny1614 at one end and an Espressif ESP32 at the other.
"I want to build a long-range bidirectional mailbox notifier," Spiess explains of the project. "Currently, my mailbox notifier uses LoRaWAN and The Things Network. Recently, it has become less reliable than in the past […] because LoRaWAN uses the 'aloha' or 'transmit and forget' principle. IT works excellently with sensors. If a value does not get through, the following one will. That is not what I want for my mailbox notifier because it only transmits data if it reaches a new state."
While one possible solution would be to have the notifier constantly transmit its state, that's not an ideal scenario for a battery-powered device — so Spiess set about replacing the wireless link with a simple point-to-point link, still using LoRa, with a bidirectional "automatic repeat request" or "ARQ" implementation.
"Two switches can wake the battery-powered MCU [microcontroller unit]," Spiess explains. "Both start the LoRa module, which transfers the appropriate 'EMPTY' or 'FULL' [message] wirelessly. The receiver, or gateway, acknowledges the received code by transmitting an 'acknowledgement' code. It also creates an MQTT message with the current mailbox status. The gateway is mains-powered and connected to Wi-Fi. The mailbox notifier re-transmits its message until it is confirmed."
Using this system — with a low-power Microchip ATtiny1614 at the mailbox end and a Wi-Fi-equipped Espressif ESP32 as the gateway — Spiess gets guaranteed notifications even when the signal is temporarily blocked, without constant polling. The MQTT message, meanwhile, can trigger automations in Home Assistant, delivering the highly-integrated and robust mail-delivery notification system Spiess had hoped for.
The project is documented in full in the video embedded above and on Spiess' YouTube channel; the source code has been published to GitHub under the permissive MIT license.