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

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

wsems can not read the propertys when it running as a service

hda
1-Newbie
1-Newbie

wsems can not read the propertys when it running as a service

hello, i have some trouble when i run wsems and lsr. hope you can help me, thank you!

I run the wsems and lsr as service, it can connete whit thingworx for the  isConnected has changed to True. But the property can not update to thingworx, It read NULL or default in thingworx.

Then, I capturing the packet, all property reads UNKNOWN. and some packet reads : error /scrips/MyThing/propery/ipAddress/ not found.

sometimes some property is updated, but others didn't. but they are the same setting for pushType and so on.

my microserver is :

ThingWorx Websockets MicroServer, version 5.3.1.1113                          

Copyright (c) 2013 by ThingWorx, Inc.

thingworx is 30 days instances.

it is very grateful if someone can help me.

1 REPLY 1
hda
1-Newbie
1-Newbie
(To:hda)

my configuration file is etc/config.json and etc/config.lua, template is etc/custom/temptes/MyThingTemplate.lua

I get the property in etc/custom/scripts/MyThing.lua,

I define several variables, such as myIP, myTime in MyThing.lua

local myIP

local MyThime

and then, I get the properties in the main loop, like this:

while p_data.run do

     myIP = myAPI.getIP()

     myTime = myAPI.getTime()

end

log.info(p_data.name, "Exiting")

and for myTime:

function property_myTime(method, path, headers, query, data)

  if method ~= "GET" then return 405, "Only GET is allowed" end

  local resp = json.encode({

    value   = myTime,

    time    = os.time() * 1000,

    quality = "GOOD"

  })

  return 200, resp

end

it's that right???

However, there is a problem that the operation to get attributes is time-consuming,

    myIP = myAPI.getIP()

     myTime = myAPI.getTime()

about 1 seconds per function.

ps: myAPI is .so file which build from c.

is that any problem??

I'm sorry for my bad English.

Top Tags