cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Remote Thing properties value get reset everynight

ptc-4395015
1-Visitor

Remote Thing properties value get reset everynight

Hi Guys!

I was using Java SDK to call a Thing service to create a remote thing, then bind it with my sdk and send data to it

Everything works fine and I can see remote thing data updating while I was running the sdk(jar file).

But even I already set all properties to persistent, every morning this remote thing still lose all data and roll back to just create status(because it shows last connection is 1969-12-31 19:00:00.000 )

Is there something I did wrong in my sdk to reset this remote thing everyday(I didn't run the jar file over night, i turn it off before i left office)?or is that some setting in Thingworx platform?

Thank you for any advice and idea!

Best

Liwei

5 REPLIES 5
Aanjan
12-Amethyst
(To:ptc-4395015)

Liwei, when does the property value reset? Is it after a Tomcat restart, SDK restart or a Thing restart?

Hi AanJan,

Thingworx Server is running on AWS, it shouldn't restart every night(I'm not 100% sure, but I do lost data overnight, in the day time I didn't seem to lose any data).

SDK restart will not reset all properties value.

I didn't try to restart Thing, will a Thing restart itself somehow?

Aanjan
12-Amethyst
(To:ptc-4395015)

It shouldn't restart on its own. I'm more curious as to why it resets at night only, as you said nothing happened in the day time. I assumed the SDK might reset/ overwrite it back to the default once you start it up, but you noted that the SDK restart does not reset all properties.

Yes! I'm curious about it too....

Below is my client code of binding and sending data to Thingworx:

LaptopThingClient client = new LaptopThingClient(config);

     ValueCollection computerName = new ValueCollection();

     computerName.put("_laptop", new StringPrimitive(ThingName));   //Set ThingName

     client.start();

  // Wait for the client to connect.

if (client.waitForConnection(30000)) {

     LOG.info("The client is now connected.");

     client.invokeService(ThingworxEntityTypes.Things, "ConnectedLaptopUtilityThing","CreateConnectedLaptop", computerName, 5000); //Create Thing

     LaptopThing thing = new LaptopThing(ThingName, "A basic virtual thing",ThingName, client);

     client.bindThing(thing);//Bind Thing

while (!client.isShutdown()) {

  Thread.sleep(2000);

  thing.processScanRequest();

  }

Maybe I did something Wrong here?

Thanks!!!

rmórocz
1-Visitor
(To:Aanjan)

Hi!

I have the same problem.

My remote thing property (which is persistent) is read on the device site (in .net code). Nowhere is a property set requested on the device site.

When the device is disconnected then i can see the property is not changing. BUT after reconnecting the device to the TW server the property will be null.

My question is why, and how to protect the remote thing from data loss.

Thanks

Announcements


Top Tags