Basics
Tutorials
Projects
Interfaces
Integrations
Hardware
Firmware
tools
Documentation

Custom Setup on Raspberry Pi

If you need more permanent solution than BigClown Playground you can install all the services yourself in your system. This guide will help you to install and configure these services:

  • BigClown Gateway bcg

  • BigClown Firmware Tool bcf

  • BigClown Host Tool bch

  • Mosquitto MQTT broker

  • Node-RED

  • The process manager pm2

Differences from the Original Raspbian

This is a brief list of differences:

  • Hostname is hub instead of raspberrypi.

  • The time zone is set to Europe/Prague.

  • The following records were added to the repository APT list:

  • By default, these packages are also installed:

    • mosquitto

    • mosquitto-clients

    • nodejs

    • python3-pip

    • python3-venv

    • dfu-util

    • git

    • htop

    • mc

    • tmux

    • npm pm2

    • npm node-red

    • pip3 bcf

    • pip3 bcg

Setup on Original Raspbian

Apply the following procedure only if you are using Raspberry Pi, on which the original Raspbian distribution is running. This is an alternative way of installing bc-raspbian in [](/doc/tutorials/raspberry-pi-installation/).

Step 1: Log in to the Raspberry Pi using SSH. Detailed procedure is provided in the document Raspberry Pi Login

Step 2: Upgrade all packages

sudo apt update && sudo apt upgrade

Step 3: Install Mosquitto server and clients

sudo apt install mosquitto mosquitto-clients

Step 4: Install Node.js version 8 (required by Node-RED)

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

Step 5: Install Node-RED

sudo npm install -g --unsafe-perm node-red

Step 6: Install PM2

sudo npm install -g pm2

Step 7: Tell PM2 to run Node-RED

Make sure you copy next command exactly with the back-tick symbol `.

pm2 start `which node-red` -- --verbose
pm2 save

Step 8: Tell PM2 to run on boot

sudo -H PM2_HOME=/home/$(whoami)/.pm2 pm2 startup systemd -u $(whoami)
sudo -H chmod 644 /etc/systemd/system/pm2-$(whoami).service

Step 9: Install Python 3 (required by the BigClown Firmware Tool and BigClown Gateway)

sudo apt install python3 python3-pip python3-setuptools

Step 10: Update pip (Python Package Manager) to the latest version

sudo pip3 install --upgrade pip

Step 11: Install the BigClown Firmware Tools

BigClown Firmware Tool bcf, BigClown Gateway bcg and BigClown Host Tool bch.

sudo pip3 install --upgrade bcf bcg bch

Step 12: Add udev rules

echo 'SUBSYSTEMS=="usb", ACTION=="add", KERNEL=="ttyUSB*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", ATTRS{serial}=="bc-usb-dongle*", SYMLINK+="bcUD%n", TAG+="systemd", ENV{SYSTEMD_ALIAS}="/dev/bcUD%n"' | sudo tee --append /etc/udev/rules.d/58-bigclown-usb-dongle.rules

Unplug and plug gateway.

Step 13: Run service for Gateway Radio Dongle

pm2 start /usr/bin/python3 --name "bcg-ud" -- /usr/local/bin/bcg --device /dev/bcUD0
pm2 save