This LoRa payload counter is based on Micropython and a modified version of the u‑lora library by Martyn Wheeler. It is intended to work with ESP32, ESP8266 and Raspberry Pi Pico microcontrollers.
Payload counts are those as being reported by the LoRa chip.
- No attempt was made to render this tool user friendly. This might be done in the future. Right now, it is a quick and dirty way of having a LoRa chip count the payload bytes of received LoRa packets.
- The LoRa sync word is currently fixed to the default LoRaWAN value of
0x34
.
$ pip install esptool rshell
- For ESP32, please, follow these instructions.
The pyboard.py
utility comes preinstalled with this repository.
Here is the official pyboard.py
documentation.
From within the cloned repository folder, copy the firmware scripts main.py
and ulora.py
to the device flash drive, called :
$ pyboard.py --device /dev/ttyUSB2 -f cp main.py ulora.py :
The correct device port was derived from the dmesg
device messages on Linux.
A device running Micropython has a shell environment, called the read–eval–print loop (REPL).
It can be accessed by running the rshell
tool.
$ rshell -p /dev/ttyUSB2 -b 115200
repl
- After typing
repl
followed by a Return, hit Ctrl+D to soft reboot the device. - You can now monitor the output of the
main.py
script running on the device. - Hit once or twice Ctrl+X to leave the REPL and to return to
rshell
. - Hit Ctrl+D again to leave
rshell
and to return to the command line.