Astarte Device SDKs are ready to use libraries that provide communication and pairing primitives. They allow to connect any device to an Astarte instance. While an SDK is not strictly required to connect an application to Astarte using MQTT, it enables rapid development and a pleasant developer experience.
Astarte Device SDKs should not be confused with client SDKs, as they
are not meant for client to device communications. If one is
interested in an abstraction layer on top of existing APIs instead, an
optional Astarte Client SDK (such as
) is to be used.
Under the hood Astarte Device SDKs make use of MQTT, BSON, HTTP, persistence and crypto libraries to implement Astarte MQTT v1 Protocol and all the other useful features.
They can be easily integrated into new or existing IoT projects written in any of the supported languages or platforms. At the moment the following SDKs are available:
Further languages and platforms will be supported in the near future. Requests for new SDKs are welcome.
Astarte Device SDKs make use of platform specific MQTT libraries and they hide all MQTT connection management details, including smart reconnection (randomized reconnection backoff is used).
Some of the Astarte Device SDKs (such as the ESP32) offer optional device id generation utils that can use the hardware id as seed.
Astarte Device SDKs can provide an optional automatic registration mechanism that can be used on the field, avoiding any manual data entry or additional operations. This optional component can be disabled when performing registration during manufactoring process.
Astarte Device SDKs make use of short lived SSL certificates which are automatically renewed before their expiration.
Astarte Device SDKs take care of the complete process from the certificate generation to the certificate signing request.
MQTT payloads are format agnostic, hence a serialization format should be used before transmitting data. For this specific purpose Astarte makes use of BSON format which easily maps to JSON.
Astarte Device SDKs take care on user behalf of data serialization to BSON. Last but not least some additional signaling messages are exchanged such as the introspection, Astarte Device SDKs take care of automatically sending them and applying data compression when necessary.
Astarte Device SDKs allow configuring persitence and reliability policies. In case of connection loss data is stored to memory or disk (according to mappings configuration) and they are automatically retransmitted as soon as the device is back online.
This feature is not available yet on Elixir, ESP32, Go and Python SDKs and might be not avilable on other platforms with constrained resources.
Astarte has support for the concept of properties, which are kept synchronized between the server and the device.
Thanks to the
Astarte MQTT v1 Protocol
an incremental approach is employed therefore only changed properties
are synchronized. This feature is not available yet on Elixir, Go and
Python SDKs and might be not avilable on other SDKs with no
Astarte Device SDKs take care of data validation before sending any data, hence errors are reported locally on the device improving troubleshooting experience.
This feature is not available yet on ESP32 and is WIP on Rust and Python.
A device must be registered beforehand to obtain its
credentials-secret. While there are
some manual options (such as using the
command or using the
), almost all Astarte Device SDKs allow to programmatically register a
Device. For Go you can use the