Any connected device created with an Afero ASR requires an Afero Hub to communicate with the Cloud. Options for an Afero Hub include a dedicated Afero Secure Hub, a smartphone running the Afero mobile app, or the Afero Hub Software package, which allows you to create your own standalone hub. We refer to the latter as an Afero Developer Hub, or Developer Hub for short. Our first release is for Raspberry Pi, or any other ARM-based computer system running Debian Linux.
This Raspberry Pi release includes the following:
To set up an Afero Developer Hub, please use the information in the sections below:
We recommend running the Developer Hub on the latest Raspbian “Buster” OS, however any version of Buster, and any version of Stretch (version 2017-08-16 or newer) are supported. Raspian can be downloaded from https://www.raspberrypi.org/downloads/raspbian/.
We require ARM-based systems running Debian Linux or any Debian variant:
We will be adding support for other small computing systems as demand and time permits.
The Afero Hub Software is not particularly platform- or architecture-specific and should work on comparable systems. We have tested most extensively with Raspberry Pi Models 3, 4, and Zero W; we recommend using those systems for your Developer Hub.
The Raspbian OS allows you to configure the Wi-Fi network from your local PC before booting it in the Raspberry Pi.
Paste the text shown below into this file, replacing the Wi-Fi network SSID (network name) and password with the proper values for your Wi-Fi network. If you reside outside the US, replace the “country” setting with the proper two-letter country code.
country=US ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="your_wifi_ssid" scan_ssid=1 psk="your_wifi_password" key_mgmt=WPA-PSK }
passwd
command./etc/wpa_supplicant/wpa_supplicant.conf
with an encrypted version using the wpa_passphrase
utility.You can install the Afero Hub Software in either of two ways. The first, via APT repository, is recommended. The second, manual install, is there if you need it.
Afero provides a Debian Repository for the packages we publish. If you add our repository to your system’s Advanced Packaging Tool (APT) sources list, you can install and update packages through the normal Debian package tools, such as aptitude
and apt-get
.
Run the following commands to download a script that will add Afero to your APT sources:
$ wget https://cdn.afero.io/repo/deb/addrepo.sh $ bash ./addrepo.sh
apt-get update
as part of the script. This will take a few minutes to run.$ sudo apt-get install afero-hub
This will fetch the afero-ble and afero-hub packages as well as any other prerequisite packages you may need.
During installation, you will be prompted to accept the Afero Developer Terms of Service, which is the license that covers your use of the Afero ble and hub packages.
Skip down to Add the Virtual-Hub Device to Your Account to continue.
If you don’t wish to use our package repository, or if you’re installing these packages offline, you may download them manually from the following URLs:
If you intend to install these packages offline, you will also need to download the html2text, qrencode, libqrencode3, and bluetooth
packages, either from a connected Debian system (with the command: apt-get download html2text bluetooth qrencode libqrencode3 libpng12-0
), or fetch them online from https://packages.debian.org/stretch/allpackages/.
Install these packages with the following commands:
$ sudo dpkg -i html2text*.deb libpng12-0*deb libqrencode3*.deb qrencode*deb bluetooth*deb $ sudo reboot $ sudo dpkg -i afero-ble*.deb
You will be prompted to accept the Afero Developer Terms of Service, which is the license that covers your use of the Afero ble and hub packages.
$ sudo dpkg -i afero-hub*.deb
Continue with Add the Virtual-Hub Device to Your Account.
The installation of the Hub Software package will create a virtual-hub device that you can connect to your Afero account by scanning a QR code, just as with other devices such as Modulo. Follow the steps below:
If the QR code won’t scan for some reason, tap Manually Add Device and type the alphanumeric Association ID listed below the QR code.
At this point, installation is complete, and your Developer Hub is ready to use! For future reference, we’ve included instructions for managing your hub, directly below.
The Afero Hub Software provides two daemons, beetle and hubby (the process name of Afero Hub Software), which are managed through the systemd init system. They automatically start when the package is installed and when the system boots; but they can also be controlled manually.
Use the following commands to display the state of the two daemons:
$ sudo systemctl status beetle $ sudo systemctl status hubby
You will see output similar to the following for beetle:
$ sudo systemctl status beetle ● beetle.service - Afero BTLE Daemon Loaded: loaded (/lib/systemd/system/beetle.service; enabled) Active: active (running) since Fri 2017-09-08 12:17:12 EDT; 16min ago Docs: man:beetle Main PID: 715 (beetle) CGroup: /system.slice/beetle.service └─715 /usr/bin/beetle
If the status for hubby does not report “active (running)
” but instead reports “failed
”, it is possible that your Hub Software configuration has been damaged. If this happens, launch the mobile app, select your hub, and tap Settings > Remove Device. Then run the following command to re-create a QR code, which you will then re-scan to attach the Hub Software to your account again:
$ sudo dpkg-reconfigure afero-hub
Under normal circumstances, you should not have to manually stop and restart the Hub Software daemons; but if you must, the following commands will do the trick.
To manually stop the daemons, use:
$ sudo systemctl stop beetle
Stopping the beetle daemon will automatically stop the hubby daemon.
To manually start the daemons, use:
$ sudo systemctl start hubby
Starting the hubby daemon will automatically start the beetle daemon.
If for some reason you remove the virtual-hub device from your Afero account, or if the virtual-hub stops working, you can easily re-add it to the same or another Afero account without re-installing the software. To do this, run the following command on your system:
$ sudo dpkg-reconfigure afero-hub
You’ll be asked if you want to re-build the hub configuration:
Answer yes if your virtual-hub device has stopped working, especially if there are messages in /var/log/syslog
that indicate the device’s configuration has been damaged. By answering yes, the configuration will rebuild and allow you to add a new hub-device by scanning a new QR code.
If the old virtual hub remains in the mobile app even after you’ve added the new device, select the old device icon and tap Remove Device to remove it from your account.
You can remove, re-install, and update these packages using normal Debian package commands.
To remove the software but keep your configuration intact (to preserve your virtual-hub device), run:
$ sudo apt-get remove afero-hub afero-ble
To remove the software along with your associated configuration, first remove the virtual-hub device from your Afero account via the mobile app, then run:
$ sudo apt-get remove --purge afero-hub afero-ble
apt-get
), do one of the following.
To remove the software but leave the virtual-hub device intact, run:
$ sudo dpkg -r afero-hub afero-ble
To remove both the package and the virtual-hub device, run:
$ sudo dpkg -P afero-hub afero-ble
When we release a new version of the Hub Software, you can update the packages through the normal apt-get
process:
$ sudo apt-get install --only-upgrade afero-ble $ sudo apt-get install --only-upgrade afero-hub
Upgrading the packages will preserve the virtual-hub device attached to your account.
Support for the Afero Hub Software is provided through the project's GitHub Issue Tracker. More sensitive questions (e.g., concerning your credentials) can be sent to developer@afero.io.
The Afero Hub Software daemons write information to /var/log/syslog
so if you have any issues with the operation of the Hub Software please be sure to save a copy of /var/log/syslog
before you contact us.