Skip to main content
1-Visitor
May 28, 2016
Solved

Connect failed after a while

  • May 28, 2016
  • 1 reply
  • 2311 views

     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);

Best answer by aalbot

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

1 reply

19-Tanzanite
June 1, 2016

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

aalbot1-VisitorAuthorAnswer
1-Visitor
June 2, 2016

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

19-Tanzanite
June 2, 2016

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