This step by step guide will help you set up your first working Raspberry Pi experiment. It will show how to send data from your Raspberry Pi to the AllThingsTalk cloud.
No need to install the sdk if you are using the AllThingsTalk Raspberry Pi kit. The SD card comes pre-installed. If you are using your own Raspberry Pi, you can clone the AllThingsTalk SDK to it using
git clone git://github.com/allthingstalk/python-sdk.git. Next install the sdk by browsing to the folder
cd python-sdkand the
pip3 install .command.
An alternative to using a SSH client is hooking up a screen and keyboard to your Raspberry Pi.
First we need to create our device.
If you just created a new account, you will have a default ground called playground. You can use this ground to create your device or create a new ground if you want.
Next we need to add the credentials of our device (deviceid and authorization token) to our example application, so it knows where to send its data. You can find them under SETTINGS > Authentication of the device you just created.
sudo nano counter.py
DEVICE_TOKEN = 'maker:8hQT2IQm1cLsW1VeVqyzg7zhJNGabCyrIbw1XCN1'
We are now ready to run our application!
Run the application with the command
If all went well, a counter asset is created under your device in AllThingsTalk Maker, counting from 0 till 9.
That’s it! You just made your first working IoT prototype!
As a next step, please try these basic experiments connecting the Grove sensors and actuators from the kit
For more info on Grove sensors and Actuators as found in the AllThingsTalk kit, please check our Sensors and Actuators page.