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 32 PANIC: unprotected error in call to Lua API (error loading module 'httpd_req' from file 'httpd_req.lc': not enough memory) #86

Closed qu3bec closed 5 years ago

qu3bec commented 5 years ago

E:M 32 PANIC: unprotected error in call to Lua API (error loading module 'httpd_req' from file 'httpd_req.lc': not enough memory) Reboots every time Siren goes off or if I try to test by testing siren. Tested on two boards both running 2.2.6 Device discovery and blink both are off. Above is what ESplorer shows when I test the siren.' And also this when I tried again just now - eap: 4856 HTTP: Device Heap: 2488 Actuator Pin: 8 State: 1 E:M 536 E:M 1584 E:M 1584 HTTP client: Disconnected with error: 46 HTTP client: Connection timeout Heap: 29496 HTTP Call: -1 state 1 pin 1 Heap: 29528 HTTP Call: 204 state 1 pin 1 retry 1

This doesn’t happen if I remove the motion sensor. Looks like it errors out if motion sensor is also updating status at the sa e time as Siren is trying to activate which might be an issue at the time of an actual intrusion as with my tests when the board reboots siren doesn’t go off.

heythisisnate commented 5 years ago

Thanks for reporting this. Could you post the full boot output from your device? Also, do you have the same problem if you downgrade to 2.2.5?

qu3bec commented 5 years ago

Here are the logs and it's same after downgrading. Though it seems to give different error messages on different pins. Logs are when connected to D8 Pin. First set from 2.2.6 and the 2nd one from 2.2.5 Communication with MCU..Got answer! Communication with MCU established. AutoDetect firmware...

