lqml/examples/meshtastic
2023-10-10 14:45:06 +02:00
..
build add new example 'meshtastic' (WIP!) -- just a proof of concept version 2023-06-03 12:57:59 +02:00
build-android revisions 2023-09-05 22:38:18 +02:00
build-ios add new example 'meshtastic' (WIP!) -- just a proof of concept version 2023-06-03 12:57:59 +02:00
cpp several fixes and improvements for SailfishOS install 2023-10-10 14:45:06 +02:00
hacks revisions 2023-09-23 17:44:26 +02:00
hardware revisions 2023-10-08 15:44:19 +02:00
i18n add new example 'meshtastic' (WIP!) -- just a proof of concept version 2023-06-03 12:57:59 +02:00
lisp example 'meshtastic': remove explicit call of 'qml:hex' (now obsolete) 2023-10-03 19:26:40 +02:00
platforms revisions 2023-08-31 08:42:31 +02:00
qml revisions 2023-10-08 15:44:19 +02:00
.gitignore example 'meshtastic', add iOS version, background ini, startup animation 2023-06-06 11:37:12 +02:00
app.asd example 'meshtastic': add backup function on desktop; revisions 2023-08-27 18:08:38 +02:00
app.pro SailfishOS fixes and docu 2023-10-09 22:32:58 +02:00
make.lisp fix for SailfishOS 2023-10-09 11:20:42 +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': make map (tile download) work on Windows 2023-08-17 08:51:44 +02:00
readme-usage.md example 'meshtastic': hourglass animation; revisions 2023-09-16 13:56:52 +02:00
readme.md revisions 2023-09-23 17:44:26 +02:00
run.lisp example 'meshtastic': add backup function on desktop; revisions 2023-08-27 18:08:38 +02:00

Info

Please note that this is WIP/experimental.

The 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).

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 animation is shown while loading the app, together with a counter (for older and slow mobile devices). 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.

The macOS version must be compiled first, moved to /Applications/ and started from Finder (not the console), otherwise BLE permissions will not work (if run from console, the app will show a BLE exception and consume 100% CPU).

TODO: SailfishOS, using the Qt5.15 port (that is, SailfishOS using Qt5.6, with additional Qt5.15 installed).

How to use cl-meshtastic

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 unpair your radio from current device
  • try to turn bluetooth off and on again
  • try to reboot your radio

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

See also readme-usage.

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).