Skip to content

Latest commit

 

History

70 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

LoRaWAN Raspberry Pi

A Python wrapper for utilizing the LMIC library to transmit data from a Raspberry Pi 4 using the RFM95 module.

This code is adapted and modified from lmic-rpi-fox. This library provides an interface between hardware and software, consisting of a LoRa chip RFM95 modified to operate at a frequency of 865 MHz and two indicator LEDs, one for indicating power on and the other for indicating data sending activity.

Setup

  • Format the SD card with SD Memory Card Formatter
  • Install the Raspbian operating system on the Raspberry Pi, which can be installed via Imager/Baleno Etcher
  • Enable the SPI interface in preferences => Raspberrry pi configuration => interfaces

Hardware mapping

The complete WiringPi pin mapping can be seen here

WiringPi Pin Function
0 Reset
4 DIO0
5 DIO1
1 DIO2 (Not used)
12 MOSI
13 MISO
14 SCK
6 SS
2 STATUS LED
3 DATE SENT LED
GND GND
3.3V +3.3V

Install the WiringPi library

The WiringPi library provides the Raspberry Pi GPIO interface. Follow the instructions in that repository or do the following.

# Clone the repository 
$ git clone https://github.com/WiringPi/WiringPi.git 

# Access the wiringPi folder 
$ cd wiringPi 

# Build the library
$ ./build 

Compile LoraWANPi

# Clone the repository 
$ git clone https://github.com/cksajil/LoraWANPi.git 

# Access the lmic_rpi folder 
$ cd lmic_rpi/examples/ttn-abp-send 

# Make the project 
$ make 

# Running the program 
$ ./ttn-abp-send 

How to run

# LED flag (0/1) can be used as an indication for device activity and data sending
./ttn-abp-send <DevAddr> <Nwkskey> <Appskey> <Rain_mm> <LED_FLAG>

# Example
./ttn-abp-send AB0096CD 1A2B80150C4ED6DADA2B2CFD822C6378 12345678972908DA7A6C09771181A21C 3.12 1

License

Content is licensed under the MIT License. See License File for more information.

About

A Python wrapper for utilizing the LMIC library to transmit data from a Raspberry Pi 4 using the RFM95 module

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages