Custom Luup Plugin Stopping Randomly

Hello,

I have written a custom Luup Plugin, called Vera Data Logging to fetch any change in sensor data and push those results to an external server using an HTTPS POST request. The code seems to work fine but for some reason, it randomly stops running and I have to reload the Lua engine to get it started again.

Every 15 seconds a function will HTTP POST an alive status to the external server (using https://servername.com/vera/alive - I’ve replaced the real server url with servername.com for privacy but I’ve double checked and the external server definitely works) as well as upload any changes to sensor values (using https://servername.com/vera/uploadData). I have this code running on a few different Vera Edges (all with the latest firmware) and it happens to all of them but at different times.

Sometimes it will run for only a few hours or more than 48 hours before it seems to stop for no reason. According to my external server, the last POST request it got was at 2019-02-15 01:59:28. Below are the log files around this time. It shows a successful HTTPS request to https://servername.com/vera/alive at 02/15/19 1:59:28 and then it stops at 02/15/19 1:59:43.

I can’ t see anything that indicates something in the code crashed but I’m new to plugin development so maybe I’m missing something?

50 02/15/19 1:59:28.100 luup_log:3: Checking Variables <0x76270520>
50 02/15/19 1:59:28.101 luup_log:3: https://servername.com/vera/alive <0x76270520>
50 02/15/19 1:59:28.547 luup_log:3: {“gateway_udn”:“4d494342-5342-5645-0001-000002b1c4a2”,“timestamp”:“1550159968”,“SN”:“45204642”} <0x76270520>
50 02/15/19 1:59:28.548 luup_log:3: Response: = “Success” code = 200 status = HTTP/1.1 200 OK <0x76270520>
50 02/15/19 1:59:28.548 luup_log:3: Checking Device: ZWave <0x76270520>
50 02/15/19 1:59:28.548 luup_log:3: Checking Device: _Scene Controller <0x76270520>
50 02/15/19 1:59:28.549 luup_log:3: Checking Device: Vera Data Logging <0x76270520>
50 02/15/19 1:59:28.549 luup_log:3: Checking Device: Kitchen <0x76270520>
50 02/15/19 1:59:28.550 luup_log:3: Got Service: urn:micasaverde-com:serviceId:SecuritySensor1 <0x76270520>
50 02/15/19 1:59:28.550 luup_log:3: Value Is: 0 <0x76270520>
50 02/15/19 1:59:28.550 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.551 luup_log:3: Checking Device: Temperature Sensor <0x76270520>
50 02/15/19 1:59:28.551 luup_log:3: Got Service: urn:upnp-org:serviceId:TemperatureSensor1 <0x76270520>
50 02/15/19 1:59:28.552 luup_log:3: Value Is: 26.30 <0x76270520>
50 02/15/19 1:59:28.552 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.553 luup_log:3: Checking Device: Light Sensor <0x76270520>
50 02/15/19 1:59:28.553 luup_log:3: Got Service: urn:micasaverde-com:serviceId:LightSensor1 <0x76270520>
50 02/15/19 1:59:28.554 luup_log:3: Value Is: 0 <0x76270520>
50 02/15/19 1:59:28.554 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.554 luup_log:3: Checking Device: Humidity Sensor <0x76270520>
50 02/15/19 1:59:28.555 luup_log:3: Got Service: urn:micasaverde-com:serviceId:HumiditySensor1 <0x76270520>
50 02/15/19 1:59:28.555 luup_log:3: Value Is: 55 <0x76270520>
50 02/15/19 1:59:28.556 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.556 luup_log:3: Checking Device: UV Sensor <0x76270520>
50 02/15/19 1:59:28.557 luup_log:3: Got Service: urn:micasaverde-com:serviceId:GenericSensor1 <0x76270520>
50 02/15/19 1:59:28.557 luup_log:3: Value Is: N/A <0x76270520>
50 02/15/19 1:59:28.558 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.558 luup_log:3: Checking Device: Livingroom <0x76270520>
50 02/15/19 1:59:28.559 luup_log:3: Got Service: urn:micasaverde-com:serviceId:SecuritySensor1 <0x76270520>
50 02/15/19 1:59:28.559 luup_log:3: Value Is: 0 <0x76270520>
50 02/15/19 1:59:28.559 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.560 luup_log:3: Checking Device: Temperature Sensor 1 <0x76270520>
50 02/15/19 1:59:28.560 luup_log:3: Got Service: urn:upnp-org:serviceId:TemperatureSensor1 <0x76270520>
50 02/15/19 1:59:28.561 luup_log:3: Value Is: 25.60 <0x76270520>
50 02/15/19 1:59:28.561 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.562 luup_log:3: Checking Device: Light Sensor 1 <0x76270520>
50 02/15/19 1:59:28.562 luup_log:3: Got Service: urn:micasaverde-com:serviceId:LightSensor1 <0x76270520>
50 02/15/19 1:59:28.563 luup_log:3: Value Is: 0 <0x76270520>
50 02/15/19 1:59:28.563 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.563 luup_log:3: Checking Device: Humidity Sensor 1 <0x76270520>
50 02/15/19 1:59:28.564 luup_log:3: Got Service: urn:micasaverde-com:serviceId:HumiditySensor1 <0x76270520>
50 02/15/19 1:59:28.564 luup_log:3: Value Is: 56 <0x76270520>
50 02/15/19 1:59:28.565 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.565 luup_log:3: Checking Device: UV Sensor 1 <0x76270520>
50 02/15/19 1:59:28.565 luup_log:3: Got Service: urn:micasaverde-com:serviceId:GenericSensor1 <0x76270520>
50 02/15/19 1:59:28.566 luup_log:3: Value Is: N/A <0x76270520>
50 02/15/19 1:59:28.566 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.567 luup_log:3: Checking Device: Bathroom <0x76270520>
50 02/15/19 1:59:28.568 luup_log:3: Got Service: urn:micasaverde-com:serviceId:SecuritySensor1 <0x76270520>
50 02/15/19 1:59:28.568 luup_log:3: Value Is: 0 <0x76270520>
50 02/15/19 1:59:28.568 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.569 luup_log:3: Checking Device: Temperature Sensor 2 <0x76270520>
50 02/15/19 1:59:28.569 luup_log:3: Got Service: urn:upnp-org:serviceId:TemperatureSensor1 <0x76270520>
50 02/15/19 1:59:28.570 luup_log:3: Value Is: 26.90 <0x76270520>
50 02/15/19 1:59:28.570 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.570 luup_log:3: Checking Device: Light Sensor 2 <0x76270520>
50 02/15/19 1:59:28.571 luup_log:3: Got Service: urn:micasaverde-com:serviceId:LightSensor1 <0x76270520>
50 02/15/19 1:59:28.571 luup_log:3: Value Is: 0 <0x76270520>
50 02/15/19 1:59:28.572 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.572 luup_log:3: Checking Device: Humidity Sensor 2 <0x76270520>
50 02/15/19 1:59:28.573 luup_log:3: Got Service: urn:micasaverde-com:serviceId:HumiditySensor1 <0x76270520>
50 02/15/19 1:59:28.573 luup_log:3: Value Is: 54 <0x76270520>
50 02/15/19 1:59:28.573 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.574 luup_log:3: Checking Device: UV Sensor 2 <0x76270520>
50 02/15/19 1:59:28.574 luup_log:3: Got Service: urn:micasaverde-com:serviceId:GenericSensor1 <0x76270520>
50 02/15/19 1:59:28.575 luup_log:3: Value Is: N/A <0x76270520>
50 02/15/19 1:59:28.575 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.576 luup_log:3: Checking Device: Chair Sensor <0x76270520>
50 02/15/19 1:59:28.576 luup_log:3: Got Service: urn:micasaverde-com:serviceId:SecuritySensor1 <0x76270520>
50 02/15/19 1:59:28.576 luup_log:3: Value Is: N/A <0x76270520>
50 02/15/19 1:59:28.577 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:28.578 luup_log:3: Checking Device: Phone Charger <0x76270520>
50 02/15/19 1:59:28.578 luup_log:3: Got Service: urn:micasaverde-com:serviceId:EnergyMetering1 <0x76270520>
50 02/15/19 1:59:28.578 luup_log:3: Value Is: 0.000 <0x76270520>
50 02/15/19 1:59:28.579 luup_log:3: Got the Data <0x76270520>
50 02/15/19 1:59:43.101 luup_log:3: Checking Variables <0x76270520>
50 02/15/19 1:59:43.101 luup_log:3: https://servername.com/vera/alive <0x76270520>
02 02/15/19 2:00:00.100 ZWave::NightlyMaintenance <0x76e70520>
01 02/15/19 2:00:00.101 ZWaveNode::GetVersionInfo node 3 device 7 doesn’t support Command class version <0x76e70520>
01 02/15/19 2:00:00.101 ZWaveNode::GetVersionInfo node 4 device 12 doesn’t support Command class version <0x76e70520>
01 02/15/19 2:00:00.102 ZWaveNode::GetVersionInfo node 5 device 17 doesn’t support Command class version <0x76e70520>
01 02/15/19 2:00:00.103 ZWaveNode::GetVersionInfo node 8 device 24 doesn’t support Command class version <0x76e70520>
01 02/15/19 2:00:00.103 ZWaveNode::GetVersionInfo node 9 device 25 doesn’t support Command class version <0x76e70520>
06 02/15/19 2:00:00.104 Device_Variable::m_szValue_set device: 25 service: urn:micasaverde-com:serviceId:ZWaveDevice1 variable: LastNnu was: 1550073600,3 now: 1550160000,4 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x76e70520>
06 02/15/19 2:00:00.105 Device_Variable::m_szValue_set device: 25 service: urn:micasaverde-com:serviceId:ZWaveDevice1 variable: LastArr was: 1550073600,3 now: 1550160000,4 #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x76e70520>
02 02/15/19 2:00:52.100 ZWaveJobHandler::AlarmCallback skipping check because of jobs <0x76e70520>
02 02/15/19 2:01:00.108 JobHandler::Run job#1175 :update nnu 9 dev:25 (0xcaf538) P:101 S:0 Id: 1175 is 60.4021000 seconds old <0x76870520>
04 02/15/19 2:01:00.617 <0x76870520>
06 02/15/19 2:01:21.297 Device_Variable::m_szValue_set device: 18 service: urn:upnp-org:serviceId:TemperatureSensor1 variable: CurrentTemperature was: 26.90 now: 26.90 #hooks: 0 upnp: 0 skip: 0 v:0x9ba648/NONE duplicate:1 <0x76e70520>
06 02/15/19 2:01:21.697 Device_Variable::m_szValue_set device: 20 service: urn:micasaverde-com:serviceId:HumiditySensor1 variable: CurrentLevel was: 54 now: 54 #hooks: 0 upnp: 0 skip: 0 v:0x9cde58/NONE duplicate:1 <0x76e70520>

I’m stumped. If anyone has any ideas or suggestions please let me know! Thank you!!