{"id":22868504,"url":"https://github.com/datavenueliveobjects/liveobjects-for-xcubecellular-st","last_synced_at":"2025-07-17T14:34:26.679Z","repository":{"id":117578223,"uuid":"449765957","full_name":"DatavenueLiveObjects/LiveObjects-for-XCubeCellular-ST","owner":"DatavenueLiveObjects","description":"The library written in C offers an SDK for developing embedded LiveObjects applications on STMicroelectronics platforms. This is based on the XCubeCellular project from ST.","archived":false,"fork":false,"pushed_at":"2022-01-27T14:56:18.000Z","size":3330,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T10:51:20.425Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DatavenueLiveObjects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-19T16:18:40.000Z","updated_at":"2022-01-27T14:56:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"80f814f6-a2d6-40dd-be2c-ce611bb7e202","html_url":"https://github.com/DatavenueLiveObjects/LiveObjects-for-XCubeCellular-ST","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DatavenueLiveObjects/LiveObjects-for-XCubeCellular-ST","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatavenueLiveObjects%2FLiveObjects-for-XCubeCellular-ST","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatavenueLiveObjects%2FLiveObjects-for-XCubeCellular-ST/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatavenueLiveObjects%2FLiveObjects-for-XCubeCellular-ST/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatavenueLiveObjects%2FLiveObjects-for-XCubeCellular-ST/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DatavenueLiveObjects","download_url":"https://codeload.github.com/DatavenueLiveObjects/LiveObjects-for-XCubeCellular-ST/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DatavenueLiveObjects%2FLiveObjects-for-XCubeCellular-ST/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265617168,"owners_count":23798983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T12:35:30.078Z","updated_at":"2025-07-17T14:34:26.606Z","avatar_url":"https://github.com/DatavenueLiveObjects.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n# Introduction\n\nThe document describes the installation as well as the use of the LiveObjects library on the platforms\nHardware from STMicroelectronics.\nThe LiveObjects library is based on version 6.1 of XCubeCellular. It is a middleware offered by\nSTMicroelectronics which makes it possible to develop TCP/IP applications (HTTP, MQTT, etc.)\ntransparent on the basis of API.\nThe LiveObjects library is compatible with version 5.2 of XCubeCellular. She uses libraries\nadditional such as:\n\n- Json\n- XCubeCellular Library\n- FreeRTOS\n\nThe application runs on the FreeRTOS real-time OS (https://fr.wikipedia.org/wiki/FreeRTOS)\nIoT devices communicate with LiveObjects in MQTT. This stack is integrated in this same\nlibrary.\nIt is validated on the following cards:\n\n- Discovery P-L496G-CELL02 + the SEQUANS GSM01Q cellular module\n\n- STEVAL-STWINKT1 + the SEQUANS GSM01Q cellular module\n  But it is possible to port the library to other STM32 platforms.\n\n  \n\u003cp align = \"center\"\u003e\n\u003cimg src = \"image/1.png\"\u003e\n\u003c/p\u003e\n\u003cp align = \"center\"\u003e\nFig.1 - P-L496G-CELL02\n\u003c/p\u003e\n\n\u003cp align = \"center\"\u003e\n\u003cimg src = \"image/2.png\"\u003e\n\u003c/p\u003e\n\u003cp align = \"center\"\u003e\nFig.2 -STEVAL-STWINKT1\n\u003c/p\u003e\n\nThe licence is MIT\n\n# Installation\n\n### Installation of the development environment\n\nThe development environment used is STM32CubeIDE. It is based on the Eclipse IDE. \nHe can be downloaded directly from https://www.st.com/en/developmenttools/stm32cubeide.html\n\nThe installation procedure is described for all environments in the document titled **\"STM32CubeIDE Installation guide – User manual\"**\n(https://www.st.com/resource/en/user_manual/dm00603964-stm32cubeide-installation-guidestmicroelectronics.pdf)\n\nThe library can be downloaded from the Orange Github at https://github.com/Orange-OpenSource. \n\nThe project is called LiveObjects-4-XCubeCellular and is available under the **MIT** license.\nFor a good follow-up of the project it is advisable to use the decentralized version management tool **Git** (https://fr.wikipedia.org/wiki/Git).\n\nThe project only embeds the part specific to Live Objects. It is therefore essential to install XCubeCellular from the STMicroelectronics repository (http://)\n\n\n\n\n## First step : Create LiveObjects account\n\nCreating a LiveObjects Account\nDeveloping an application requires creating a LiveObjects account.\nRegistration at https://liveobjects.orange-business.com/#/liveobjects is free for a limited number of items.\nAfter recording, be sure to save the Master key displayed on the screen. This one can no longer be consulted.\n\n- Connected objects mainly use MQTT to interface with the platform. To do this, a key must be created to communicate through this protocol.\n  Go to the Administrator menu and then click on API keys to the left of the screen.\n\n\n\n\u003cp align = \"center\"\u003e\n\u003cimg src = \"image/3.png\"\u003e\n\u003c/p\u003e\n\n\n\n- Then click on the Add button\n\n  \n\n  \u003cp align = \"center\"\u003e\n  \u003cimg src = \"image/4.png\"\u003e\n  \u003c/p\u003e\n  \n  \n  \n  \n- Enter the different fields such as name, description, etc… then select “MQTT Equipment” and click on create.\n\n\n\n\u003cp align = \"center\"\u003e\n\u003cimg src = \"image/5.png\"\u003e\n\u003c/p\u003e\n\n\n\n- The key is then generated. It is necessary to store or save it to its future use within the embedded application\n\n\n\n\u003cp align = \"center\"\u003e\n\u003cimg src = \"image/6.png\"\u003e\n\u003c/p\u003e\n\n\n\n## Last step : Import LiveObjects4XCubeCellular project\n\nAfter installing the XCubeCellular library, place the LiveObjects project directory in the root directory **/XCubeCellular-V6.1**\n\nN.B: The library must imperatively be placed at this level to be able to be used\n\n\n\n\u003cp align = \"left\"\u003e\n\u003cimg src = \"image/7.png\"\u003e\n\u003c/p\u003e\n\nThe library comes with an example of a basic application for connecting and exchanging data with the LiveObjects platform.\n\nOpen the STM32CubeIDE development environment, then click on File-Import\n\n\u003cp align = \"left\"\u003e\n\u003cimg src = \"image/8.png\"\u003e\n\u003c/p\u003e\n\n```sh\nThe project type selection window appears.\n```\n\n\u003cp align = \"left\"\u003e\n\u003cimg src = \"image/9.png\"\u003e\n\u003c/p\u003e\n\nClick on the Directory button “Import ac6 System Workbench for STM32 Project” then select the directory:\n\n**XCubeCellular-V6.1\\LiveObjects\\samples\\DiscoL496_GM01Q** for the Discovery L496 GM01Q\n\nand\n\n**XCubeCellular-V6.1\\LiveObjects\\samples\\STWINKT1_GM01Q** for STWINKT1\n\n\n```sh\nThe project appears in the project explorer as above.\n```\n\n\n\u003cp align = \"left\"\u003e\n\u003cimg src = \"image/10.png\"\u003e\n\u003c/p\u003e\n\n\n## Running application\n\n### Setting up the application\n\nAll LiveObjects connection parameters are defined in a single file that carries the name **liveobjects_conf.h**\n\n\u003cp align = \"left\"\u003e\n\u003cimg src = \"image/11.png\"\u003e\n\u003c/p\u003e\n\n\n\n- Enter the previously generated password (API key) at the occurrence ***MQTTCLIENT_DEFAULT_PASSWORD***\n\n- Enter the subject name (clientID) where applicable ***MQTTCLIENT_DEFAULT_CLIENTID***\n- Modify the StreamID if needed at the ***MQTT_DEFAULT_STREAM_ID*** occurrence\n\n\n\n![image-20220125153256871](C:\\Users\\Topaze\\AppData\\Roaming\\Typora\\typora-user-images\\image-20220125153256871.png)\n\n\n### Setting up the application\n\nCompile and run the program. This one, after connection, will send the IMEI, the IMSI as well as the name\n\nfrom the module to the LiveObjects cloud in JSON format.\nIt is possible to check the status of the connection as well as the data sent on the LiveObjects dashboard.\n\n![image-20220125153718854](C:\\Users\\Topaze\\AppData\\Roaming\\Typora\\typora-user-images\\image-20220125153718854.png)\n\n\n\n![image-20220125153817453](C:\\Users\\Topaze\\AppData\\Roaming\\Typora\\typora-user-images\\image-20220125153817453.png)\n\n\n\n### App structure \n\nThe application runs on FreeRTOS. All the libraries are in the project directory “Third_Party” itself present in “Midllewares”.\n\n\n\nThere you can find the source code of:\n- FreeRTOS OS\n\n- Json-parser open source library\n\n- From the LiveObjects library\n\n  Note that the LiveObjects library includes its own MQTT stack. Indeed, this is intrinsic to the library.\n  The ST libraries are in the “Cellular”.\n  It is recommended not to modify all of these files, otherwise you may create malfunctions of the final application.\n  The application is placed in the “Application/User” directory. We find there the file “main.c” which\n  instantiates the main Thread which, itself instantiates the one that manages the execution of the cellular part (liveobjects_app.c).\n\n### Cellular Connectivity Initialization\n\nWe will focus later on the process present in the file **liveobjects_app.c**\n\nAll LiveObjects APIs are defined in the **mqtt_liveobjects.h** file. This is documented under Doxygen.\nWhen starting the Thread LiveObjects task, a LiveObjects instance is created by calling the lo_create() function. If successful, it returns a handle that will be used for all calls to APIs.\n\nYou must then assign the configuration by calling **lo_set_default_config(handle);**\nThis function assigns to the handle all the connection parameters defined in the file of **config “liveobjects_conf.h”**\nIt is nevertheless possible to define them ad hoc using the **lo_set_default_config function.**\n\nFollowing this, we can connect to the network by calling the function **lo_connect_mqtt(handle)**. This function initializes the module, hooks up the cellular network and then initiates an MQTT connection to LiveObjects. If it succeeds, we define the different callback and subscriber.\n\n\n\nIn our example, we want to be notified of the receipt of orders:\n**lo_set_command_callback(handle, lo_command_callback);**\n**lo_command_subscribe(handle);**\n\n### Publishing a message to the LiveObjects platform\n\nFor the proper functioning of the sending and the response of an MQTT message, it is essential to periodically check that the connection is still active using the function\n**lo_is_connected(handle)** and then call the **lo_synchronize(handle)** method which allows processing of MQTT exchanges and, if necessary, triggering callbacks.\nIn our example we publish the Json message which includes the IMEI, the IMSI as well as the name of the device with the following procedures:\n\n```sh\nsprintf(buffer, (const char*)\"{\\\"opname\\\":\\\"sequans002\\\",\\\"imei\\\":\\\"%s\\\",\\\"imsi\\\":\\\"%s\\\"}\",  cellular_info.imei, cellular_sim_info.imsi);\nlo_publish_data(handle, (const char*) buffer);\n```\n\n\n### Programming and sending a command\n\nIt is possible, in our example, to receive commands from LiveObjects.\nFrom the LiveObjects site, go to the list of devices then select the equipment on which the command must be sent\n\n\n\n\n\u003cp align = \"left\"\u003e\n\u003cimg src = \"image/16.png\"\u003e\n\u003c/p\u003e\n\n\n\nThe equipment supervision screen appears. We will notice a list of possible actions on the left of the screen, including the one for sending commands (Downlink).\n\nClick on this item to enter the input menu.\n\n\u003cp align = \"left\"\u003e\n\u003cimg src = \"image/17.png\"\u003e\n\u003c/p\u003e\n\n\n\nThen on the button \"Add an order.\n\n\u003cp align = \"left\"\u003e\n\u003cimg src = \"image/18.png\"\u003e\n\u003c/p\u003e\n\nThe command is made up of the name of the request (json “req” tag), then the argument (in our case of **“state”** with the value **“true”**). It is also mandatory to define the duration maximum Pending.\n\nFollowing this the validation will publish the message in MQTT. The test application will receive the command.\nThe callback **lo_command_callback(int64_t cid, const char* req, const json_value* arg)**is called. We can perform the tasks associated with the request (published in the variable req and arg)\nWe will not forget to call the **lo_publish_ack_command** function to validate or invalidate the command\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatavenueliveobjects%2Fliveobjects-for-xcubecellular-st","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatavenueliveobjects%2Fliveobjects-for-xcubecellular-st","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatavenueliveobjects%2Fliveobjects-for-xcubecellular-st/lists"}