add RPi and packet forwarder instructions
This commit is contained in:
		
							parent
							
								
									8e5867dc61
								
							
						
					
					
						commit
						7c1ae87c8b
					
				@ -4,5 +4,34 @@ Download the [Raspberry Pi Imager](https://flathub.org/apps/org.raspberrypi.rpi-
 | 
			
		||||
 | 
			
		||||
Download Raspberry Pi OS Lite 64-bit from the [Raspberry Pi download page](https://www.raspberrypi.com/software/operating-systems/)
 | 
			
		||||
 | 
			
		||||
Settings in the imager
 | 
			
		||||
Open the imager and do the following:
 | 
			
		||||
 | 
			
		||||
- Choose custom image (at the bottom)
 | 
			
		||||
  - Pick the OS file you downloaded
 | 
			
		||||
- Choose your SD card for storage
 | 
			
		||||
- Click the gear icon for settings
 | 
			
		||||
  - Set hostname, enable SSH, set username/password, set WiFI as desired
 | 
			
		||||
- Click image
 | 
			
		||||
 | 
			
		||||
Once writing is done, put the SD card in and start up the Pi. Wait a minute for it to start and join the network.
 | 
			
		||||
 | 
			
		||||
Find the IP address of the Pi via your router (look for DHCP leases) and SSH in.
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
Change the IP address to be static by adding the following to the bottom of `/etc/dhcpcd.conf` (modify for your own environment, using `eth0` for wired):
 | 
			
		||||
 | 
			
		||||
```conf
 | 
			
		||||
interface wlan0
 | 
			
		||||
static ip_address=192.168.0.181
 | 
			
		||||
static routers=192.168.0.1
 | 
			
		||||
static domain_name_servers=192.168.0.1
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Enable SPI in the Raspberry Pi config by editing `/boot/config.txt` and uncommenting the line `#dtparam=spi=on`.
 | 
			
		||||
 | 
			
		||||
Update, upgrade, and install Git: `sudo apt update && sudo apt -y upgrade && sudo apt install -y git`.
 | 
			
		||||
 | 
			
		||||
Reboot and SSH in to the new static IP you assigned.
 | 
			
		||||
 | 
			
		||||
The Pi is ready for the packet forwarder to be installed.
 | 
			
		||||
 | 
			
		||||
@ -1,20 +1,29 @@
 | 
			
		||||
# Packet Forwarder
 | 
			
		||||
 | 
			
		||||
Download `lora_pkt_fwd` from <https://github.com/Lora-net/sx1302_hal>
 | 
			
		||||
SSH to the Raspberry Pi.
 | 
			
		||||
 | 
			
		||||
Run `make`
 | 
			
		||||
Clone the packet forwarder repository: `git clone https://github.com/Lora-net/sx1302_hal.git`.
 | 
			
		||||
 | 
			
		||||
Setup config
 | 
			
		||||
Go into the repo and run `make`.
 | 
			
		||||
 | 
			
		||||
Make pf user + give permissions
 | 
			
		||||
 | 
			
		||||
Copy files to pf user's home:
 | 
			
		||||
- `sudo useradd -m -s /usr/sbin/nologin pf`
 | 
			
		||||
  - `-m`: create home
 | 
			
		||||
  - `-s /usr/sbin/nologin`: don't allow logging in; the user's only purpose is to own the packet forwarder process
 | 
			
		||||
  - `pf`: the username
 | 
			
		||||
- `sudo usermod -aG gpio pf` (the `spi` group is not sufficient, and it is also not needed when part of the `gpio` group)
 | 
			
		||||
 | 
			
		||||
- `global_conf.json.sx1250.US915`
 | 
			
		||||
- `lora_pkt_fwd`
 | 
			
		||||
- `reset_lgw.sh`
 | 
			
		||||
From the packet forwarder repo, copy files to pf user's home and set permissions:
 | 
			
		||||
 | 
			
		||||
(Make sure execute permission is set on `lora_pkt_fwd` and `reset_lgw.sh`.)
 | 
			
		||||
```sh
 | 
			
		||||
sudo cp packet_forwarder/{global_conf.json.sx1250.US915,lora_pkt_fwd} /home/pf
 | 
			
		||||
sudo cp tools/reset_lgw.sh /home/pf
 | 
			
		||||
sudo chown pf:pf /home/pf/{global_conf.json.sx1250.US915,lora_pkt_fwd,reset_lgw.sh}
 | 
			
		||||
sudo chmod +x /home/pf/{lora_pkt_fwd,reset_lgw.sh}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Modify the packet forward config at `/home/pf/global_conf.json.sx1250.US915`. Change `gateway_ID` to something nice (????). 8 bytes (16 uppercase hex characters)
 | 
			
		||||
 | 
			
		||||
Create SystemD unit file at `/etc/systemd/system/packet-forwarder.service`:
 | 
			
		||||
 | 
			
		||||
@ -37,3 +46,5 @@ WantedBy=multi-user.target
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Start and enable `sudo systemctl enable --now packet-forwarder.service`.
 | 
			
		||||
 | 
			
		||||
Check that it is running with `sudo systemctl status packet-forwarder.service`.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								doc/dhcp-leases.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								doc/dhcp-leases.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 81 KiB  | 
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user