lqml/examples/meshtastic
2025-05-08 11:42:44 +02:00
..
build add new example 'meshtastic' (WIP!) -- just a proof of concept version 2023-06-03 12:57:59 +02:00
build-android example 'meshtastic': add USB mode for android (tested with RAK, T-Beam) 2024-05-15 13:18:35 +02:00
build-ios add new example 'meshtastic' (WIP!) -- just a proof of concept version 2023-06-03 12:57:59 +02:00
cpp revisions 2025-03-24 18:37:52 +01:00
hacks example 'meshtastic': add USB mode for android (tested with RAK, T-Beam) 2024-05-15 13:18:35 +02:00
hardware add Qt6 version of some examples (see below); revisions 2024-10-22 13:27:56 +02:00
i18n add new example 'meshtastic' (WIP!) -- just a proof of concept version 2023-06-03 12:57:59 +02:00
lisp revisions 2025-03-24 18:37:52 +01:00
platforms update examples 'cl-repl', 'meshtastic' for android 14 2024-09-19 12:14:47 +02:00
qml revisions 2024-07-25 10:14:01 +02:00
.gitignore example 'meshtastic', add iOS version, background ini, startup animation 2023-06-06 11:37:12 +02:00
app.asd revisions 2023-10-13 10:52:27 +02:00
app.pro revisions regarding iOS and latest Xcode 2024-12-25 18:33:25 +01:00
make.lisp revision: remove redundant #-interpreter, use #-ecl-bytecmp instead 2025-05-08 11:42:44 +02:00
mkdirs.sh add new example 'meshtastic' (WIP!) -- just a proof of concept version 2023-06-03 12:57:59 +02:00
my-cl-protobufs.asd example 'meshtastic': fix for Windows; revisions 2023-08-14 13:53:58 +02:00
ql-libs.lisp add new example 'meshtastic' (WIP!) -- just a proof of concept version 2023-06-03 12:57:59 +02:00
readme-build.md example 'meshtastic': add android background service for BLE 2024-02-23 15:04:10 +01:00
readme-usage.md revisions 2024-05-15 17:41:33 +02:00
readme.md example 'meshtastic': add USB support for LilyGO T-Deck 2024-06-01 09:03:05 +02:00
run.lisp example 'meshtastic': add backup function on desktop; revisions 2023-08-27 18:08:38 +02:00

Info

An APK (android) can be found here: meshtastic.apk

This simple app can either send direct messages between the radios, or broadcast messages (received by all radios).

It's basically meant to be used in an emergency situation, where internet is not available, in order to communicate with short text messages. This kind of mesh network is limited to about 70 nodes/radios/users to remain reliable.

Technical notes

You'll probably need to rebuild the lqml library, this app requires the latest version.

The app uses both BLE (bluetooth low energy) and the protobufs serialization library version 3.

For BLE you need to build the plugin in cpp/ first (written in Qt5/Qt6).

The cl-protobufs library is included here because the official version doesn't work without the C++ plugin installed (which we don't need here). So I made some small adaptions and included all generated proto Lisp files in order to be independent.

Unfortunately the generated and C compiled meshtastic proto files load very slowly on mobile. To improve load time, meshtastic proto files are simply loaded as *.lisp source files, which doesn't seem to impact performance at runtime (in this use case).

An hourglass animation is shown while loading the app. For this to work, the app is loaded in the background (that is, in a separate thread).

You will see a json output of all data sent/received. It simply uses the print-json convenience function from cl-protobufs.

The message db uses sqlite, but in a lispy manner, storing basically just a plist for every message.

The reason I chose Qt qsqlite over cl-sqlite is mobile: Qt comes with its own version, which is pulled in automatically, so one doesn't need to care about OS limitations or indirect requirements.

Tested

Tested on Linux, macOS, Windows 10+, android, iOS, SailfishOS.

The macOS version must be built with Qt6 (Qt5 has a buggy BLE implementation), and compiled first (see build/). So, you'll need to rebuild lqml using Qt6, and replace qml/ with ../meshtastic-qt6/qml/.

The iOS version also runs on older devices, like the 'iPod touch', as long as they are 64 bit and run at least iOS 12.

How to use cl-meshtastic

Bluetooth

The most universal connection type is BLE (Bluetooth Low Energy), which should work everywhere.

Your radio needs to be turned on and bluetooth needs to be enabled before you start the app.

On android coarse location permission is required for BLE to work.

Except for Windows, pairing of your LoRa radios is generally not needed beforehand, the app will ask for pairing/PIN during BLE ini. If your device doesn't have a display, use 123456 as your PIN.

On Windows it didn't work for me if not paired previously.

It may occur that your radio device is sometimes not found; some suggestions:

  • try to disable the radio in any other app that used it previously
  • try to unpair your radio from current device
  • reboot your radio (turn off/on)
  • press-and-hold on the radio icon to restart device discovery

A generic bluetooth app like nRF Connect may help in order to see if the devices themselves work and are able to connect.

USB

If you have your radio connected to your PC via USB, you can also choose 'USB' as connection type from the main menu (see 'Radios' icon). This works on Linux, macOS, (Windows not tested yet) and android. RAK devices won't need any additional driver, just permission to e.g. /dev/ttyACM0 (Linux). Other radios (ESP32 based) require addtional serial drivers to be installed, see official Meshtastic website.

Notes for android: tested with RAK and T-Beam. The app will launch as soon as a radio is attached to USB. You need to confirm a dialog, which will also grant USB permission.

WiFi

If you have a radio with intgrated WiFi (like LilyGO T-Beam, Heltec v3), you can setup your WiFi connection using the Python CLI:

meshtastic \
--set network.wifi_enabled true \
--set network.wifi_ssid "<name>" \
--set network.wifi_psk "<password>"

You should now be able to see the IP of your WiFi connected radio on it's small display (use the user button to switch to the WiFi page). The app will ask for the IP if not entered yet, or if it has changed.

See also readme-usage.

Emojis (Linux/SailfishOS)

See emojis-howto.

Build

Please apply hacks before trying to build.

On iOS see also note in upload-download.lisp regarding function read-sequence, which needs to be replaced in the Quicklisp zip library.

Run

lqml run.lisp

Optionally pass -slime to start a Swank server, and connect from Emacs with M-x slime-connect.

During development you can pass -auto, which will reload all QML files after you made a change to any of them and saved it. For re-initialization after reloading, file lisp/qml-reload/on-reloaded will be loaded.

Closing the window quits the app. If you try to kill it with ctrl-c, you need an additional ctrl-d to exit from ECL. To quit from Slime, do (qq) which is short for (qquit).

Hardware example

See radio for a simple radio example and some basics you should know about antennas.