{"id":19357058,"url":"https://github.com/kaaproject/kaa-arduino-sdk","last_synced_at":"2025-09-18T00:47:19.266Z","repository":{"id":47704712,"uuid":"283820489","full_name":"kaaproject/kaa-arduino-sdk","owner":"kaaproject","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-17T12:08:58.000Z","size":31,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-02T14:11:16.886Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaaproject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-30T16:09:53.000Z","updated_at":"2024-07-10T06:23:40.000Z","dependencies_parsed_at":"2022-08-23T00:41:30.332Z","dependency_job_id":null,"html_url":"https://github.com/kaaproject/kaa-arduino-sdk","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaaproject%2Fkaa-arduino-sdk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaaproject%2Fkaa-arduino-sdk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaaproject%2Fkaa-arduino-sdk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaaproject%2Fkaa-arduino-sdk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaaproject","download_url":"https://codeload.github.com/kaaproject/kaa-arduino-sdk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250416958,"owners_count":21427101,"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-11-10T07:06:10.954Z","updated_at":"2025-09-18T00:47:14.167Z","avatar_url":"https://github.com/kaaproject.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kaa IoT Platform Arduino library\n\n## Overview: \n\nThis library provides a client functionality for communicating with Kaa IoT Platform. \n\nAs MQTT client this library uses [PubSubClient](https://github.com/knolleary/pubsubclient).\n\nThe library comes with example sketches for ESP8266, ESP32 and STM32. More examples will be available in future.  \n\nCurrently supported functions:\n - Send metadata\n - Send data\n - Receive commands and send response\n\n## Reference: \n\nTo use this library:\n```c++\n#include \"kaa.h\"\n```\n\nCreate Kaa object:  \nPass pointer to PubSubClient object, kaa token and kaa app version to the constructor.\n```c++\nKaa kaa(pointer_to_pubsubclient_object, kaa_token, kaa_app_version);\n```\n\n### Functions:\n\n**messageArrivedCallback()**\n\n```Topic```, ```payload``` and ```payload length``` of the received MQTT message need to be passed to this function.\n  \nIt should be called at the end of PubSubClient message arrived callback.\n  \n```c++\nvoid messageArrivedCallback(const char* topic_recv, const char* payload_recv, unsigned int len)\n//Usage\nkaa.messageArrivedCallback(topic, payload, payload_length);\n```\n\n**sendMetadata()**\n\nReceives metadata as JSON string and sends it to Kaa.\n  \n```c++\nvoid sendMetadata(const char* metadata_str)\n//Usage\nkaa.sendMetadata(metadata_json_str);\n```\n\n**sendDataRaw()**\n\nReceives data as JSON string and sends it [reliably](https://docs.kaaiot.io/KAA/docs/v1.3.0/Features/Data-collection/#reliable-data-collection) to Kaa.\n  \n```c++\nvoid sendDataRaw(const char* payload)\n//Usage\nkaa.sendDataRaw(data_json_str);\n```\n\n**sendDataRawUnreliably()**\n\nReceives data as JSON string and sends it [unreliably](https://docs.kaaiot.io/KAA/docs/v1.3.0/Features/Data-collection/#unreliable-data-collection) to Kaa.\n  \n```c++\nvoid sendDataRawUnreliably(const char* payload)\n//Usage\nkaa.sendDataRawUnreliably(data_json_str);\n```\n\n**requestConfig()**\n\nRequests configuration from Kaa.\nResponse will be passed to `configResponseCallback` that must be set in order to invoke `requestConfig`, otherwise `requestConfig` invocation will have no effect.\n  \n```c++\nint requestConfig()\n//Usage\nint ok = kaa.requestConfig();\n```\n\n**setConfigResponseCallback()**\n\nThe callback is called when device receives configuration response from the Kaa platform.\n\n```c++\nvoid (*configResponseCallback)(char* request_status, char* payload, unsigned int len);\n//Usage\nkaa.setConfigResponseCallback(\u0026configResponseCallback);\n```\n\n**setConfigPushCallback()**\n\nThe callback is called when device receives configuration push from the Kaa platform.\n\n```c++\nvoid (*configPushCallback)(char* payload, unsigned int len);\n//Usage\nkaa.setConfigPushCallback(\u0026configPushCallback);\n```\n\n**setCommandCallback()**\n\nThe callback is called when device receives command(s) from the Kaa platform.\n\n```c++\nvoid setCommandCallback(int (*commandCallback)(char* command_type, char* payload, unsigned int len))\n//Usage\nkaa.setCommandCallback(\u0026commandCallback);\n```\n\n**sendCommandResultAllIds()**\n\nAfter parsing a command payload, this function must be called in your ```commandCallback``` function to send a response to the platform about successful command execution.  \nFunction receives command type and Arduino JSON JsonVariant as parsed command payload.\n\n```c++\nvoid sendCommandResultAllIds(char* command_type, JsonVariant json_var)\n//Usage\nkaa.sendCommandResultAllIds(command_type, json_var);\n```\n\nCheck examples to learn more about the usage of the functions of this library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaaproject%2Fkaa-arduino-sdk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaaproject%2Fkaa-arduino-sdk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaaproject%2Fkaa-arduino-sdk/lists"}