Lab 06 - RPi and Building LoRa Gateway
Lab 06 - RPi and Building LoRa Gateway
Tushar B. Kute,
Edited Tran The Son
https://www.researchgate.net/profile/Tran-
The-Son
What is Raspberry Pi?
• The Raspberry Pi is a series of small single-board
computers developed in the United Kingdom by the
Raspberry Pi Foundation to promote the teaching
of basic computer science in schools and in
developing countries.
• The original model became far more popular than
anticipated, selling outside of its target market for
uses such as robotics.
• Over 5 million Raspberry Pis have been sold before
February 2015, making it the best-selling British
computer. By November 2016 they had sold 11
million units.
Raspberry Pi Sale
Raspberry Pi 3 Model B
Raspberry Pi 4 Model B
• Android Things
• Arch Linux
• OpenSuse
• Raspberry Pi Fedora
Remix
• Pidora
• Gentoo Linux
• CentOS Raspberry Pi
• Kali Linux
• Slackware ARM
• Puppy Linux
Other Operating Systems
• RISC OS Pi
• FreeBSD
• NetBSD
• Windows 10 IOT
Core
• Haiku
• HelenOS
Community
raspi-config
User interface
Command-line GUI
ot@devuan:~# nmap -sP 192.168.1.0/24
ot@devuan:~# ifconfig $ sudo -i
oot@devuan:~# ssh [email protected] root@pi3bplus:~# startx
oot@devuan:~# useradd newuser –m –G [pi]
$ cat /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 38.40
Features : half thumb fastmult vfp edsp neon vfpv3 tls
vfpv4 \ idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
………………
$ uname -m
armv7l
RAM
nterface eth0
nform 192.168.1.177
tatic routers=192.168.1.1
tatic domain_name_servers=192.168.1.1
Wireless
SID xxxx
nterface eth0
nform 192.168.1.177
tatic routers=192.168.1.1
tatic domain_name_servers=192.168.1.1
Point-to-point
Pi Direct
Node B Node B+
# ifconfig
# sysctl -w net.ipv4.ip_forward=1
# route -n
net.ipv4.ip_forward = 1
# iptables -L -t nat
# iptables -F -t nat
# iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERA
Peripherals
$ lsusb
Bus 001 Device 008: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 007: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 004: ID 045e:00d1 Microsoft Corp. Optical Mouse
with Tilt Wheel
……………..
SD Card Storage
mount
v/mmcblk0p2 on / type ext4 (rw,noatime,data=ordered)
$ cat
/sys/block/mmcblk0/queue/physical_block_size
512
$ cat
/sys/block/mmcblk0/queue/logical_block_size
$ 512
ls -l /dev/mmcblk0p?
Direct File System Mounts
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 149.1G 0 disk
├─sda1 8:1 0 147.3G 0 part /
├─sda2 8:2 0 1K 0 part
└─sda5 8:5 0 1.8G 0 part [SWAP]
sdb 8:16 1 14.5G 0 disk
├─sdb1 8:17 1 41.8M 0 part
└─sdb2 8:18 1 14.5G 0 part
sr0 11:0 1 1024M 0 rom
# blkid
/dev/sda1: UUID="51d355c1-2fe1-4f0e-aaae-01d526bb27b5"
TYPE="ext4" PARTUUID="61c63d91-01"
/dev/sda5: UUID="83a322e3-11fe-4a25-bd6c-b877ab0321f9"
TYPE="swap" PARTUUID="61c63d91-05"
/dev/sdb1: LABEL="boot" UUID="A75B-DC79" TYPE="vfat"
PARTUUID="2e37b5e0-01"
…….
Video Capabilities
• Asus TinkerBoard
• BeagleBone
• Banana Pi
• Orange Pi
• Ordroid
Asus TinkerBoard
Raspberry Pi vs TinkerBoard
Raspberry Pi vs TinkerBoard
BeagleBone Black
BeagleBone Black vs. Raspberry Pi
Power
Choose a power
Psupply = P * 1.5 = 8.475 W
Command line
$ pinout
Building the gateway using RAK831&Rasp Pi
RAK831
Key Features
• Based on Semtech SX1301
• Supports 8 channels
• LoRaWAN® Stack 1.0.2
• Rx Sensitivity down to -139 dBm
(@293bps)
• Tx Power up to 23 dBm
• Full band support: 433MHz,
470MHz, 865MHz, 868MHz,
915MHz, 920MHz, 923MHz
• Range up to 15km Line of Sight,
2km+ in Dense Urban
• SPI interface
Installation
cd /opt/ttn-gateway/bin/
7. Run start shell script: sudo ./start.sh
Registration TTN
1. https://account.thethingsnetwork.org/register
2. Console -> Gateway -> registergateway
Gateway EUI: VKU gateway already registered
Cấu hình lại server