Legato 17.6 AirVantage sample application (assetData)


#1

Hello,

I need to make a prototype with Legato/Mangoh green/WP7502 where the application sends data to AirVantage and receives settings and commands from AirVantage.

A sample application that shows how to do that would be greatly appreciated.

I found on Git Hub the following app:
https://github.com/legatoproject/legato-af/tree/master/apps/sample/assetData/assetData

I am not too familiar with Git Hub and I have some questions:

  • is this sample application tested?
  • is it working well?
  • is it compatible with Legato 17.6? If not, which is the suggested Legato version to use?
  • in general, how do I know whether or not a sample app on Git Hub can be used as a tutorial for a specific version of Legato?

BR
Luigi


#2

Hi @luigitondo,

the repository that you are pointing to is the main Legato repository, so the sample apps in there are building and should be functional. If you encounter any issue please report a bug on GitHub (https://github.com/legatoproject/legato-af/issues) or here.

As for the version, these sample apps are kept up-to-date so if you checkout tag 17.06.0, you should have a sample app that works with this Legato version.
Note that to build all sample apps you can do make tests_wp85.


#3

Hi,

I have been working with the sample application “assetData”.

I have:

  • set up my host environment for Legato 17.6;
  • compiled the app ‘assetData’ for WP750x (assetData.wp750x.update);
  • created an AirVantage package for this application (assetData.zip);
  • edited the file ‘manifest.app’ inside the ‘assetData.zip’ to specify the data model used by the app (variables, settings, commands) (see below)
  • uploaded the package to my account on AirVantage; it appears in the dash board of my Mangoh system in the ‘System Applications’ widget;
  • installed the app on my Mangoh board (via command line: “update assetData.wp750x.update <IP"ADDRESS>”);
  • started the application (“app start”) on the target;
  • checked that the application is “running” on the target;
  • checked that the app connects to AirVantage; this happens only once when I start the application;

Now I would need some help with the following questions:

  1. Why can’t I see in AV UI any app data being sent by the app to AV? The app updates the app variables by periodically calling the function ‘ValueUpdate’. Do I need to configure anything to have the data sent to AV?

  2. Why do I see only a few application variables in AV UI (“monitor” page, “system applications” widget, “assetData” application)?
    home1.room1.0.SmartCam
    home1.room1.0.roomName
    home1.room1.0.isVacant
    home1.room1.0.thermostat

  3. How do I issue the asset command defined by the application?

thanks in advance for your help
BR
Luigi

===============
my ‘manifest.app’ file:

<?xml version="1.0" encoding="UTF-8"?>

<app:application xmlns:app=“http://www.sierrawireless.com/airvantage/application/1.0” name=“assetData” type=“assetData-legato-application” revision=“9424ce1344366d25f528206aa8ab579d”>










        <variable path="roomName" type="string" default-label="roomName" />
        <variable path="isVacant" type="boolean" default-label="isVacant" />

        <node path="thermostat" default-label="thermostat">
            <variable path="tempReading" type="double" default-label="tempReading"  />
            <setting path="tempSetting" type="double" default-label="tempSetting"/>
            <setting path="strengthSetting" type="int" default-label="strengthSetting"/>
            <setting path="powerSetting" type="boolean" default-label="powerSetting"/>
            <setting path="lcdtextSetting" type="string" default-label="lcdtextSetting"/>
        </node>

        <node path="fan" default-label="fan">
            <command path="fanControl" default-label="fanControl">
                <parameter id="customText" default-label="customText" type="string" />
                <parameter id="isOn" default-label="isOn" type="boolean" />
                <parameter id="fanMovement" default-label="fanMovement" type="int" />
                <parameter id="fanSpeed" default-label="fanSpeed" type="double" />
            </command>
        </node>
      </node>
    </asset>
  </encoding>
</data>

#4

Hello,

I wonder whether or not it is necessary to upload to AirVantage not just the assetData.zip containing the application compiled for 17.6, but also a custom system bundle where all the other applications that need to be run along with assetData are also included.

BR
Luigi


#5

Hiya,

I’ve spent a couple of weeks on this…

The LWM2M AirVantage service has significantly changed in Legato 17.06 (when compared to 16.10.1).

There is now no explicitly defined app model that has to be uploaded to AV … but the ONLY way I’ve been able to see my data in AV is via the timeline process.

And I found that the Sample App as provided doesn’t work out of the box either - you need to add a Push() function call after Set()ing the data before the data will be pushed up to AV. Previously, Set()ting the data would trigger the LWM2M upload to AV, but this is no longer the case.

I’ve had to go back to 16.10.1 to use AV for my customer at the moment.

ciao, Dave


#6

Ciao Dave,

thanks a lot for your reply: it is good to know that I am not the only one having problems with “assetData” :slight_smile:
I have been (and still am) struggling with this sample application; I think it is important as it demonstrates very important features.

I want to try your suggestions with the Push() function. Is there any documentation/example on how to use it?

thanks again
/Luigi


#7

Hi Luigi,

the assetData sample app was updated for 17.07: https://github.com/legatoproject/legato-af/tree/master/apps/sample/assetData

Could you please have a look and let us know if it works better for you.
If there is any area that you think it should explore more or bugs or there is any surprising behavior, please let us know and we will try to improve things!

Thanks


#8

@CoRfr I just tested the assetData sample to work on patch 17.07.1 and it works like a charm. I feel its now a perfectly working sample which other developers can tweak to develop their application.


#9

Awesome. Thanks for letting us know!


#10

Hi @CoRfr. I followed the same procedure as @luigitondo did, but I got stuck in uploading the app to Airvantage. After I upload the .zip file, the application installation is always in progress. I tried with helloWorld sample app before, the same issue happened and still cannot figure out what went wrong. Could you help me with this?

Besides, it confuses me what is the purpose of uploading app on Airvantage. Is that just to let Airvantage know what variables, settings and commands it can expect in this application from manifest.app? Or otherwise what purpose could be? As mentioned in How To -- Use Airvantage -- Create App Bundles in Legato_Reference_Manual,

This topic provides details on how to build and update app bundles and upload them to Air Vantage to deploy on your target.

I understand this paragraph as Airvantage will deploy this app on the registered target device through air ( upload the app to target via wireless transmission ). But it seems not to be this case since I have to also install manually the app onto device. Well, how to understand this?


#11

@CoRfr Okay i seems like this understanding is correct:

Airvantage will deploy this app on the registered target device through air ( upload the app to target via wireless transmission ).

Here is what I did:

  • Go to Airvantage -> Develop -> My Apps, then press Release with Publish checked and upload the assetData.zip

  • Go to device Monitor, press More -> Install Application, select assetData, with Scheduling of Next Connection.

  • ssh target device and open AT command. Run AT+WDSI=8191, AT+WDSS=1,1 to establish connection to Airvantage.

  • Then the screen displays the following lines:

+WDSI: 4
+WDSI: 6
+WDSI: 23,1
+WDSI: 15

The final result shows OTA update client has finished unsuccessfully. As for why it’s finished unsuccessfully I don’t know.


#12

Hey @davidc, I am hoping you may be able to help me out. If there is no explicitly defined app model that has to be uploaded to AV, is there any documentation on how to send commands to the app from AV? I can run the asset data app and push data to AV, but I can’t seem to find any information of using the app from AV to talk back to the mangoh.

Thanks for your time


#13

Hi Tom, please have a look at the http://legato.io/legato-docs/latest/avExchangeData.html#avExchangeData_avAPI. It documents on how to send commands to the app from AirVantage.