This repository contains code examples in Python to use with the LoStik device.
LoStick is a open source USB LoRa® device available here https://www.crowdsupply.com/ronoth/lostik. Its main characteristics are:
- Works with any PC, Raspberry Pi, or BeagleBone
- Simple ASCII interface
- Supports Packet mode LoRa® (packet mode) or LoRaWAN™
- Compatible with The Things Network and Loriot
- Based on the RN2903/R2483 by Microchip
Main references used
- The example here are basically based on those in: https://github.com/lolsborn/LoStik
- Some help also from here: https://github.com/raspberrypi-tw/lora
Before executing the code below:
- check whether the channel parameters are properly set.
- discover the serial port where the Lostik is connected (
_lostik-serial-port_
). For example in macOS with command:ls /dev/cu.*
miniterm.py
: used to connect to a LoStick and send commands manuallypacker.py
: support file
- sends using Lora a text message red from input
- execute as:
python sender.py _lostik-serial-port_
- periodically sends using Lora a text message stored in variable "rawinput"
- execute as:
python senderp.py _lostik-serial-port_
- continuously reads messages using Lora
- execute as:
python receiver.py _lostik-serial-port_
- periodically sends using LoRaWAN a text message stored in variable "rawpayload"
- uses OTAA. Works with https://www.loriot.io/ and https://www.thethingsnetwork.org/ servers
- execute as:
python senderp_otaa.py _lostik-serial-port_
- periodically sends using LoRaWAN a text message stored in variable "rawpayload"
- uses ABP. Works with https://www.loriot.io/ and https://www.thethingsnetwork.org/ servers
- execute as:
python senderp_abp.py _lostik-serial-port_