Termux: Serial Bridge on Android
Edit on GitHubRun the Aegis-Beacon serial bridge on an Android phone with Termux and an OTG adapter, and stream positions from the field.
Termux: Serial Bridge on Android
The serial bridge is a single Python file, so it runs on Android too. With Termux (a terminal emulator) and an OTG adapter, your phone becomes the bridge: it reads the beacon over USB and pushes positions to the Report Position page, exactly like a laptop.
Install Termux
- Install Termux from F-Droid (the Play Store version is outdated).
- Open Termux and allow storage access when asked.
Install Python and pyserial
pkg update && pkg upgrade
pkg install python
pip install pyserialCopy the bridge onto the phone
Option A, clone the repo (needs git and internet):
pkg install git
git clone https://github.com/Leo-Galli/Aegis-Beacon
cd Aegis-Beacon/bridgeOption B, transfer just the script: copy aegis-serial-bridge.py into the phone’s Download folder and run it from there:
cd /sdcard/Download
python aegis-serial-bridge.pyUSB permission
Android must grant the terminal access to the USB serial device:
- Plug in the OTG adapter and beacon.
- When the “USB device connected” dialog appears, choose to open it in Termux (or grant permission in the notification).
- If nothing happens, unplug and replug; some phones require the screen on.
Find and use the port
ls /dev/ttyUSB* /dev/ttyACM* 2>/dev/nullThen run the bridge with the explicit port:
python aegis-serial-bridge.py --port /dev/ttyACM0Or, if the phone maps it elsewhere:
python aegis-serial-bridge.py --port /dev/ttyUSB0Keep the phone awake
- Disable battery optimization for Termux (Settings, Apps, Termux, Battery).
- Keep the screen on, or run with
termux-wake-lock.
Caveats
- The bridge opens the phone’s browser with the site; if the phone has no internet, it cannot open the page (positions are still parsed and printed, and you can use
--no-opento just log). - Phones that power the beacon from a weak OTG port may drop the link under load; keep the beacon on its own battery.