Setting Up Node-RED on Raspberry Pi 5

Raspberry Pi OS Installation

To set up your Raspberry Pi 5 for use with Node-RED and FlowFuse, follow these steps:

Flashing Raspberry Pi OS

  1. Use the official Raspberry Pi Imager to flash the 64-bit version of Raspberry Pi OS to an SD card.

Flash Raspberry Pi OS on an SD-card

  1. Before writing to the SD card, configure the OS for headless mode, including Wi-Fi, SSH, and authentication settings.

Configure RPi OS before flashing

  1. Write the OS and configuration to the SD card. This process takes about 10 minutes.

  2. Insert the SD card into the Raspberry Pi 5 and power it on. The device should appear on your network after a minute or so.

  3. Connect to the Raspberry Pi using SSH:

    ssh pi@raspberrypi.local
  4. Update and upgrade the system:

    sudo apt-get update
    sudo apt-get upgrade -y

Installing the FlowFuse Device Agent

The FlowFuse Device Agent manages Node-RED on the Raspberry Pi, handling Node-RED versions, upgrades, setup, management, and access controls.

  1. Install the agent using the following command:

    bash <(curl -sL https://raw.githubusercontent.com/FlowFuse/device-agent/main/service/raspbian-install-device-agent.sh)

    This script installs a Node.js runtime, the agent, and configures the Raspberry Pi to run the FlowFuse agent on boot and restart it if it crashes.

Configuring the FlowFuse Agent

To configure the FlowFuse Cloud with your devices:

  1. Log into the FlowFuse team and go to the devices option in the sidebar.
  2. Add a new device by clicking on the top right "Add Device" button. In the popup that opens, enter the name for your device, select the type (optional), and assign the device to an application (optional). Then, click on the "Add" button.
  3. After successfully creating and adding the device, you'll see a popup window with the command that allows you to quickly configure the device with FlowFuse Cloud.

Image showing command device configuration dialog and the command placeholder, where you will find the command to link the device to your FlowFuse team.

  1. Copy that command and run it in your device's terminal. The device agent will start, and it will be configured with FlowFuse Cloud. To verify this, go to the FlowFuse team, click on the devices option in the sidebar, and then click on the device you have configured. You will see the status as running and last seen in green color.

Image showing command device connection status

For more information refer to FlowFuse documentation