Installation
This article provides instructions on bootstrap and configuration of the Linux system on the FIBER device. The platform is based on Compute Module 4, and industrial version of the popular Raspberry Pi 4 platform.
In the article, we use two terms:
- HOST: The computer from which you will perform the setup.
- TARGET: The actual FIBER device you are setting up.
Connect Target to Host
-
Open the top cover of the FIBER device.
tipThere are four screws under the rubber feet.
-
Put jumper to the BOOT position (it has to be vertically aligned with the
BOOTlabel on the PCB).tipThis will allow the device to be switched to the bootloader mode.
-
Connect the PoE adapter (must be 802.3af compliant) to the wall socket.
-
Connect an Ethernet cable between the LAN port of the PoE adapter and your LAN router (unless WiFi connectivity is desired).
-
Connect the USB-B cable to HOST and the backside USB connector on the TARGET.
Activate Bootloader
-
Install the rpiboot tool - follow the instructions from this GitHub repository:
-
Connect an Ethernet cable between the PoE port of the PoE adapter and the Ethernet (RJ-45) connector of the TARGET.
-
Start the
rpiboottool.tipThis should switch the TARGET to the bootloader mode. On the HOST, a new USB disk will appear.
Flash Raspberry Pi OS
-
Download, install, and launch the Raspberry Pi Imager tool.
-
Click CHOOSE DEVICE and select Compute Module 4.
-
Click CHOOSE OS, select Raspberry Pi OS (other), and then select Raspberry Pi OS Lite (64-bit).
-
Click CHOOSE STORAGE and select the FIBER device.
-
Click NEXT - the tool will ask about the settings customization - click EDIT SETTINGS.
-
Check Set hostname.
-
Enter a hostname for your FIBER into the hostname field (e.g.
fiber). -
Check Set username and password.
-
Enter a username and a password into the username and password fields respectively.
tipYou can use
fiberfor username andhardwariofor password.dangerThis is only recommended with public-key SSH authentication, otherwise use a strong passphrase.
-
Optional: Check Configure Wireless LAN.
-
Optional: Enter your wireless network's SSID and password into the SSID and Password fields respectively.
-
Optional: Set the Wireless LAN Country drop-down to the country where the TAPPER device will be used.
-
Check Set locale settings.
-
Select your time zone in the Time zone drop-down menu.
-
Select your preferred keyboard layout in the Keyboard layout drop-down menu.
-
Write image to the the device.
-
When finished, press the RESET button on the TARGET (located next to the USB connector).
-
Wait for the TARGET to boot, and connect to the network.
tipYou may find IP address of your TARGET from your DHCP server's leases).
Update System
-
Update the package list to get information on the newest versions of packages:
sudo apt update -
Upgrade all installed packages to their latest versions:
sudo apt upgrade -y -
Reboot the system to apply updates:
sudo reboot
Install ChirpStack
-
Install required packages for ChirpStack (MQTT broker, Redis, and PostgreSQL):
sudo apt install \
mosquitto \
mosquitto-clients \
redis-server \
redis-tools \
postgresql -
Connect to PostgreSQL as the
postgresuser:sudo -u postgres psql -
Create a new PostgreSQL role named
chirpstackwith login capability and password:create role chirpstack with login password 'chirpstack'; -
Create a new database named
chirpstackowned by thechirpstackrole:create database chirpstack with owner chirpstack; -
Connect to the
chirpstackdatabase:\c chirpstack -
Enable the
pg_trgmextension for trigram matching:create extension pg_trgm; -
Quit the PostgreSQL prompt:
\q -
Install the GPG tool for verifying package signatures:
sudo apt install gpg -
Create the directory for APT keyrings if it doesn't exist:
sudo mkdir -p /etc/apt/keyrings/ -
Download and add the ChirpStack repository GPG key:
sudo sh -c 'wget -q -O - https://artifacts.chirpstack.io/packages/chirpstack.key | gpg --dearmor > /etc/apt/keyrings/chirpstack.gpg' -
Add the ChirpStack repository to the APT sources list:
echo "deb [signed-by=/etc/apt/keyrings/chirpstack.gpg] https://artifacts.chirpstack.io/packages/4.x/deb stable main" | sudo tee /etc/apt/sources.list.d/chirpstack.list -
Update the package list to include packages from the ChirpStack repository:
sudo apt update -
Install the ChirpStack Gateway Bridge package:
sudo apt install chirpstack-gateway-bridge -
Apply a patch to modify the MQTT topic templates in the configuration file:
sudo patch /etc/chirpstack-gateway-bridge/chirpstack-gateway-bridge.toml << 'EOF'
@@ -34,11 +34,8 @@
# MQTT integration configuration.
[integration.mqtt]
- # Event topic template.
- event_topic_template="gateway/{{ .GatewayID }}/event/{{ .EventType }}"
-
- # Command topic template.
- command_topic_template="gateway/{{ .GatewayID }}/command/#"
+ event_topic_template="eu868/gateway/{{ .GatewayID }}/event/{{ .EventType }}"
+ command_topic_template="eu868/gateway/{{ .GatewayID }}/command/#"
# MQTT authentication.
[integration.mqtt.auth]
EOF -
Start the ChirpStack Gateway Bridge service:
sudo systemctl start chirpstack-gateway-bridge -
Enable the ChirpStack Gateway Bridge service to start automatically on boot:
sudo systemctl enable chirpstack-gateway-bridge -
Install the ChirpStack package:
sudo apt install chirpstack -
Now, you can access ChirpStack at this address:
http://[TARGET IP ADDRESS]:8080/
Install Node-RED
-
Download and run the Node-RED installation script:
bash <(curl -sL https://github.com/node-red/linux-installers/releases/latest/download/update-nodejs-and-nodered-deb) -
Enable the Node-RED service to start automatically on boot:
sudo systemctl enable nodered.service -
Reboot the system to complete the installation:
sudo reboot -
Now, you can access Node-RED at this address:
http://[TARGET IP ADDRESS]:1880/