Custom Setup on macOS

Introduction

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

  • HARDWARIO Gateway bcg

  • HARDWARIO Firmware Tool bcf

  • HARDWARIO Host Tool bch

  • Mosquitto MQTT broker

  • Node-RED

  • The process manager pm2

Playground Setup on macOS

  • open Terminal application

Step 1: Install the driver for the HARDWARIO Radio Dongle

Step 2: Restart your computer

Step 3: Install Homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Step 4: Upgrade all packages

brew update && brew upgrade

Step 5: Install Mosquitto server and clients

brew install mosquitto
brew services start mosquitto

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

brew install node

Step 7: Install Node-RED

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

Step 8: Install node-red-dashboard for graphs, gauges, buttons

cd ~/.node-red/
npm i node-red-dashboard

Step 9: Install PM2

sudo npm install -g pm2

Tip

PM2 is a process manager that will help you to start Node-RED and other processes on boot.

Step 10: Tell PM2 to run Node-RED

pm2 start `which node-red`

Step 11: Tell PM2 to run on boot

pm2 save
pm2 startup

Caution

Now you must follow the instructions provided by the command pm2 startup systemd.

Step 12: Install Python 3 (required by the HARDWARIO Firmware Tool and HARDWARIO Gateway)

brew install python3

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

sudo pip3 install --upgrade --no-cache-dir pip

Step 14: Install the HARDWARIO Firmware Tool

sudo pip3 install --upgrade --no-cache-dir bcf

Step 15: Install the HARDWARIO Gateway

sudo pip3 install --upgrade --no-cache-dir bcg

Step 16: Plug the HARDWARIO Radio Dongle into a USB port

Step 17: List the available devices

bcf devices

Tip

You can use -v parameter to see verbose information about the connected devices (possibly helping you to identify them).

Step 18: Upload the latest firmware into the HARDWARIO Radio Dongle

bcf update
bcf flash hardwario/bcf-gateway-usb-dongle:latest

Step 19: Start the HARDWARIO Gateway as PM2 service

pm2 start `which python3` --name "bcg-ud" -- `which bcg` --device ...

Important

Replace ... with the device listed using bcf devices.

Caution

If you want to update firmware in the Radio Dongle, first you have to stop bcg by the command pm2 stop bcg-ud. After update, restart the service by the command pm2 restart bcg-ud.

Step 20: Open your web browser with the URL

Playground Upgrade on macOS

Upgrade all the packages

brew update && brew upgrade

Upgrade Node-RED

sudo npm update -g node-red

Upgrade PM2

sudo npm update -g pm2

Upgrade the HARDWARIO Firmware Tool

sudo pip3 install --upgrade --no-cache-dir bcf

Upgrade the HARDWARIO Gateway

sudo pip3 install --upgrade --no-cache-dir bcg