Cloud Upload To ubidots using a simduino 808 board


#1

The following code is what I am using to try and upload to ubidots. It is a combination of a sim808 module and arduino uno. So ubidots standard libraries do not function with it.

void connectGPRS()
{
  sendDataSIM808( "AT", 1000, DEBUG);
  sendDataSIM808( "AT+CPIN?", 1000, DEBUG);
  sendDataSIM808( "AT+CREG?", 1000, DEBUG);
  sendDataSIM808( "AT+CGATT?", 1000, DEBUG); //GPRS Attach
  sendDataSIM808( "AT+CIPSHUT", 1000, DEBUG); //reset IP
  sendDataSIM808( "AT+CIPSTATUS", 1000, DEBUG);
  sendDataSIM808( "AT+CIPMUX=0", 1000, DEBUG); // Start single IP connection
  sendDataSIM808( "AT+CSTT=\"internet\",\"guest\",""", 2000, DEBUG); // Set APN
  sendDataSIM808( "AT+CIICR", 3000, DEBUG); // Bring up wireless connection
  sendDataSIM808( "AT+CIFSR", 2000, DEBUG); // IP address assigned
  sendDataSIM808( "AT+CIPSPRT=0", 3000, DEBUG);
  sendDataSIM808( "AT+CIPSTART=\"tcp\",\"things.ubidots.com\",\"80\"", 4000, DEBUG);
  sendDataSIM808( "AT+CIPSEND", 4000, DEBUG);
  sendDataSIM808( "POST /api/v1.6/variables/"+idvariable+"/values HTTP/1.1\r\nX-Auth-Token: "+token+"\r\nHost: things.ubidots.com\r\nContent-Type: application/json\r\nContent-Length: "+String(num)+"\r\n\r\n"+var+"\r\n", 2000, DEBUG);
  sendDataSIM808( "AT+CIPSHUT", 500, DEBUG);
}

The response to the follwing code is

HTTP/1.0 408 Request Time-out
Cache-Control: no-cache
Connection: close
Content-Type: text/html

<html><body><h1>408 Request Time-out</h1>
Your browser didn't send a complete request in time.
</body></html>