fix/revision of example 'meshtastic'

This commit is contained in:
pls.153 2023-11-07 18:06:17 +01:00
parent a5af331a8d
commit 6da7bf8670
5 changed files with 126 additions and 110 deletions

View file

@ -25,5 +25,13 @@
</ul>
<p>All parts above combined cost me around 50€.</p>
<p>I used a soldering iron, a hot glue gun, a step drill bit, double sided tape.</p>
<br>
<h3>Antennas</h3>
<p>
A good antenna is crucial for the radio to function properly. A <a href="https://nanovna.com/" target="_blank">NanoVNA</a> is very helpful to test if an antenna is resonant at the specified frequency (otherwise it's useless). You can find good clones for about 50€/$ (beware of really cheap/bad clones).
</p>
<p>
Antennas listed in the <a href="https://store.rakwireless.com/products/" target="_blank">RAK store</a> are generally of good/industrial quality. Some other mass produced offerings are of such bad quality that I had to throw them away (after measuring them).
</p>
</body>
</html>

View file

@ -78,6 +78,7 @@
(/ (* deg pi) 180))
(defun distance (from to)
(qlog :distance from to)
;; Haversine formula
(destructuring-bind ((lat-1 lon-1) (lat-2 lon-2))
(list from to)

View file

@ -191,6 +191,7 @@
:alt (me:altitude pos)
:time (me:time pos))))))
(let (echo-text)
(defun process-received ()
"Walks *RECEIVED* FROM-RADIOs and saves relevant data."
(setf *received* (nreverse *received*))
@ -210,7 +211,9 @@
(text (qfrom-utf8 payload)))
(setf msg:*message-id* (max mid msg:*message-id*))
(if (x:starts-with ":e" text) ; 'echo'
(qsingle-shot 1000 (lambda () (send-message (x:cc "<b>echo:</b>" (subseq text #.(length ":e"))))))
(progn
(setf echo-text (subseq text #.(length ":e")))
(qsingle-shot 1000 (lambda () (send-message (x:cc "<b>echo:</b>" echo-text)))))
(progn
(when (x:starts-with "<b>echo:</b>" text)
(setf text (msg:echo-message text (me:from packet) (me:rx-snr packet) (me:rx-rssi packet))))
@ -291,7 +294,7 @@
(unless (string= *my-channel-name*
(me:name (me:settings *my-channel*)))
(qlater 'config-device))))))
(setf *received* nil))
(setf *received* nil)))
(defun send-admin (admin-message)
(send-to-radio

View file

@ -124,15 +124,19 @@
sending an ':e ...' text message, which will be echoed with info about signal
strength, position and distance."
(let ((from-pos (loc:position* from))
(my-pos #+mobile (nbutlast (loc:last-gps-position) 1)
(my-pos #+mobile (nbutlast (loc:latest-gps-position) 1)
#-mobile nil))
(format nil "~A~%~%snr: <b>~F</b> rssi: <b>~D</b>~%lat: ~,5F lon: ~,5F~%distance: <b>~:D m</b>"
text snr rssi
(if my-pos (first my-pos) "-")
(if my-pos (second my-pos) "-")
(if (and from-pos my-pos)
(loc:distance my-pos from-pos)
"-"))))
(x:cc (format nil "~A~%~%snr: <b>~F</b> rssi: <b>~D</b>"
text snr rssi)
(if my-pos
(format nil "~%lat: ~,5F lon: ~,5F"
(first my-pos)
(second my-pos))
"")
(if (and my-pos from-pos)
(format nil "~%distance: <b>~:D m</b>"
(loc:distance my-pos from-pos))
""))))
(defun swipe-to-left () ; see QML
(q> |currentIndex| ui:*main-view* 0)

View file

@ -128,7 +128,7 @@
#:distance
#:extract-map-bin
#:ini
#:last-gps-position
#:latest-gps-position
#:make-map-bin
#:position*
#:position-count