Skip to main content

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

  1. Open the top cover of the FIBER device.

    tip

    There are four screws under the rubber feet.

  2. Put jumper to the BOOT position (it has to be vertically aligned with the BOOT label on the PCB).

    tip

    This will allow the device to be switched to the bootloader mode.

  3. Connect the PoE adapter (must be 802.3af compliant) to the wall socket.

  4. Connect an Ethernet cable between the LAN port of the PoE adapter and your LAN router (unless WiFi connectivity is desired).

  5. Connect the USB-B cable to HOST and the backside USB connector on the TARGET.

Activate Bootloader

  1. Install the rpiboot tool - follow the instructions from this GitHub repository:

    https://github.com/raspberrypi/usbboot

  2. Connect an Ethernet cable between the PoE port of the PoE adapter and the Ethernet (RJ-45) connector of the TARGET.

  3. Start the rpiboot tool.

    tip

    This should switch the TARGET to the bootloader mode. On the HOST, a new USB disk will appear.

Flash Raspberry Pi OS

  1. Download, install, and launch the Raspberry Pi Imager tool.

  2. Click CHOOSE DEVICE and select Compute Module 4.

  3. Click CHOOSE OS, select Raspberry Pi OS (other), and then select Raspberry Pi OS Lite (64-bit).

  4. Click CHOOSE STORAGE and select the FIBER device.

  5. Click NEXT - the tool will ask about the settings customization - click EDIT SETTINGS.

  6. Check Set hostname.

  7. Enter a hostname for your FIBER into the hostname field (e.g. fiber).

  8. Check Set username and password.

  9. Enter a username and a password into the username and password fields respectively.

    tip

    You can use fiber for username and hardwario for password.

    danger

    This is only recommended with public-key SSH authentication, otherwise use a strong passphrase.

  10. Optional: Check Configure Wireless LAN.

  11. Optional: Enter your wireless network's SSID and password into the SSID and Password fields respectively.

  12. Optional: Set the Wireless LAN Country drop-down to the country where the TAPPER device will be used.

  13. Check Set locale settings.

  14. Select your time zone in the Time zone drop-down menu.

  15. Select your preferred keyboard layout in the Keyboard layout drop-down menu.

  16. Write image to the the device.

  17. When finished, press the RESET button on the TARGET (located next to the USB connector).

  18. Wait for the TARGET to boot, and connect to the network.

    tip

    You may find IP address of your TARGET from your DHCP server's leases).

Update System

  1. Update the package list to get information on the newest versions of packages:

    sudo apt update
  2. Upgrade all installed packages to their latest versions:

    sudo apt upgrade -y
  3. Reboot the system to apply updates:

    sudo reboot

Install ChirpStack

  1. Install required packages for ChirpStack (MQTT broker, Redis, and PostgreSQL):

    sudo apt install \
    mosquitto \
    mosquitto-clients \
    redis-server \
    redis-tools \
    postgresql
  2. Connect to PostgreSQL as the postgres user:

    sudo -u postgres psql
  3. Create a new PostgreSQL role named chirpstack with login capability and password:

    create role chirpstack with login password 'chirpstack';
  4. Create a new database named chirpstack owned by the chirpstack role:

    create database chirpstack with owner chirpstack;
  5. Connect to the chirpstack database:

    \c chirpstack
  6. Enable the pg_trgm extension for trigram matching:

    create extension pg_trgm;
  7. Quit the PostgreSQL prompt:

    \q
  8. Install the GPG tool for verifying package signatures:

    sudo apt install gpg
  9. Create the directory for APT keyrings if it doesn't exist:

    sudo mkdir -p /etc/apt/keyrings/
  10. 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'
  11. 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
  12. Update the package list to include packages from the ChirpStack repository:

    sudo apt update
  13. Install the ChirpStack Gateway Bridge package:

    sudo apt install chirpstack-gateway-bridge
  14. 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
  15. Start the ChirpStack Gateway Bridge service:

    sudo systemctl start chirpstack-gateway-bridge
  16. Enable the ChirpStack Gateway Bridge service to start automatically on boot:

    sudo systemctl enable chirpstack-gateway-bridge
  17. Install the ChirpStack package:

    sudo apt install chirpstack
  18. Now, you can access ChirpStack at this address: http://[TARGET IP ADDRESS]:8080/

Install Node-RED

  1. 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)
  2. Enable the Node-RED service to start automatically on boot:

    sudo systemctl enable nodered.service
  3. Reboot the system to complete the installation:

    sudo reboot
  4. Now, you can access Node-RED at this address: http://[TARGET IP ADDRESS]:1880/