This lab walks you through:
This lab takes about 30 minutes to complete. Note that the lab illustrates onboarding for a Modulo-2, but the general flow is the same for onboarding any Afero development board, with the Wi-Fi setup included only if your board’s radio supports Wi-Fi.
There are no prerequisites for this lab.
Before beginning the lab, you will need:
Download the Afero mobile app for your smartphone. The links below should take you to the appropriate download page for your device, or you can search your app store for “Afero”:
Users in China should be able to access the app through Google Play because it is a free app. Afero does not distribute the app in any other way because the app stores provide a way to update the app when required.
Use the Camera view in the app to scan the QR code sticker on the back of the Modulo-2.
If you’re not prompted to add a device after creating an account, but are brought to the application’s main menu, tap theicon at the top-left of the screen to open the app Settings screen, then tap Add Device in the menu.
If you are unable to scan the QR code with your phone’s camera, tap Manually Add Device at the bottom of the Add Device screen. Type the hexadecimal code printed under the QR code (don’t type the dashes!), then tap Add.
If any part of this process fails, you will be given the chance to rescan and reconnect to the Wi-Fi network. If no Wi-Fi network is available, you can click Cancel and then the board will connect only over Bluetooth low energy. In BLE mode, the board will require an Afero compatible hub device or an active Afero mobile app to connect to the Afero Cloud, so make sure the mobile app is running (and that your device isn’t asleep) when interacting with the Modulo-2.
Note that the Modulo-2 dev board icon is an orange color, indicating the device is online and connected to the Afero Cloud. (The icon will be grey if the device is not connected.)
Tap the Modulo-2 dev board icon to bring up the device screen so you can interact with the board.
Notice the “groups ribbon” running horizontally at the top of the screen; swipe left/right to reveal the groups you created, as well as to access the Settings and Automation screens. Below the groups ribbon, the selected group’s controls are displayed.
Select the LED group from the groups ribbon, then tap On and Off and observe that the dev board LED turns on and off. Also note that the device icon will change color when the LED is on. This happens because the LED on/off control has been defined as the device’s “primary operation”, which we’ll talk about more in the Using the Afero Profile Editor lab.
Select the Button group from the groups ribbon, then press the button on the dev board. Notice how the mobile app UI updates the status of the button as you press it.
You can also tap Remove Device to disassociate the device from your account. If you do remove the device and later want to use the device again, you will need to repeat the steps above to add the device back to your account.
The Modulo-2 development board does not have a GPS or any way to determine its own location. The location set here is completely controllable by you, and can be used to identify similar devices that may be geographically separated. The location will not change if the device is physically relocated unless you change this location later in the device’s Settings.
The time between turning on the LED via the mobile app and the device’s response seems fast enough to think that the smartphone is communicating directly with the Modulo-2, but this is not the case!
The command to turn on the LED travels from the smartphone to the Afero Cloud (via Wi-Fi or LTE on the smartphone), and then the Afero Cloud sends the command back to the Modulo-2 over its Wi-Fi connection, or for Modulo-1, through the mobile app over Bluetooth.
For the Modulo-2, as long as the board is connected to the network, these interactions will work no matter how far away the devices are.
If you have time after completing the basics of this lab, here are some ways you can explore additional features of the Modulo-2 and the Afero Cloud: