Publish Your Project

The final step in Device Profile creation is Publishing. When you Publish your profile using the Afero Profile Editor, several operations take place:

  • The Device Type, Attribute, and Mobile App UI definitions are pushed to the Afero Cloud.
  • The source you’ve created is used to generate a header file you will include in any MCU code you write that uses afLib.
  • The Device Profile is installed into ASR on your Modulo development board.

Before You Publish

Do the following to prepare for publishing:

  1. Have your mobile device nearby with the Afero app installed, running. Be signed in to your account.
  2. Have your Modulo board connected to a micro-USB power source, either an AC adapter or your computer (not your mobile device).
  3. With the Afero Profile Editor opened to your project, and with Publish selected from the Navigation pane, your window should show a QR Code Generator button, a list of the devices associated with your account, and your device history:

    Publish Project

QR Code Generator

It might be convenient to generate a QR code on the fly. This would be helpful, for example, if you soldered your Modulo onto a board and made it inaccessible for subsequent scanning. To use the generator, click the QR Code Generator button. In the window that appears, type the Association ID, click Generate, and your code will appear. To save the code as a Scalable Vector Graphics (SVG) file, click the Save as SVG button. To generate your device’s QR code, you can also click the little QR code icon just to the right of your Association ID in the Developer Device table.

Developer Devices

The first list shows all devices that belong to your account, including the devices shared with you. For each device, you’ll see:

Name This is the name the end-user will see in the Afero mobile app. You can edit the name here before publishing.
Device Type The name and icon from the Device Type definition you created for this device.
Software Version This version number is unique among all devices and users and is automatically incremented when any new profile is published by any user. This means that your SW Version numbers will increase every time you publish, but the specific number of your “next version” is not dependent exclusively on your current version.
ID The Association ID, which is the number in the QR code that appears on the label of your Modulo. It is used to associate your device with your account.
Status The Bluetooth signal strength between ASR and your mobile device currently running the Afero mobile app.
Test Click the Test button to open the Attribute Tester. From this window, click an attribute to open its value for editing. Any value changes you make are reflected in the Afero mobile app UI.

Click a column heading to reorder or change the sort. Note that sorting works best on columns that display relatively static data, such as Name, Device Type, SW Version, and ID.

Device History

Below the device list is a history of the activity (events) of all your devices between Afero in the past 24 hours. Events include attribute changes (e.g., you can watch the effect of a button-tap in the Afero mobile app that turns on an LED on your device) as well as operations in the Publish sequence (i.e., you’ll be able to watch the publish process here). To see activity for a specific device, use the Device Filter.

For each event you can see:

Timestamp The time when the activity occurred.
Attribute If an attribute was changed by the activity, it is identified here using its unique numeric identifier.
Value If an attribute value was changed by the activity, the resulting value is shown here.
Raw Value The hex string representation of the changed attribute value.

Now, Let’s Publish

  1. With the Afero mobile app active and Modulo powered up, the Status for this device should show a number like -30dBm. Specifying a specific numeric target is complex, but the point is that Status should not read “OFFLINE”. If it does, try restarting the mobile app, cycling power to the Modulo, or restarting the Afero Profile Editor.
  2. Click the orange checkbox next to the ID of the device to which you intend to install.
  3. Click the Publish button in the upper-right of the window.
  4. After a short interval, you should see a banner at the top of the window that tells you the profile has been published and the Over-The-Air (OTA) update is in progress. During the update, you may see log info scroll past in the Device History, including lines such as “The Profile ID for this device was changed from <old ID> to <new ID>”. You may also see the LED on your Modulo flash.
  5. The update of your Modulo is complete when the SW Version data in the Developer Devices table reads the new version number. This indicates that the new profile has been installed, and that the Modulo has restarted and reported its software version to the Afero Cloud.
  6. When the profile is complete, the Afero mobile app should update to display the Control UI you defined for your device. If the update does not happen quickly, try restarting the Afero mobile app.

Once the new Control UI is in place, you should be able to use the controls to change attributes on the associated device!