Skip to main content
May 28, 2016 8:45 AM UTC
Solved

Connect failed after a while

     I was  sending data to the thingworx by Arduino Yun. When I plugged the USB power, it worked well. However, after a while I couldn't see any new data on the Thing/Properties. And the QueryPropertyHistory services told me the data hadn't been updated. When I re-plugged the USB power, it still worked well. Why? Could you help me?

The core codes are:

String setData("curl "

  "\"http://"+TWServer+":"+TWPort+"/Thingworx/Things/DHT21Thing/Properties/*?appKey="+appKey+"\""

  " -X PUT "

  "-i -H \"Content-Type:application/json\" "

  "-H \"Accept:application/json\" "

  "-d '{\"Temperature\" :" + tempAsString + ", \"Humidity\" :" + humidityAsString + "}' "

  );

  Serial.println("Set Data: "+ setData);

 

  // run the curl command with the REST call that was build in the setTemperature String variable

p.runShellCommand(setData);

aalbotAnswer
Jun 2, 2016 12:55 AM UTC

Hi Vladimir,

     Thanks for your help.

     1. "a while" means "sometimes a half hour, sometimes five minutes". I am not sure.

     2. The 1Amper charger still displays the same behavior.

     3. I've found the problem. In the Thing's Properties, There is a  attributes which called "Data Change Info". Set the "Data Change type" to "Always". Because my data always the same as before, and the default of the "Data Change type" is "Values 0", so the same data change event can't be fired.

Best regards

3 replies

Jun 1, 2016 11:13 AM UTC

Hi Albot,

1. What exactly "a while means"?

2. Can you please power up your Yun by a 1Amper charger? See if it still displays the same behavior.

Best regards

aalbotAuthorAnswer
Jun 2, 2016 12:55 AM UTC

Hi Vladimir,

     Thanks for your help.

     1. "a while" means "sometimes a half hour, sometimes five minutes". I am not sure.

     2. The 1Amper charger still displays the same behavior.

     3. I've found the problem. In the Thing's Properties, There is a  attributes which called "Data Change Info". Set the "Data Change type" to "Always". Because my data always the same as before, and the default of the "Data Change type" is "Values 0", so the same data change event can't be fired.

Best regards

Jun 2, 2016 12:50 PM UTC

Albot, hi,

Now I understand, I thought when you said you couldn't see any new data on the platform, new data meant any variation, not just the same value.

Glad to see you figured out!

BR,

Vladi