element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
In the Air Design Challenge
  • Challenges & Projects
  • Design Challenges
  • In the Air Design Challenge
  • More
  • Cancel
In the Air Design Challenge
Blog [Firecracker Analyzer] Obligatory Guide - Using Sierra Air Vantage with your Device
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ipv1
  • Date Created: 16 Feb 2015 7:03 AM Date Created
  • Views 1256 views
  • Likes 2 likes
  • Comments 6 comments
  • iot_firecracker
  • sierra_wireless
  • airvantage
  • ip_iot
  • internet_of_things
  • in_the_air
Related
Recommended

[Firecracker Analyzer] Obligatory Guide - Using Sierra Air Vantage with your Device

ipv1
ipv1
16 Feb 2015

  • Prelude
  • Introduction
  • Setting up Air Vantage
    • Setup the App
    • Setup the gateway
    • Meet NodeJS
      • Step 0.
      • Step 1.
      • Step 2.
  • Conclusion

 

Prelude

The challenge is to create a system for air quality sensing which can operate without human intervention. My idea is to create a system that can measure air quality indoors and outdoors and log this data to the Sierra Wireless System. For the indoor unit, I have a CC3200 power unit which can measure temperature and an MICS5524 sensor which can measure air pollutants and connects to the cloud over wifi. It is powered by the TI Fuel Booster Pack and charged wirelessly with the Wurth Electronics Wireless Charging System. All parts are TI and Wurth Electronics.

 

The second outdoor unit is made up of the FR5969 Launchpad and uses the Alphasense Sensor for SO2 measurements and a Dust Sensor to measure particulate matter. This data is transmitted via CC2500 modules wirelessly to the BeagleBone Black which also has a CC2500. The BBB acts like a gateway device and sends the data to the Sierra Wireless Cloud via Wifi. This can be expanded to include more nodes to connect to this gateway and will allow future work to be done.

 

In addition to this functionality, I created a small board that can harvest solar energy and store it in a Li-Po battery. BQ25504, TPS61200 and TPS62740 are used to create a power harvesting circuit and the details are explained.

 

In this post I present a tutorial on how you can get started with using Sierra's Air Vantage Cloud Storage system.

 

Introduction

One of the sponsors is Sierra Wireless who provide cloud based services for embedded devices and gateways. In the world of IoT, devices connected to the Internet can be easily managed using platforms like Air Vantage where devices can send their status like health, signal strength and other diagnostic info and a bulk of devices can be monitored easily from a single online point. Alerts can be generated as well as action can be taken for IoT Gateways. As a thanks to our sponsors, I wanted to create a graphical tutorial which lets 'developers' and 'hackers' to create their own little system and I found out a little late that there is already a tutorial on the subject at https://doc.airvantage.net/display/USERGUIDE/Using+MQTT+with+AirVantage

A lot of discussion has also happened on the topic as well so I offer my two cents worth here.

 

The objective is to setup Air Vantage Cloud services for MQTT and then connect to it via an embedded device. In this tutorial I use NodeJS BUT the script runs on my PC to demonstrate portability of the code. I have been able to run the same code on the BeagleBoneBlack and the snippets have been modified according to the instructions given at https://doc.airvantage.net/display/USERGUIDE/Enable+BeagleBone+Black+With+AirVantage+using+MQTT

 

Setting up Air Vantage

This tutorial is very graphic hence viewer discretion is advised image What that means is that most of the tutorial is in screenshots and quite self explanatory.

Setup the App

When you login for the first time, you see...

556e97919a6fb05277dd025062b4cdb7.jpg

The first thing we need to do is create something called an APP. This will basically define how data is communicated which in our case is via MQTT. Additionaly we define variables that will be used in the communications.

In my case, I am sending temperature, Dust and Hydrogen Sulphide Concentration in this instance. I have a different system which sends temperature and VOCs but that's a different tutorial since the code is in cpp. Here is how you do it.

e8c50d3360f6a4d392aaf6951f83a583.jpg

Next we need an APP. I am attaching mine at the end of the tutorial but feel free to type up yours or modify the given file which looks like.

