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, an 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.
-
In the Device step, select Raspberry Pi 4 (this includes Compute Module 4).
-
In the OS step, select Raspberry Pi OS (other).
-
Select Raspberry Pi OS Lite (64-bit).
-
In the Storage step, select the FIBER device (shown as RPi-MSD-0001 Media).
-
In the Customisation step, enter a hostname for your FIBER device (e.g.
fiber). -
In the Localisation section, select your location, time zone, and keyboard layout.
-
In the User section, enter a username and password.
tipYou can use
fiberfor username andhardwariofor password.dangerThis is only recommended with public-key SSH authentication, otherwise use a strong passphrase.
-
Optional: In the Wi-Fi section, enter your wireless network's SSID and password.
-
In the Remote access section, enable SSH and select your preferred authentication method.
-
Optional: In the Raspberry Pi Connect section, you can enable remote access via Raspberry Pi Connect. For this guide, we leave it disabled.
-
Review the summary and click WRITE to start the flashing process.
-
Confirm the warning dialog by clicking I UNDERSTAND, ERASE AND WRITE.
-
Wait for the writing process to complete.
-
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 the 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
Configure Hardware
This section configures the I2C bus and real-time clock (RTC) on the FIBER device.
-
Install the I2C tools package for I2C bus diagnostics:
sudo apt install -y i2c-tools -
Configure the
i2c-devkernel module to load automatically at boot:echo 'i2c-dev' | sudo tee -a /etc/modules-load.d/i2c.conf > /dev/null -
Add hardware configuration to the boot configuration file:
cat << EOF | sudo tee -a /boot/firmware/config.txt > /dev/null
dtparam=i2c_arm=on
dtparam=i2c_vc=on
disable_poe_fan=1
force_eeprom_read=0
camera_auto_detect=0
dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi
EOFtipThis enables I2C interfaces, disables the PoE fan control, and configures the RTC overlay for the PCF85063A chip.
-
Reboot the system to apply the hardware configuration:
sudo reboot -
Verify the I2C bus is accessible by scanning for devices:
sudo i2cdetect -y 10tipYou should see the RTC device listed on the I2C bus.
-
Install additional utilities for hardware clock access:
sudo apt install util-linux-extra -
Verify the hardware clock is accessible:
sudo hwclock -v
Install ChirpStack
-
Install required packages for ChirpStack (MQTT broker and Redis):
sudo apt install \
mosquitto \
mosquitto-clients \
redis-server \
redis-tools -
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 package (SQLite variant):
sudo apt install chirpstack-sqlite -
Create the SQLite database file with proper ownership and permissions:
sudo install -o chirpstack -g chirpstack -m 0640 /dev/null /var/lib/chirpstack/chirpstack.sqlite -
Write the ChirpStack configuration file:
cat << 'EOF' | sudo tee /etc/chirpstack/chirpstack.toml > /dev/null
[logging]
level = "info"
[sqlite]
path="sqlite:///var/lib/chirpstack/chirpstack.sqlite"
pragmas=[
"busy_timeout = 1000",
"foreign_keys = ON",
]
[redis]
servers = ["redis://localhost/"]
cluster = false
[network]
net_id = "000000"
enabled_regions = [
"as923",
"as923_2",
"as923_3",
"as923_4",
"au915_0",
"cn470_10",
"cn779",
"eu433",
"eu868",
"in865",
"ism2400",
"kr920",
"ru864",
"us915_0",
"us915_1",
]
[api]
bind = "0.0.0.0:8080"
secret = "you-must-replace-this"
[integration]
enabled = ["mqtt"]
[integration.mqtt]
server = "tcp://localhost:1883/"
json = true
EOF -
Generate and set a random secret key in the ChirpStack configuration:
sudo sed -i "s|secret = \"you-must-replace-this\"|secret = \"$(openssl rand -base64 32)\"|" /etc/chirpstack/chirpstack.toml -
Enable the ChirpStack service to start automatically on boot:
sudo systemctl enable chirpstack-sqlite -
Start the ChirpStack service:
sudo systemctl start chirpstack-sqlite -
Check the service logs to verify successful startup:
sudo journalctl -fu chirpstack-sqlite -
Now, you can access ChirpStack at this address:
http://[TARGET IP ADDRESS]:8080/
Install ChirpStack Concentratord
This section installs and configures the ChirpStack Concentratord for the LoRa concentrator module.
-
Download and install the ChirpStack Concentratord binary:
curl -sL https://artifacts.chirpstack.io/downloads/chirpstack-concentratord/chirpstack-concentratord-sx1302_4.5.3_linux_arm64.tar.gz | sudo tar -xzf - -C /usr/bin --no-same-owner chirpstack-concentratord-sx1302 -
Create the configuration directory with proper ownership:
sudo install -o chirpstack -g chirpstack -m 0750 -d /etc/chirpstack-concentratord -
Create the configuration file with proper ownership and permissions:
sudo install -o chirpstack -g chirpstack -m 0640 /dev/null /etc/chirpstack-concentratord/chirpstack-concentratord.toml -
Write the Concentratord configuration file:
cat << EOF | sudo tee /etc/chirpstack-concentratord/chirpstack-concentratord.toml > /dev/null
[concentratord]
log_level="INFO"
log_to_syslog=false
stats_interval="30s"
disable_crc_filter=false
[concentratord.api]
event_bind="ipc:///tmp/concentratord_event"
command_bind="ipc:///tmp/concentratord_command"
[gateway]
antenna_gain=0
lorawan_public=true
region="EU868"
model="rak_5146"
model_flags=["USB"]
time_fallback_enabled=true
gateway_id=""
[gateway.concentrator]
multi_sf_channels=[
868100000,
868300000,
868500000,
867100000,
867300000,
867500000,
867700000,
867900000,
]
[gateway.concentrator.lora_std]
frequency=868300000
bandwidth=250000
spreading_factor=7
[gateway.concentrator.fsk]
frequency=868800000
bandwidth=125000
datarate=50000
[gateway.location]
latitude=0.0
longitude=0.0
altitude=0
EOF -
Create the systemd service file for Concentratord:
cat << EOF | sudo tee /etc/systemd/system/chirpstack-concentratord.service > /dev/null
[Unit]
Description=ChirpStack Concentratord
Documentation=https://www.chirpstack.io/
Wants=network-online.target
After=network-online.target
[Service]
User=chirpstack
Group=chirpstack
ExecStart=/usr/bin/chirpstack-concentratord-sx1302 -c /etc/chirpstack-concentratord/chirpstack-concentratord.toml
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF -
Add the
chirpstackuser to thedialoutgroup for serial port access:sudo usermod -aG dialout chirpstack -
Reload the systemd daemon to recognize the new service:
sudo systemctl daemon-reload -
Enable the ChirpStack Concentratord service to start automatically on boot:
sudo systemctl enable chirpstack-concentratord -
Start the ChirpStack Concentratord service:
sudo systemctl start chirpstack-concentratord -
Check the service logs to verify successful startup and obtain the gateway ID:
sudo journalctl -fu chirpstack-concentratordtipCopy the Gateway ID from the log output - you will need it to register the gateway in ChirpStack.
Install ChirpStack MQTT Forwarder
This section installs the ChirpStack MQTT Forwarder that connects the Concentratord to the MQTT broker.
-
Install the ChirpStack MQTT Forwarder package:
sudo apt install chirpstack-mqtt-forwarder -
Write the MQTT Forwarder configuration file:
cat << EOF | sudo tee /etc/chirpstack-mqtt-forwarder/chirpstack-mqtt-forwarder.toml > /dev/null
[logging]
level="info"
log_to_syslog=false
[backend]
enabled="concentratord"
[backend.concentratord]
event_url = "ipc:///tmp/concentratord_event"
command_url = "ipc:///tmp/concentratord_command"
[mqtt]
topic_prefix="eu868"
server="tcp://127.0.0.1:1883"
username=""
password=""
ca_cert=""
tls_cert=""
tls_key=""
EOF -
Enable the ChirpStack MQTT Forwarder service to start automatically on boot:
sudo systemctl enable chirpstack-mqtt-forwarder -
Start the ChirpStack MQTT Forwarder service:
sudo systemctl start chirpstack-mqtt-forwarder -
Check the service logs to verify successful startup:
sudo journalctl -fu chirpstack-mqtt-forwarder
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/