Implement Data Strategy - Author a Custom Read Handler for PowerProduced


#1

Hey guys,

i stopped at this point and can’t solve my problem. In the video after testing the handler the cmd says: Solar Collector produces… kw.
However in my case it stops and does nothing.
I have gone through all the previous steps several times and cannot find what I seem to be missing here.

[FORCE] 2019-06-14 10:59:45,24 httpServer: starting http server port=8001
[INFO ] 2019-06-14 10:59:45,29 sample: Registering HTTP callbacks
[INFO ] 2019-06-14 10:59:45,29 sample: Beginning main loop
[INFO ] 2019-06-14 10:59:45,31 thingworx.shape: Creating a new shape.
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: – Configuration -------------------------------
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: scanRate: 10000
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: scanRateResolution: 500
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: taskRate: 15000
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: keepAliveRate: 60000
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: requestTimeout: 15000
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: registerRate: 43200000
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: register: true
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: getPropertySubscriptionOnReconnect: false
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: maxConcurrentPropertyUpdates: 100
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: defaultPushType: VALUE
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: useShapes: true
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: identifier: Not Specififed
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: ------------------------------------------------
[INFO ] 2019-06-14 10:59:45,32 thingworx.template: Adding shape ‘shapes.metadata’ to template ‘thingworx.template’
[INFO ] 2019-06-14 10:59:45,32 thingworx.template: Adding shape ‘shapes.propsubscribe’ to template ‘thingworx.template’
[INFO ] 2019-06-14 10:59:45,32 thingworx.template: Creating new templates.SolarCollector1 named ‘SolarCollector-1_nick11337’
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: – Initializing properties ---------------------
[INFO ] 2019-06-14 10:59:45,32 SolarCollector-1_nick11337: Initialized property upToDate [baseType: BOOLEAN, pushType: NEVER, handler: nil, value: true]
[INFO ] 2019-06-14 10:59:45,33 thingworx.handler: Creating a new handler.
[INFO ] 2019-06-14 10:59:45,33 SolarCollector-1_nick11337: Initialized property PowerProduced [baseType: NUMBER, pushType: NEVER, handler: solarcollector.lua, value: 1]
[INFO ] 2019-06-14 10:59:45,33 SolarCollector-1_nick11337: ------------------------------------------------
[INFO ] 2019-06-14 10:59:47,994 SolarCollector-1_nick11337: – Starting script --------------------------
[INFO ] 2019-06-14 10:59:47,994 SolarCollector-1_nick11337: Registering core callback handler
[INFO ] 2019-06-14 10:59:47,994 SolarCollector-1_nick11337: Starting main loop
[INFO ] 2019-06-14 10:59:47,994 SolarCollector-1_nick11337: Calling lifecycle start listeners.
[INFO ] 2019-06-14 10:59:47,994 shapes.propsubscribe: Initialized
[INFO ] 2019-06-14 10:59:47,994 handlers.script: Opened
[INFO ] 2019-06-14 10:59:48,6 SolarCollector-1_nick11337: MicroServer is now available.
[INFO ] 2019-06-14 10:59:48,6 SolarCollector-1_nick11337: MicroServer is online.
[INFO ] 2019-06-14 10:59:48,6 SolarCollector-1_nick11337: Successfully registered SolarCollector-1_nick11337 with MicroServer.
[INFO ] 2019-06-14 10:59:48,335 thingworx.handler: Creating a new handler.
[INFO ] 2019-06-14 10:59:48,336 SolarCollector-1_nick11337: GetPropertySubscriptions called. 1 properties updated.

This is it and nothing happens anymore. I think my script is not going into the solarcollectorhandler and is not using the function “read”.

Do you have any ideas how i can solve this problem and keep going on?

Thank you.

Nick