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:
Please note the hardware and operating system requirements listed below.
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 other comparable systems. We have tested most extensively with the Raspberry Pi Model 3; we recommend using that system for your Developer Hub.
The Afero Hub Software packages are only supported on the Raspberry Pi running the Raspbian OS, and (for now) only release 2016-03-18 of the Raspbian OS.
sudo raspi-config, making sure to select option 1 (Expand Filesystem).
You can install the Afero Hub Software in either of two ways. The first, via APT repository, is preferred.
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
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 updateas 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. These packages use
supervisor(1) to launch and monitor their processes, so that utility will be installed if you don’t already have it.
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 Adding 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
supervisor, qrencode, and bluetooth packages, either from a connected Debian system (with the command:
sudo apt-get download supervisor bluetooth qrencode) or fetch them online from https://packages.debian.org/jessie/allpackages/.
Install these packages with the following commands:
$ sudo dpkg -i supervisor*.deb qrencode*deb bluetooth*deb $ 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 Adding 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 you do with other devices such as Modulo.
The steps are listed 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.
The software will then connect to the Afero Cloud to associate the Hub Software with your account.
At this point, installation is complete, and your hub is ready to use!
The Afero Hub Software provides two daemons, beetle and hubby (process name of Afero Hub Software), which are managed through the
supervisor(1) utility. They automatically start when the package is installed, and also when the system boots, but they can be controlled manually as well.
Use the following command to display the state of the two daemons:
$ sudo supervisorctl status
You will see output similar to:
beetle RUNNING pid 8324, uptime 5 days, 2:50:44 hubby RUNNING pid 8325, uptime 5 days, 2:50:44
If hubby does not say RUNNING but instead says STARTING or BACKOFF, it is possible that your Hub Software configuration has been damaged. Launch the mobile app, select your hub, then tap Settings/Remove Device. Then run the following command to re-create a QR code to re-scan and attach the Hub Software to your account again:
$ sudo dpkg-reconfigure afero-hub
You should not, under normal circumstances, have to manually stop and restart the Hub Software daemons; but if you do, the following commands will do the trick:
To stop the daemons, use:
$ sudo supervisorctl stop hubby beetle
To manually start the daemons, use:
$ sudo supervisorctl start hubby beetle
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:
/var/log/syslogthat indicate the device’s configuration has been damaged. Answering yes will rebuild the configuration, and allow you to add the hub-device by scanning a new QR code.
You can remove, re-install, and upgrade 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 upgrade the packages through the normal
$ 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 Afero Developer Forums at https://forum.afero.io. More sensitive questions (e.g., concerning your credentials) can be sent to firstname.lastname@example.org.
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.