This is a quick hacked library to evaluate RAK3172 AT firmware thanks to
the RAK3272S breakout board.
Lot of parts can be optimized but it is as far as I went in few dozens of minutes, PR are welcome ;-)
Currently implemented properties:
- Set/Get
appkey
- Get
deveui
, set is still TODO - Set/Get
joineu
(appeui
in loRaWAN 1.0.2 terminology) - Set
network_mode
:NETWORK_MODES.P2P
orNETWORK_MODES.OTAA
- Set/Get
verbose
mode to display all serial communications
Functions:
join
: Join a LoRaWAN networkjoin_status
: Get join statereset_soft
: Trigger a soft reset thanks toATZ
commandsend_command
: Send an arbitrary AT commandsend_payload
: Send a LoRaWAN payload.payload
must be ofbyte
typestatus
: Return device status, mostly to check UART connectivity
Events (implemented through a callback):
JOINED
: Device has joined the networkSEND_CONFIRMATION
: Uplink confirmation status:True
orFalse
Clone the project then install python dependancies
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
Find the serial port then pass it as parameter to the script, ex:
python lorawan.py /dev/ttyS20
lorawan.py
is an example file, it:
- Define events callback
- Instanciate the RAK3172 object
- Set JoinEui (AppEui) and AppKey if required
- Display the EUIs
- Join
- Send a message!
rak3172.py
is the class containing the RAK3172 object and its methods. An RX thread is started in background