Jump to content









Photo

Getting Started with Arduino UNO

arduino carriots

  • Please log in to reply
1 reply to this topic

#1 akranjan

akranjan

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 15 February 2015 - 06:07 PM

I am connecting my arduino uno for the first time to the CARRIOTS.I am following every step given in the tutorial but on 4th step i'm stuck that is:

4. Data Transferred from Arduino to Carriots

From Arduino you have to build a HTTP request and send the data.

  • HTTP request
    POST /streams HTTP/1.1
    Host: api.carriots.com
    Accept: application/json
    User-Agent: Arduino-Carriots
    Content-Type: application/json
    carriots.apikey: YOUR APIKEY HERE
    Content-Length: YOUR CONTENT LENGTH HERE
    Connection: close
  • Data
    {
    "protocol":"v2",
    "device":"YOUR DEVICE's ID_DEVELOPER HERE",
    "at":1356390000,
    "data":{"light":"YOUR DATA HERE"}
    }

 

On Data part,by specifying the device ID_DEVELOPER that includes the "@" in the idea and uploading it to the arduino result some serious issue and it says "stray '@' in the program".  Please Help!

Attached Files

  • Attached File  scr.jpg   83.1K   24 downloads


#2 sdeancos

sdeancos

    Master of Puppets

  • Members
  • PipPipPip
  • 103 posts
  • LocationMadrid, Spain.

Posted 16 February 2015 - 08:54 AM

Hi Akranjan,

 

 

You shouldnt use " in String json var. You should use '. For example

 

String json = '{"key": "value"}'

 

 

I hope this help you!

 

 

BR!!







Also tagged with one or more of these keywords: arduino, carriots

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users