0af38b33595882a5c42bd9f2bb9f2f1c.jpg

In the data section, remember to note the asset ID and variable paths. These will later on be used like...

BeagleBoneBlack.temperature etc where BeagleBoneBlack is my 'id' specified here. Put it in a zip file by any name. Next...

3a2d60ac620e4581c8e015b08a1d047b.jpg

And then...

306eeafd7e742ddd1ff809e411dc62fb.jpg

And then...

f749f434869e3d635e00573849c76755.jpg

And then...

871e998f1f988f034dcacaa3d28e19cf.jpg

And then...

e01b54199eabd57e5ee5b2fa38fe262a.jpg

And then...

c99ef1f9c7612b353c2bff629c31da75.jpg

And then...

c2e944a650ca7bec81df04e0760ad88a.jpg

And then...

aad733fadd34fc2d24870b30fa6cbcc1.jpg

And then...

e928c2e9161de97232a932cc708fe70e.jpg

And then...

fe14fe264e6542aa1e13d48988707591.jpg

And then...

 

You are done with setting up the basic APP! Great

 

 

Setup the gateway

The next thing to do is set up the gateway. The app is released but not published hence we need to create credentials to allow login and post data. This is pretty simple.

In the inventory section we currently have no systems... so click click click

6197d9dcad9e9a4527304c9886247bd4.jpg

And then...

d0d0cd8462668bf95dbcd856c9748e6a.jpg

We need a name and in the gateway section enter your BBB serial Number. This is just a unique identified and since I am using a PC, I just used a random sequence. For the Applications, we already have one and when you select the drop down, you should see some familiar name(s).

77f2a11e27a8b692a140dabacc4922ab.jpg

If you did not add credentials then it will ask you for em. Enter a password to be used with MQTT.

4ab92cd1423bd2f0ea4cc2689ea4a7af.jpg

You should be able to see the above.

 

 

Next we need to activate it...

7757aa752d91491f8cdb6e84244bd4c5.jpg

 

 

0d6734b1271206013c25ef0bf05be33a.jpg

Click click click and then...

You should end up with somthing like this...

1328b0e4e1d05ed7cb6f58f16dc531e2.jpg

Clicking on the app will take you to...

d9e34868fe28e92e4ba83c893177d28b.jpg

 

So we have no data. BUT we can see our variables. Excellent. Now to push some data onto it.

 

Meet NodeJS

For those who don't know what NodeJS is, it javascript that runs without a browser. You can run simple scripts and with the help of libraries you can access GPIOs and connect to the internet. With more libraries, we can even create a webserver entirely on NodeJS(See NodeJS and Express if interested). All we want here is to use MQTT with a little JS since the BeagleBoneBlack can run JS from the Cloud9 IDE. I want to do my development on my 100year old PC since it generates a lot of heat and its still winter here image

I have installed NodeJS on my PC and have created a folder to work in.

In a NodeJS Command Prompt with NPM setup, I navigate to the folder where I want to develop the things.

 

Step 0.

This is not mandatory but I create a NodeJS package so that every time someone uses it, the dependencies are automatically installed as well. Type..

npm init

Enter the name and revision and author name. The entry point is by-default the name of the folder but make sure you name your .js script with the name entered here. Leave the rest blank and enter yes at the end.

 

Step 1.

Install mqtt if not already installed by typing..

npm install mqtt --save

the --save saves the version of mqtt library being used.

 

Step 2.

Create the script with the name used as entry point. Mine looks like this...

73ef4a9c8a28d7a003614efaf0d173ea.jpg

Save and in your node command prompt...

5b3b9957b47c7396fff5c8d2739271f6.jpg

That worked... right?

On the airvantage site, we refresh and then...

d011d9b7b1af79e88312c85167141194.jpg

Click on one of the buttons to see a graph like...

f95f6b2392a10a4b6fd0a62772dc51fb.jpg

 

 

Success!

 

Conclusion

This is just the tip of the iceberg and I just took longer to do a simple thing. I hope this tutorial is helpful for those who wish to use the airvantage platform and they get a running start. If it was helpful, say hi and gimme a pingback. If there is something I missed, lemme know and I will do the needful.

