I am developping an app and I want to use the DataHub application in order to read the sensors of my device.
I have a question about the configuration of the observations of DataHub, when I define my observations by using the following command:
dhub set source PATH SRC_PATH
I successfully create an observation, but when I reboot my device, all the configuration is lost.
How could this configuration be persistant?
Furthermore, I want to use the Data Hub command on a .c file how could I integrate it and what are the functions available?
Okay, I could do this, so finally the DataHub configurations are not persistent excepted if it is synced with Octave at the booting (I have tried this but I don’t want Octave)?
And how could I use the dhub CLI commands on another application?
Thank you for your reply, it seems that after installing the non-octave image I have many sensors that are not present on the datahub list like the GPS location, gsm signal etc…
Is it normal?
When installed, the Octave cloudInterface app acts as an “administrator” for the Data Hub. The cloudInterface receives settings from the Octave cloud application and saves it to flash locally. Then, whenever it starts up, it reads the local configuration file and applies those settings to the Data Hub. The Data Hub does not persist those settings itself. You can create your own administrator app that adds your own Data Hub configuration when it starts. As @jyijyi suggested, you can do that using a script or a C program that invokes the dhub command-line tool to do it, or you can use the Data Hub’s Admin API to do it from a C program (this is the approach I would recommend).
To see the documentation for the various Data Hub APIs, go into the Data Hub app’s directory and run make docs. The documentation will appear under a directory called docs/html. You can open the index.html file in a web browser to view it. Even if you want to use a script to control the Data Hub, I recommend having a look at the API documentation anyway, because it explains a few things about the Data Hub that you’ll probably find good to know. Start with the I/O API, then read the Admin API.
it seems that after installing the non-octave image I have many sensors that are not present on the datahub list like the GPS location, gsm signal etc…
The Octave apps do create some resources in the Data Hub, so when not running those apps, those resources won’t appear in the Data Hub. All of that information is available to you via Legato APIs, though. See legato.io for more information on those APIs and how to use them.