Can't autodetect firmware, because proper answer not received (may be unknown firmware). Please, reset module or continue. Œ bÄûg'Ÿlggœãì cp„‡l{drlpògà ƒl  coâ|„„‡ Ž�cŒó'oç Konnected firmware 2.2.6 NodeMCU 2.2.0.0 build 20190203 powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9) Heap: 34768 Initializing Konnected (68c63ae19c2a) Heap: 33152 Version: 2.2.6 Heap: 31496 Connecting to Wifi..

Heap: 36328 Wifi connected with IP: 192.168.1.5 255.255.255.0 192.168.1.1 Heap: 35128 UPnP: Listening for UPnP discovery Heap: 34760 HTTP: Starting server at http://192.168.1.5:22785 Heap: 34600 Loaded: server Heap: 24448 Initializing sensor pin: 6 Heap: 24416 Initializing actuator pin: 5 Heap: 24416 Initializing actuator pin: 8 Heap: 24008 Endpoint: https://graph-na04-useast2.api.smartthings.com:443/api/smartapps/installations/adca90da-380f-4dcd-a6be-07d3a3805088 Heap: 23976 Loaded: application Heap: 29240 HTTP Call: 200 Heap: 29200 Initialized actuator Pin: 5 Trigger: 1 Initial state: 0 Heap: 29024 HTTP Call: 200 state 0 pin 8 Heap: 28960 Initialized actuator Pin: 8 Trigger: 1 Initial state: 0 Heap: 28744 HTTP Call: 204 state 1 pin 6 Heap: 28648 HTTP Call: 204 state 0 pin 6 E:M 320 PANIC: unprotected error in call to Lua API (not enough memory)

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 26044, room 16 tail 12 chksum 0xc3 ho 0 tail 12 room 4 load 0x3ffe8000, len 2340, room 12 tail 8 chksum 0x61 load 0x3ffe8924, len 136, room 0 tail 8 chksum 0x3b csum 0x3b „ãäÃgì“{ƒûg|ädlll`c›Ÿ|;’dœoà‚gã Konnected firmware 2.2.6 NodeMCU 2.2.0.0 build 20190203 powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9) Heap: 34768 Initializing Konnected (68c63ae19c2a) Heap: 33152 Version: 2.2.6 Heap: 31496 Connecting to Wifi..

Heap: 36328 Wifi connected with IP: 192.168.1.5 255.255.255.0 192.168.1.1 Heap: 35128 UPnP: Listening for UPnP discovery Heap: 34760 HTTP: Starting server at http://192.168.1.5:22785 Heap: 34600 Loaded: server Heap: 24448 Initializing sensor pin: 6 Heap: 24416 Initializing actuator pin: 5 Heap: 24416 Initializing actuator pin: 8 Heap: 24008 Endpoint: https://graph-na04-useast2.api.smartthings.com:443/api/smartapps/installations/adca90da-380f-4dcd-a6be-07d3a3805088 Heap: 23976 Loaded: application Heap: 29056 HTTP Call: 200 Heap: 29024 Initialized actuator Pin: 5 Trigger: 1 Initial state: 0 Heap: 28520 HTTP Call: 200 state 0 pin 8 Heap: 28448 Initialized actuator Pin: 8 Trigger: 1 Initial state: 0 Heap: 28528 HTTP Call: 204 state 1 pin 6 Heap: 28528 HTTP Call: 204 state 0 pin 6 E:M 320 PANIC: unprotected error in call to Lua API (not enough memory)

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 26044, room 16 tail 12 chksum 0xc3 ho 0 tail 12 room 4 load 0x3ffe8000, len 2340, room 12 tail 8 chksum 0x61 load 0x3ffe8924, len 136, room 0 tail 8 chksum 0x3b csum 0x3b Œãìƒ'ä›{Ãòg|ì$ lld`cÛŸ|{Ûlœnà ƒgã Konnected firmware 2.2.6 NodeMCU 2.2.0.0 build 20190203 powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9) Heap: 34768 Initializing Konnected (68c63ae19c2a) Heap: 33152 Version: 2.2.6 Heap: 31496 Connecting to Wifi..

Heap: 36328 Wifi connected with IP: 192.168.1.5 255.255.255.0 192.168.1.1 Heap: 35128 UPnP: Listening for UPnP discovery Heap: 34760 HTTP: Starting server at http://192.168.1.5:22785 Heap: 34600 Loaded: server Heap: 24448 Initializing sensor pin: 6 Heap: 24416 Initializing actuator pin: 5 Heap: 24416 Initializing actuator pin: 8 Heap: 24008 Endpoint: https://graph-na04-useast2.api.smartthings.com:443/api/smartapps/installations/adca90da-380f-4dcd-a6be-07d3a3805088 Heap: 23976 Loaded: application Heap: 29160 HTTP Call: 200 Heap: 29128 Initialized actuator Pin: 5 Trigger: 1 Initial state: 0 Heap: 29128 HTTP Call: 200 state 0 pin 8 Heap: 29056 Initialized actuator Pin: 8 Trigger: 1 Initial state: 0 E:M 72 E:M 88 PANIC: unprotected error in call to Lua API (not enough memory)

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 26044, room 16 tail 12 chksum 0xc3 ho 0 tail 12 room 4 load 0x3ffe8000, len 2340, room 12 tail 8 chksum 0x61 load 0x3ffe8924, len 136, room 0 tail 8 chksum 0x3b csum 0x3b ãä‚gì“{ƒûg|ädlll`c›Ÿ|;’dœoà ‚gã Konnected firmware 2.2.6 NodeMCU 2.2.0.0 build 20190203 powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9) Heap: 34768 Initializing Konnected (68c63ae19c2a) Heap: 33152 Version: 2.2.6 Heap: 31496 Connecting to Wifi..

Heap: 36328 Wifi connected with IP: 192.168.1.5 255.255.255.0 192.168.1.1 Heap: 35128 UPnP: Listening for UPnP discovery Heap: 34760 HTTP: Starting server at http://192.168.1.5:22785 Heap: 34600 Loaded: server Heap: 24448 Initializing sensor pin: 6 Heap: 24416 Initializing actuator pin: 5 Heap: 24416 Initializing actuator pin: 8 Heap: 24008 Endpoint: https://graph-na04-useast2.api.smartthings.com:443/api/smartapps/installations/adca90da-380f-4dcd-a6be-07d3a3805088 Heap: 23976 Loaded: application Heap: 29240 HTTP Call: 200 Heap: 29208 Initialized actuator Pin: 5 Trigger: 1 Initial state: 0 Heap: 28616 HTTP Call: 200 state 0 pin 8 Heap: 28552 Initialized actuator Pin: 8 Trigger: 1 Initial state: 0 Heap: 28672 HTTP Call: 204 state 0 pin 6 Heap: 28664 HTTP Call: 204 state 1 pin 6 E:M 416 E:M 160 PANIC: unprotected error in call to Lua API (not enough memory)

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 26044, room 16 tail 12 chksum 0xc3 ho 0 tail 12 room 4 load 0x3ffe8000, len 2340, room 12 tail 8 chksum 0x61 load 0x3ffe8924, len 136, room 0 tail 8 chksum 0x3b csum 0x3b

„ãäÃgì“sƒûo|ä ddll`c› ž|{›lœnà ƒoâ Konnected firmware 2.2.6 NodeMCU 2.2.0.0 build 20190203 powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9) Heap: 34768 Initializing Konnected (68c63ae19c2a) Heap: 33152 Version: 2.2.6 Heap: 31496 Connecting to Wifi..

Heap: 36328 Wifi connected with IP: 192.168.1.5 255.255.255.0 192.168.1.1 Heap: 35128 UPnP: Listening for UPnP discovery Heap: 34760 HTTP: Starting server at http://192.168.1.5:22785 Heap: 34600 Loaded: server Heap: 24448 Initializing sensor pin: 6 Heap: 24416 Initializing actuator pin: 5 Heap: 24416 Initializing actuator pin: 8 Heap: 24008 Endpoint: https://graph-na04-useast2.api.smartthings.com:443/api/smartapps/installations/adca90da-380f-4dcd-a6be-07d3a3805088 Heap: 23976 Loaded: application Heap: 29232 HTTP Call: 200 Heap: 29200 Initialized actuator Pin: 5 Trigger: 1 Initial state: 0 Heap: 22824 HTTP: Device Heap: 20360 Actuator Pin: 8 State: 1 Heap: 28160 HTTP Call: 200 state 1 pin 8 Heap: 28096 Initialized actuator Pin: 8 Trigger: 1 Initial state: 1 Heap: 4216 HTTP: Device Heap: 1832 Actuator Pin: 8 State: 0 Heap: 27824 HTTP Call: 204 state 0 pin 6 Heap: 28152 HTTP Call: 204 state 1 pin 6 E:M 416 PANIC: unprotected error in call to Lua API (/opt/nodemcu-firmware/local/fs/server.lua:15: cannot allocate message buffer)

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 26044, room 16 tail 12 chksum 0xc3 ho 0 tail 12 room 4 load 0x3ffe8000, len 2340, room 12 tail 8 chksum 0x61 load 0x3ffe8924, len 136, room 0 tail 8 chksum 0x3b csum 0x3b „ãä‚gä›{Ãòg|ì$ lld`c’Ÿ|;’dœoà‚gã Konnected firmware 2.2.6 NodeMCU 2.2.0.0 build 20190203 powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9) Heap: 34768 Initializing Konnected (68c63ae19c2a) Heap: 33152 Version: 2.2.6 Heap: 31496 Connecting to Wifi..

Heap: 36328 Wifi connected with IP: 192.168.1.5 255.255.255.0 192.168.1.1 Heap: 35128 UPnP: Listening for UPnP discovery Heap: 34760 HTTP: Starting server at http://192.168.1.5:22785 Heap: 34600 Loaded: server Heap: 24448 Initializing sensor pin: 6 Heap: 24416 Initializing actuator pin: 5 Heap: 24416 Initializing actuator pin: 8 Heap: 24008 Endpoint: https://graph-na04-useast2.api.smartthings.com:443/api/smartapps/installations/adca90da-380f-4dcd-a6be-07d3a3805088 Heap: 23976 Loaded: application Heap: 29144 HTTP Call: 200 Heap: 29112 Initialized actuator Pin: 5 Trigger: 1 Initial state: 0 Heap: 26608 Responding to UPnP Discovery request from 192.168.1.7:34105 Heap: 28576 HTTP Call: 200 state 0 pin 8 Heap: 28512 Initialized actuator Pin: 8 Trigger: 1 Initial state: 0

PORT CLOSED

On 2.2.5 Konnected firmware 2.2.5 NodeMCU 2.2.0.0 build 20180917 powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9) Heap: 34928 Initializing Konnected (68c63ae19c2a) Heap: 33360 Version: 2.2.5 Heap: 31720 Connecting to Wifi..

Heap: 36464 Wifi connected with IP: 192.168.1.5 255.255.255.0 192.168.1.1 Heap: 35224 UPnP: Listening for UPnP discovery Heap: 34856 HTTP: Starting server at http://192.168.1.5:22785 Heap: 34696 Loaded: server Heap: 26864 Initializing sensor pin: 6 Heap: 26832 Initializing actuator pin: 8 Heap: 26480 Endpoint: https://graph-na04-useast2.api.smartthings.com:443/api/smartapps/installations/adca90da-380f-4dcd-a6be-07d3a3805088 Heap: 26448 Loaded: application Heap: 31672 HTTP Call: 200 state 0 pin 8 Heap: 31608 Initialized actuator Pin: 8 Trigger: 1 Initial state: 0 Heap: 31896 HTTP Call: 204 state 0 pin 6 Heap: 31384 HTTP Call: 204 state 1 pin 6 Heap: 1648 UPnP: Sent SSDP NOTIFY Heap: 32264 HTTP Call: 204 state 0 pin 6 Heap: 32208 HTTP Call: 204 state 1 pin 6 Heap: 32272 HTTP Call: 204 state 0 pin 6 Heap: 30800 Responding to UPnP Discovery request from 192.168.1.7:57131 Heap: 32312 HTTP Call: 204 state 1 pin 6 Heap: 32216 HTTP Call: 204 state 0 pin 6 Heap: 32224 HTTP Call: 204 state 1 pin 6 Heap: 32296 HTTP Call: 204 state 0 pin 6 Heap: 32288 HTTP Call: 204 state 1 pin 6 Heap: 32200 HTTP Call: 204 state 0 pin 6 Heap: 32112 HTTP Call: 204 state 1 pin 6 Heap: 32208 HTTP Call: 204 state 0 pin 6 Heap: 32112 HTTP Call: 204 state 1 pin 6 Heap: 32184 HTTP Call: 204 state 0 pin 6 Heap: 32088 HTTP Call: 204 state 1 pin 6 Heap: 32192 HTTP Call: 204 state 0 pin 6 Heap: 32184 HTTP Call: 204 state 1 pin 6 Heap: 32184 HTTP Call: 204 state 0 pin 6 Heap: 32192 HTTP Call: 204 state 1 pin 6 Heap: 32272 HTTP Call: 204 state 0 pin 6 Heap: 32112 HTTP Call: 204 state 1 pin 6 Heap: 32184 HTTP Call: 204 state 0 pin 6 Heap: 32112 HTTP Call: 204 state 1 pin 6 Heap: 31992 HTTP Call: 204 state 0 pin 6 Heap: 32080 HTTP Call: 204 state 1 pin 6 Heap: 31992 HTTP Call: 204 state 0 pin 6 Heap: 32088 HTTP Call: 204 state 1 pin 6 Heap: 32088 HTTP Call: 204 state 0 pin 6 Heap: 32160 HTTP Call: 204 state 1 pin 6 Heap: 32256 HTTP Call: 204 state 0 pin 6 Heap: 30632 Responding to UPnP Discovery request from 192.168.1.7:60476 Heap: 30632 Responding to UPnP Discovery request from 192.168.1.7:35121 Heap: 30632 Responding to UPnP Discovery request from 192.168.1.7:51326 Heap: 32040 HTTP Call: 204 state 1 pin 6 Heap: 32040 HTTP Call: 204 state 0 pin 6 Heap: 31936 HTTP Call: 204 state 1 pin 6 Heap: 32008 HTTP Call: 204 state 0 pin 6 Heap: 31936 HTTP Call: 204 state 1 pin 6 Heap: 31832 HTTP Call: 204 state 0 pin 6 Heap: 27328 Responding to UPnP Discovery request from 192.168.1.7:48400 Heap: 31928 HTTP Call: 204 state 1 pin 6 Heap: 31824 HTTP Call: 204 state 0 pin 6 Heap: 31840 HTTP Call: 204 state 1 pin 6 Heap: 31824 HTTP Call: 204 state 0 pin 6 Heap: 31904 HTTP Call: 204 state 1 pin 6 E:M 24 PANIC: unprotected error in call to Lua API (error loading module 'httpd_res' from file 'httpd_res.lc': not enough memory)

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 25736, room 16 tail 8 chksum 0xb8 load 0x3ffe8000, len 2340, room 0 tail 4 chksum 0xf4 load 0x3ffe8924, len 136, room 4 tail 4 chksum 0x3f csum 0x3f

This is on a test board. Basically relay won't get activated when motion is being detected. Board errors out and app shows activating but then goes back to Alarm Off

heythisisnate commented 5 years ago

This should be fixed in 2.2.7 and above. Memory consumption has been greatly improved.