Have you lost your GPS-enabled quad in the field, but typing the GPS coordinates into your phone is too much work? This script will generate a QR code that you can scan with your phone and open it in your favorite map app.
Note: On this screenshot the camera app has shortened the coordinates, but after tapping it Google Maps uses the full 6 digits (11cm accuracy) of the latitude and longitude.
The QR code is updated every 15 seconds while the script is active.
This script should be compatible with monochrome EdgeTX radios, that support telemetry scripts. I have only tested it on the Jumper T14 (128x64 OLED screen, EdgeTX v2.10.0), so your mileage may vary.
Caution
Generating a QR code with a Lua script is taxing on the MCU. Please do not have this telemetry screen open while in flight, as it may cause the radio to lag or crash.
The script saves the last position in the background, so you can open it only when you are looking for your quad.
Note
Please do not use gps_qr.src.lua
from this repo directly, it requires minification.
Go to the Releases tab and download one of the following files:
File | Description |
---|---|
GPSqr.lua |
Non-inverted version, use for LCD based monochrome radios |
GPSqrI.lua |
Color inverted version, use for OLED based monochrome radios |
Then, copy the file to the SCRIPTS/TELEMETRY
folder on your SD card.
- Make sure your model supports telemetry, and has a GPS receiver.
- Make sure the GPS sensor is discovered by EdgeTX (Telemetry tab of the model settings). See the EdgeTX user manual for more information
- Add this script as a screen
- When you need to find your model, activate the telemetry screen and scan the QR code with your phone.
- Go to the pin!
If you want to modify the script:
- Install luamin and GNU make. (Alternatively you can manually use the online version of luamin)
- Edit
gps_qr.src.lua
- Run
make
to minify the script - The minified script will be placed in the
dist/
folder (and the inverted version)
While the script is functional, some improvements could be made:
- Code-golf the QR code generation further to make it faster & consume less memory
- Idea: Generate the mask variants asynchronously to distribute the load and allow the GC to cleanup
- Color radio support (I don't have one, so somebody else has to do it)
- Rewrite the QR code generation to C++ and contribute it to EdgeTX
- QR code generation consists mainly of bitwise operations, which LUA sucks at - strings of 0s and 1s are used to manipulate the data, which is hopelessly inefficient
- The error correction relies heavily on lookup tables, which in C++ could be stored in the flash memory and not in RAM like in LUA
- This could probably be useful for other scripts as well - imagine ExpressLRS showing you one to join it's Wi-Fi network.
This script is based on the luaqrcode library licensed under the BSD 3-Clause License. See the top of gps_qr.src.lua for the modifications that were done.