The expansion board is for raspberry pi mainboard and allows sending messages over the LoraWan network
You can purchase the board on YADOM.FR.
This python script allows :
- reading preprogrammed EUI
- joining a network using OTAA or ABP
- sending data with or without requesting a response
- reading preprogrammed EUI
python sendlorawan.py --eui
- joining an OTAA Lora network providing devEUI (0004A30B001EBA62) appEUI (0000000000000001) and appKey (4E2086153FB762C2E079A1F791792400) and sending frame 0A1B
python sendlorawan.py --otaa 0004A30B001EBA62 0000000000000001 4E2086153FB762C2E079A1F791792400 --send 0A1B
- joining an OTAA Lora network providing devEUI (0004A30B001EBA62) appEUI (0000000000000001) and appKey (4E2086153FB762C2E079A1F791792400) and sending frames A4B5 and then FCD45E0C expecting a downlink frame
python sendlorawan.py --otaa 0004A30B001EBA62 0000000000000001 4E2086153FB762C2E079A1F791792400
python sendlorawan.py --send A4B5
python sendlorawan.py --send FCD45E0C --receive
- joining an ABP Lora network providing NwkSkey () AppSKey () and devAddr () and sending frame AB50
python sendlorawan.py --abp --send AB50
- Notes
Short arguments are supported (ie -p for --port)
The serial port path can be specified with option
--port
, default is/dev/ttyAMA0
The Lora channel can be specified when sending with option--channel
, default is1
The following steps should be performed in the following order
-
Disable Raspberry Pi terminal on serial port with raspi-config utility:
sudo raspi-config
Go to
Interfacing Options
then chooseSerial
thenNO
andOK
-
Install pyserial
sudo apt-get install python-serial
-
Download scripts
- if git is installed then clone the repository :
git clone https://github.com/SNOC/rpilorawan.git
- otherwise paste script content to a new file:
nano sendlorawan.py
-
Plug antenna with its cable and test the communication:
python sendlorawan.py --eui
-
Edit
/boot/config.txt
sudo nano /boot/config.txt
- disable if present
dtoverlay=pi3-miniuart-bt
by adding#
character at line begining :#dtoverlay=pi3-miniuart-bt
- if not present, add :
note:
dtoverlay=pi3-disable-bt enable_uart=1
enable_uart=0
might be present at the end of the file, in such case it should be commented or modified toenable_uart=1
- disable if present
-
then reboot :
sudo reboot
Serial port to use is the script's default one : /dev/ttyAMA0
MIT License / read license.txt