ubidots

I use this code to send a value to ubidots server , but i send one time the first boot only

/ libraries
#include <GSM.h>

// PIN Number
#define PINNUMBER “”

// APN data
#define GPRS_APN “internet” // replace with your GPRS APN
#define GPRS_LOGIN “ooredoo” // replace with your GPRS login
#define GPRS_PASSWORD “ooredoo” // replace with your GPRS password

// initialize the library instance
GSMClient client;
GPRS gprs;
GSM gsmAccess(true);
uint16_t reset = 0;

String idvariable = “57babe507625424932c6806f”; // replace with your Ubidots Variable ID
String token = “mZjN5qNRjRuQo1W02D6AYkr60ngosD”; // replace with your Ubidots token

void setup(){

// initialize serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial){
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.println(“Starting Arduino web client.”);
// connection state
boolean notConnected = true;
// After starting the modem with GSM.begin()
// attach the shield to the GPRS network with the APN, login and password
while (notConnected){
if ((gsmAccess.begin(PINNUMBER) == GSM_READY) &
(gprs.attachGPRS(GPRS_APN, GPRS_LOGIN, GPRS_PASSWORD) == GPRS_READY)){
notConnected = false;
}else{
Serial.println(“Not connected”);
delay(1000);
}
}
}

void loop(){
int value = 32 ;
int num=0;
String var = “{“value”:”+ String(value) + “}”;
num = var.length();
// if you get a connection, report back via serial:
while (client.connect(“things.ubidots.com”, 80)){
Serial.println(“connected”);
// Make a HTTP request:
client.print(“POST /api/v1.6/variables/”+idvariable+"/values HTTP/1.1\nContent-Type: application/json\nContent-Length: “+String(num)+”\nX-Auth-Token: “+token+”\nHost: things.ubidots.com\n\n");
client.println(var);
client.println();
}
}

i logged also the debug on gsm shield :

%13%Starting Arduino web client. AT%13% 0 23>%13%%10%Call Ready%13%%10%AT%13%%13%%10%OK%13%%10% AT+CGREG?%13% 23 54>AT+CGREG?%13%%13%%10%+CGREG: 0,1%13%%10%%13%%10%OK%13%%10% AT+IFC=1,1%13% 54 71>AT+IFC=1,1%13%%13%%10%OK%13%%10% AT+CMGF=1%13% 71 89>%19%%17%AT+CMGF=1%13%%13%%10%OK%13%%10% AT+CLIP=1%13% 89 105>AT+CLIP=1%13%%13%%10%OK%13%%10% ATE0%13% 105 116>ATE0%13%%13%%10%OK%13%%10% AT+COLP=1%13% 116 122>%13%%10%OK%13%%10% AT+CGATT=1%13% 122 0>%13%%10%OK%13%%10% AT+QIFGCNT=0%13% 0 6>%13%%10%OK%13%%10% AT+QICSGP=1,"internet","ooredoo","ooredoo"%13% 6 12>%13%%10%OK%13%%10% AT+QIMUX=0%13% 12 18>%13%%10%OK%13%%10% AT+QIMODE=1%13% 18 24>%13%%10%OK%13%%10% AT+QINDI=1%13% 24 30>%13%%10%OK%13%%10% AT+QIREGAPP%13% 30 36>%13%%10%OK%13%%10% AT+QIACT%13% 36 42>%13%%10%OK%13%%10% AT+QIDNSIP=1%13% 42 48>%13%%10%OK%13%%10% AT+QIOPEN="TCP","things.ubidots.com",80%13% 48 55>%255%%13%%10%OK%13%%10%

48 71>%255%%13%%10%OK%13%%10%%255%%255%%255%%255%%255%%13%%10%CONNECT%13%%10% connected POST /api/v1.6/variables/57babe507625424932c6806f/values HTTP/1.1%10%Content-Type: application/json%10%Content-Length: 12%10%X-Auth-Token: mZjN5qNRjRuQo1W02D6AYkr60ngosD%10%Host: things.ubidots.com%10%%10%{"value":32}%13%%10%%13%%10%AT+QIDNSIP=1%13% 90 86>%255%%255%%255%%255%%255%%255%HTTP/1.1 201 CREATED%13%%10%Server: nginx%13%%10%Date: Tue, 23 Aug 2016 16:24:06 GMT%13%%10%Content-Type: application/json%13%%10%Transfer-Enc AT+QIDNSIP=1%13%AT+QIDNSIP=1%13%AT+QIDNSIP=1%13%AT+QIDNSIP=1%13%AT+QIDNSIP=1%13%