From 00375ff3f486bf6eac2350f037741cef00c7bb67 Mon Sep 17 00:00:00 2001 From: "pls.153" Date: Mon, 14 Aug 2023 13:53:58 +0200 Subject: [PATCH] example 'meshtastic': fix for Windows; revisions --- examples/meshtastic/cpp/tile_provider.h | 2 +- examples/meshtastic/lisp/cl-protobufs/json.lisp | 2 ++ examples/meshtastic/lisp/lora.lisp | 2 +- examples/meshtastic/my-cl-protobufs.asd | 1 + examples/meshtastic/readme-usage.md | 13 ++++++++----- examples/meshtastic/readme.md | 12 ++++++------ 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/examples/meshtastic/cpp/tile_provider.h b/examples/meshtastic/cpp/tile_provider.h index 22e2932..04cf97e 100644 --- a/examples/meshtastic/cpp/tile_provider.h +++ b/examples/meshtastic/cpp/tile_provider.h @@ -13,7 +13,7 @@ class TileProvider : public QTcpServer { public: TileProvider(int port = 0, QObject* parent = nullptr) : QTcpServer(parent) { listen(QHostAddress::Any, port); - qDebug() << "tile server started at IP" << serverAddress() << "port" << serverPort(); + qDebug() << "tile provider started at IP" << serverAddress() << "port" << serverPort(); } void incomingConnection(qintptr socket) override { diff --git a/examples/meshtastic/lisp/cl-protobufs/json.lisp b/examples/meshtastic/lisp/cl-protobufs/json.lisp index 1aaa4b2..e36ba37 100644 --- a/examples/meshtastic/lisp/cl-protobufs/json.lisp +++ b/examples/meshtastic/lisp/cl-protobufs/json.lisp @@ -473,6 +473,7 @@ PRINT-JSON-IMPL for any types." (print-json-impl packed-message indent stream camel-case-p numeric-enums-p t)))) ((google:timestamp) + #-os-windows (let* ((nsec (google:timestamp.nanos object)) (timestamp (local-time:unix-to-timestamp (google:timestamp.seconds object) @@ -567,6 +568,7 @@ calls to PARSE-JSON-IMPL." (wkt:pack-any ret))))) ((google:timestamp) + #-os-windows (let* ((timestring (pi::parse-string stream)) (timestamp (local-time:parse-rfc3339-timestring timestring))) (google:make-timestamp diff --git a/examples/meshtastic/lisp/lora.lisp b/examples/meshtastic/lisp/lora.lisp index c3b8973..d912ede 100644 --- a/examples/meshtastic/lisp/lora.lisp +++ b/examples/meshtastic/lisp/lora.lisp @@ -92,7 +92,7 @@ (start-swank) (clear)) #+mobile - ((string= ":w" text) ; for saving/restoring message DB and settings + ((string= ":w" text) ; for saving/restoring message DB, settings, map tiles (s-http-server:start) (clear)) #+mobile diff --git a/examples/meshtastic/my-cl-protobufs.asd b/examples/meshtastic/my-cl-protobufs.asd index 1692e81..9bc4176 100644 --- a/examples/meshtastic/my-cl-protobufs.asd +++ b/examples/meshtastic/my-cl-protobufs.asd @@ -15,6 +15,7 @@ :alexandria :trivial-garbage :cl-base64 + #-os-windows :local-time :float-features) :components (;; cl-protobufs diff --git a/examples/meshtastic/readme-usage.md b/examples/meshtastic/readme-usage.md index 4d7c318..b8fdd5f 100644 --- a/examples/meshtastic/readme-usage.md +++ b/examples/meshtastic/readme-usage.md @@ -108,8 +108,8 @@ phone is sent once (at startup) to the radio. Save / Restore data ------------------- -A local web-server is included on mobile for saving and restoring the message -DB, the app settings, plus eventually cached map tiles (for offline usage). +A local web-server is included on mobile for saving and restoring all of: +message DB, app settings, eventually cached map tiles (for offline usage). Just use special text message `:w` (for 'web-server') and `:ws` (for 'stop web-server') after you're done. @@ -146,11 +146,11 @@ different places, and have it logged in your messages. Hacker tips ----------- -If it occurs that a RAK device goes into an undefined state and doesn't seem +If it occurs that a radio device goes into an undefined state and doesn't seem to work anymore, you can try a factory reset (see CLI) and flash the latest firmware. -Alternatively you can completely erase the flash memory from an arduino IDE, +RAK devices can also completely erase the flash memory from an arduino IDE, see RAK on github and file `reset-flash.ino` (re-flash firmware afterwards). If you are a Lisp hacker, you may enjoy the integrated Swank server (on @@ -158,5 +158,8 @@ mobile). Just type special text message `:s`. A message with the IP to connect to will be shown once the server is running. Beware though that Swank on mobile isn't very stable, but it's perfect for simple debugging purposes, or to get/set variables on the fly (but it might crash regularily if you try to eval -some buffer). +some buffer, or even during auto-completion). + +For full Swank/Slime power you'll need the desktop version anyway (this is how +this app was developed). diff --git a/examples/meshtastic/readme.md b/examples/meshtastic/readme.md index f1985b1..0962946 100644 --- a/examples/meshtastic/readme.md +++ b/examples/meshtastic/readme.md @@ -53,14 +53,12 @@ of cl-sqlite) currently needs a small hack to even work on mobile. Tested ------ -Tested on Linux, macOS, android, iOS. +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). -Windows 10+ will follow soon. - How to use cl-meshtastic @@ -71,9 +69,11 @@ start the app. On android coarse location permission is required for BLE to work. -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. +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; first