This step by step guide will help you set up your first working Arduino experiment. It will show how to send data from your Arduino to the AllThingsTalk cloud.
An Arduino (compatible) board with ethernet port, such as the Arduino Leonardo Ethernet, Arduino UNO or Arduino Ethernet.
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 sketch, so it knows where to send its data. You can find them under SETTINGS > Authentication of the device you just created.
counter
example sketchchar deviceId[] = "AnIev364YE0yXI2COXcufWgx";
char token[] = "maker:8hQT2IQm1cLsW1VeVqyzg7zhJNGabCyrIbw1XCN1";
In case you have multiple devices running, you can change the MAC-address in the sketch to make sure the device doesn’t interfere with others. Normally this should be printed on a sticker on the back of your Arduino like
90-A2-DA-0F-C9-4D
.
Adapt this line in the codeByte mac[] = { 0x90, 0xA2, 0xDA, 0x0F, 0xC9, 0x4D };
We are now ready to upload and run our sketch!
Simply hit the upload icon in the Arduino IDE. This will save the sketch, compile it and upload it to your Arduino.
If all went well, a counter asset is created under your device in AllThingsTalk Maker and values start rolling in. Every 3 seconds the counter is augmented by one.
Alternatively, you can also open the Tools > Serial monitor of the Arduino IDE. This can be very useful when debugging your own sketches.
- Make sure you select the correct COM port to listen (under Tools > Port )
- When the monitor is open, make sure the Baud rate is set to 9600
That’s it! You just made your first working IoT prototype!
This first example shows how to send data from the device to the AllThingsTalk cloud.
Try the led-actuation.ino
example for communication in the other direction! Send commands from AllThingsTalk to your device!
Next, 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.