Build LoRa gateway using Raspberry Pi 3 model B and Dragino LoRa shield v1.1
Information
none
Operating system used
Windows Vista Home Premium SP 1
Hardware used
- Raspberry Pi 3 model B with pin diagram
Note:
To verify this pin diagram, you need to install raspbian, open a terminal and type: gpio readall
- Dragino LoRa Shield v1.1 868MHz Arduino Wireless Shield
Bottom view. The frequency used in Europe is 868 MHz, for the U.S. 900 MHz and in China, Japan and Korea 433 MHz. Make sure your LoRa shield has the correct frequency.
The LoRa Shield v1.1 is equiped with HopeRF RFM95W-868-S2. This module is marked RF96 which means the chip is using the SX1276 chip.
Dragino LoRa Shield v1.1 with pin diagram.
Note: Pin 33, 34 and 35 are located nearest to the RF96 chip
Dragino LoRa Shield schematic
More information about the Dragino LoRa Shield v1.1 868MHZ Arduino Wireless Shield:
Dragino LoRa Shield v1.1 Schematic
http://wiki.dragino.com/index.php?title=Lora_Shield
https://github.com/dragino/Lora/tree/master/Lora%20Shield
Additional information: Dragino LoRa shield, part 1.
- Samsung EVO micro SDHC card, 32GB, 48MB/s, class 10
- Raspberry pi power supply
- Jumper wires 20 cm long (5x female-female and 3x male-female)
- Breakable male pin headers (only need 2 pins)
- Optional: Ethernet network cable
The Raspberry Pi 3 has WIFI thus an Ethernet network cable is not actually needed.
- Optional: Monitor with HDMI connection
The Raspberry Pi 3 can be remotely accessed using a PC thus a Monitor and HDMI cable is not actually needed.
- Optional: HDMI cable
The Raspberry Pi 3 can be remotely accessed using a PC thus a Monitor and HDMI cable is not actually needed.
Software prerequisites
none
Procedure
- Install NOOBS (New Out Of the Box Software) version 1.9.2 on the micro SD card.
You can use the same procedure as described in:
Installing Raspbian on Raspberry Pi model B using NOOBS
- Connect a mouse, keyboard, ethernet cable and monitor cable to the Raspberry Pi.
- Connect the power cable, the NOOB install manager is now running.
Click Yes at the warning dialog.
- Select option: Raspbian and press the Install button.
- Raspbian is now being installed on the micro SD card.
After installation press the OK button.
- Raspbian is being rebooted into the GUI environment.
- Instead of an ethernet cable, the Raspberry Pi can be connected to a router via WIFI.
In the top right corner, select the network icon (two screen monitors) and select your WIFI network and enter
the password authentication.
- To see what the Raspberry Pi ip address is, hover your mouse over the network icon (two screen monitors or WIFI symbol).
You will see the ip address (eth0, wlan0) which you can use to access the Raspberry Pi remotely, for example:
192.168.1.69
- To access the Raspberry Pi GUI from your Windows laptop using Remote Desktop Connection,
you need to install the xrdp service on the Raspbian. To install this service, type in the terminal:
- sudo apt-get install xrdp
- Type: Y [Enter] to continue
- The packages are downloaded from internet and installed.
- Start the Remote Desktop Connection on your laptop, enter the Raspberry Pi ip address, for example: 192.168.1.69 and press the Connect button.
- A warning message is displayed, press Yes button.
- Log into to xrdp using the default Raspbian default account:
Select module: sesman-Xvnc
Enter username: pi
Enter password: raspberry
Press OK button and a few seconds later you will see the Raspbian GUI.
- Install the Samba package so the Raspberry Pi can be accessed by its hostname from a Windows machine instead of its ip address.
The ip address can change because the Raspberry Pi gets its ip address via DHCP:
Type: sudo apt-get -y install samba
- By default the Raspberry Pi hostname is: raspberrypi
To change the hostname:
- Type: sudo raspi-config
- Select: 9 Advanced Options
- Select: A2 Hostname
- Select: Ok
- Enter your new hostname
- Select: Ok
- If you want to access the Raspberry Pi filesystem using the iMac Finder install the Appletalk protocol on the Raspberry Pi.
Goto the Raspberry Pi and do the following:
- Type: sudo apt-get install netatalk
- Open Finder, type: afp://192.168.1.69
- Reboot the Raspberry Pi
- Start the Remote Desktop Connection on your laptop, enter the Raspberry Pi hostname, for example: raspberry and press the Connect button.
- Install latest updates, open a terminal:
Type: sudo apt-get update
Type: sudo apt-get upgrade
- Make sure the GPIO access library "wiringpi" is installed:
Open a terminal and type: sudo apt-get install wiringpi
- Select Menu | Preferences | Raspberry Pi configuration
Select tab Interfaces and enable SPI
- Install and build the Single Channel LoRaWAN Gateway on your Raspberry Pi:
- Shutdown the Raspberry Pi and remove power from the Raspberry Pi.
- Solder the antenna and male pin headers to the Dragino LoRa shield.
See my YouTube movie: Dragino LoRa shield, part 1
- Make the following jumper wire connections, see the pin diagrams, between the Dragino LoRa Shield and the Raspberry Pi 3 model B.
|
23
|
5V
|
2
|
5V
|
|
25
|
GND
|
6
|
GND
|
|
33
|
(DO_A) MISO
|
21
|
SPI_MISO
|
|
37
|
(DI_A) MOSI
|
19
|
SPI_MOSI
|
|
34
|
(CLK_A) SCK
|
23
|
SPI_CLK
|
|
10
|
(CS_A) NSS
|
22
|
GPIO6
|
|
SV pin 1
|
DIO 0
|
7
|
GPIO7
|
|
SV pin 7
|
RESET
|
11
|
GPIO0
|
Wiring Dragino LoRa Shield v1.1 and Raspberry Pi 3 model B.
Click on the image for a larger image.
Additional information: Connect Dragino LoRa Shield v1.1 to Raspberry Pi 3 model B, part 2.
- Make sure the Raspberry Pi has internet access.
Power up the Raspberry Pi and login to the Raspberry Pi.
- Open a terminal and type: cd lorawan_gateway/single_chan_pkt_fwd
- Startup the packet forwarder executable, type: sudo ./single_chan_pkt_fwd
Write down your Gateway ID (for example: b8:27:eb:ff:ff:ca:f2:51). You will need it later.
If the packet forwarder shows the message: "unrecognized transceiver" the Raspberry Pi can not detect the LoRa shield.
Check all your wiring and try it again.
- Create an account on The Things Network (TTN)
Provide your email address, username, first and last name.
- Once your account has been activated, log in and goto to The Things Network homepage https://www.thethingsnetwork.org
If you see the Login button press it and you will see:
Select "My Profile"
- You can add your website and twitter handle. Press the button "ADD A GATEWAY"
- Edit the following:
- Add your gateway title and location on a map. It will appear on The Things Network map.
- Set the status to: Active
- Enter your Gateway EUI, in hexadecimals with no colons, for example: B827EBFFFFCAF251
- Enable "Automatically update status and coordinates"
- Now check if The Things Network receives data from your LoRaWAN gateway.
Open a browser and type: http://thethingsnetwork.org/api/v0/gateways/B827EBFFFFCAF251
Replace the last part with YOUR gateway id.
You should see something like this:
Note:
You can also use:
http://ha-23.eradus.eu/croft.html
Additional information: Download, configure and startup single channel LoRa gateway, part 3.
- Additional information: The Things UNO beta, part 4.
- Additional information: Send data from the Things Uno Beta to The Things Network, part 5.
- Additional information: The node and LoRa Gateway measuring RSSI and distance, part 6.
- Additional information: Send humidity and temperature data from DHT11 sensor to The Things Network, part 7.
- Additional information: Changes made by The Things Network, part 8.
|