Thanks,

IP

 

EDIT1. Since I could not attach a .js, the script is given below.

var mqtt = require('mqtt');
var port = 1883;
var server = "na.airvantage.net";
var serialnumber = "3713BBBK7777"; //serialnumber
var password = "Make your own password";

var mqtt_options = {username: serialnumber, password: password};


// I know 'createClient' is depreciated but it has a lot of examples for it. 
var client = mqtt.createClient(port, server, mqtt_options);

console.log("Client started");


//Send values
console.log("Sending value");

//Publish a message on the right topic
var payload= {};
var timestamp = new Date().getTime();

payload[timestamp] = { "BeagleBoneBlack.temperature": 16.2, "BeagleBoneBlack.dust": 10.0, "BeagleBoneBlack.hydrogensulphide": 2.0 };
client.publish(serialnumber + '/messages/json', JSON.stringify(payload));


console.log(payload);
console.log('Done');
client.end();

 

The BBB.app is...

<?xml version="1.0" encoding="ISO-8859-1"?>
<app:application xmlns:app="http://www.sierrawireless.com/airvantage/application/1.0"
        type="com.wordpress.embeddedcode.bbb"
        name="In The Air App for BBB"
        revision="0.0.2">
  <capabilities>
  
    <communication>
      <protocol comm-id="SERIAL" type="MQTT" />
    </communication>
    
    <data>
      <encoding type="MQTT">
        <asset default-label="BeagleBoneBlack" id="BeagleBoneBlack">
          <variable default-label="Temperature" path="temperature" type="double"/>
          <variable default-label="Dust" path="dust" type="double"/>
   <variable default-label="HydrogenSuplhide" path="hydrogensulphide" type="double"/>
        </asset>
      </encoding>
    </data> 

  </capabilities>
</app:application>

  • Sign in to reply

Top Comments

  • janisalnis
    janisalnis over 10 years ago +1
    "Create APP, publish, setup, activate, NodeJS..." It is a long road to get sensor values to the Internet. Thanks for publishing tutotorial how to proceed for a beginner. I will try some day to get connected…
  • mcb1
    mcb1 over 10 years ago +1
    I certainly looks like a mission. Your tutorial should help anyone wanting to try this ...thanks for sharing it. Mark
  • Former Member
    Former Member over 10 years ago in reply to ipv1 +1
    Hi Inderpreet Singh , Thanks for publishing your very interesting project! As a matter of fact I am also into Crackers, specifically refineries that need to get rid of Sulphur. The Alphasense sensor seems…
  • DAB
    DAB over 10 years ago

    I look forward to seeing your results after a good fireworks display.

     

    The data should include some really interesting results.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 10 years ago in reply to ipv1

    Hi Inderpreet Singh,

    Thanks for publishing your very interesting project! As a matter of fact I am also into Crackers, specifically refineries that need to get rid of Sulphur.

    The Alphasense  sensor seems not accurate enough to get the ppb/hour accuracy needed to compare with local government monitoring stations.

    However it seems to be the best you can get.

    Arduino is also quite popular for the iot. Since I have one, intend to get it in the "air" for this purpose image 

    http://www.element14.com/community/message/153430/l/how-to-measure-so2-as-by-product-from-the-claus-process-in-refinerie…

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ipv1
    ipv1 over 10 years ago in reply to mcb1

    Thank you sir,

    Air vantage is a bit confusing to be honest and is meant for IoT gateway monitoring and maintenance. In theory it should be possible to do the same with a device such as a BBB or RPi.

    I am also looking into Kura as an IoT gateway but it is a long term endeavour and will be bugging lots of people to make it work. image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 10 years ago

    I certainly looks like a mission.

     

    Your tutorial should help anyone wanting to try this ...thanks for sharing it.

     

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ipv1
    ipv1 over 10 years ago in reply to janisalnis

    It is and I think there is a lot more to it. There are a lot many more things that can be done but I think a lot of people spend too much energy in getting started and then drop it. Hence this tutorial and I hope someone writes a sequel image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube