# Astarte individual datastream example This example will guide you through setting up a simple application running the Astarte SDK and interacting with a local instance of Astarte. The device generated with this example will perform the following: - Use volatile storage for storing all the SDK instance data. Each instance of the SDK will be completely oblivious of previous instances. - Transmit periodically two values to the local instance of Astarte. - Change settings of a LED in a "virtual" array of LEDs when a "led_id/enable" message is received from the local instance of Astarte. If you have not already done so, make sure that you satisfy the [common prerequisites](./../README.md#common-prerequisites) and have completed the [common configuration](./../README.md#common-configuration) for the examples. ## Check transmitted data from the device Now that our device is connected to Astarte and is sending periodically data we can check if the Astarte cluster is storing correctly this data. We can check if the publish from the device has been correctly received on the server using `get-samples` as follows: ``` astartectl appengine --appengine-url http://localhost:4002/ --realm-key _private.pem --realm-name devices get-samples org.astarte-platform.rust.examples.individual-datastream.DeviceDatastream -c 1 ``` Where `` is your realm's name, `` is the device ID from which the data has been received and `` is the endpoint we want to observe. This will print the latest published data from the device that has been stored in the Astarte Cloud instance. To print a longer history of the published data change the number in `-c 1` to the history length of your liking. ## Send data to the device from the astarte instance With `send-data` we can publish new values on a server-owned interface. The syntax is the following: ``` astartectl appengine --appengine-url http://localhost:4002/ --realm-management-url http://localhost:4000/ --realm-key _private.pem --realm-name devices send-data org.astarte-platform.rust.examples.individual-datastream.ServerDatastream ``` Where `` is your realm name, `` is the device ID to send the data to, `` is the Astarte type of the chosen endpoint, `` is the endpoint to send data to, which in this example should be composed by a LED id and one of the two endpoints (e.g. `/42/endpoint1`), and `` is the value to send.