NewsSetting Up the Raspberry Pi 5 for Headless Operation with FlowFuse

Setting Up the Raspberry Pi 5 for Headless Operation with FlowFuse

Category articles

The recent announcement of the Raspberry Pi 5 has generated considerable excitement, especially for applications in data collection and automation. Utilizing this new hardware with Node-RED and FlowFuse offers a streamlined, efficient experience for users. This guide explores the process of installing the Raspberry Pi OS and the FlowFuse Device Agent on the Raspberry Pi 5, specifically for headless operation.

Operating the Raspberry Pi 5 in headless mode, meaning without an attached keyboard, mouse, or monitor, is now more accessible than in previous years. This mode used to require considerable setup either before booting the Raspberry Pi or through initial configuration with peripherals. However, the process has been simplified considerably with the use of the official Raspberry Pi Imager.

To start, the Raspberry Pi Imager needs to be installed. Users should select the appropriate 64-bit software version and the SD card for installation. Before writing the OS to the SD card, specific settings must be adjusted for headless mode, including Wi-Fi configuration, enabling SSH, and setting up authentication.

Once these configurations are complete, the OS and settings are written to the SD card, a process that takes about 10 minutes. After the SD card is prepared, it is inserted into the Raspberry Pi, and the device is ready to be booted.

Upon powering the Raspberry Pi, it typically takes a short while for the device to appear on the network. Connection to the device can be established through SSH with the command: ssh pi@raspberrypi.local. It’s advisable to update the system’s repositories and install any available updates using the commands: sudo apt-get update and sudo apt-get upgrade -y.

Installing the FlowFuse Device Agent is the next step. This agent manages the Node-RED environment on the Raspberry Pi, handling version control, upgrades, process management, access controls, and more. Installation is initiated via a Bash script available through a curl command, which installs Node.JS, the FlowFuse agent, and configures the Raspberry Pi to automatically run the agent at boot and restart it in case of crashes.

To integrate the device with the FlowFuse Cloud, it must be configured with a unique token. This token is obtained when registering a new device with the user’s team in FlowFuse. Detailed instructions for this process are available in the FlowFuse documentation. The token is typically provided in a YAML file, which should be copied to /opt/flowforge/device.yml on the Raspberry Pi. This can be done via SCP or through the device’s web interface.

After a reboot, the Raspberry Pi should automatically start the agent, now fully configured. The device will communicate with FlowFuse Cloud, marking it ready for tasks and operations as part of the user’s networked devices.

Michal Pukala
Electronics and Telecommunications engineer with Electro-energetics Master degree graduation. Lightning designer experienced engineer. Currently working in IT industry.