konnected-io / konnected-security

Konnected connects wired sensors and switches to SmartThings, Home Assistant, Hubitat and OpenHAB
https://konnected.io
Apache License 2.0
416 stars 322 forks source link

E:M 80 PANIC: unprotected error in call to Lua API (error loading module 'httpd_res' from file 'httpd_res.lc':not enough memory) #83

Closed qu3bec closed 5 years ago

qu3bec commented 5 years ago

My main alarm. board reboots randomly and I've been trying to figure out why. I set up another test board with a motion sensor. I've narrowed it down to motion sensor updates as my other board connected to garage door never reboots. I can now pretty much replicate the issue by requesting a HTTP Status from the app and if the motion sensor is also updating at that time, board reboots. see below. My main alarm board reboots randomly at times when I've not requested a status update like early this morning. Firmware and file system is latest 2.2.5 I am sure it will be easy to replicate and hopefully there will be a fix. Happy to provide more information. E:M 80 PANIC: unprotected error in call to Lua API (error loading module 'httpd_res' from file 'httpd_res.lc': not enough memory)

Again I tried and it rebooted, log below so I can pretty much replicate it. Heap: 30960 Responding to UPnP Discovery request from 192.168.1.19:34962 Heap: 25832 HTTP: Index Heap: 25336 HTTP: Status Heap: 25424 HTTP: Index Heap: 25080 HTTP: Status E:M 80 PANIC: unprotected error in call to Lua API (error loading module 'httpd_res' from file 'httpd_res.lc': not enough memory)

heythisisnate commented 5 years ago

This is indicating that the application is running out of memory. Unfortunately there's no "fix" except for reducing the memory footprint. One way of doing this is disabling device discovery. This frees up memory that the device would normally be using to listen and respond to discovery requests. See: https://help.konnected.io/support/solutions/articles/32000023968-disabling-device-discovery

In general, an occasional reboot is not necessarily bad. The device is designed to recover quickly after a reboot and will always re-sync the latest state after coming back up.