Rules crashing the ESP

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Rules crashing the ESP

#1 Post by Shardan » 23 Sep 2016, 23:32

Hello all,
i'm running into a problem with rules.

Device: NodeMCU V3, ESPeasy R131.
Using a GP2Y-dust sensor, an OLED display and a RGB LED.
The sensor works well, display too. I wanted the LED as a quick indicator of air quality
and used some rules for color changing (don't be annoyed by the values, it's just for testing)
The LED is connected via standard NPN transistors to GPIO 12,14 and 15

Code: Select all

on GP2Y#Dust do
   if [GP2Y#Dust] > 160
      gpio,14,0
   else
      gpio,14,1
   endif
   if [GP2Y#Dust] > 80
      gpio,12,1
   endif
   if [GP2Y#Dust] < 81
      gpio,12,0
   endif
   if [GP2Y#Dust] > 320
      gpio,12,0
   endif  
   if [GP2Y#Dust] > 240
      gpio,15,1
   else
      gpio,15,0
   endif
   if [GP2Y#Dust] > 400
      gpio,12,0
      gpio,15,0
      gpio,14,0
   endif
endon
The rules script works basically but it resets the ESP randomly, sometimes at once after start, sometimes after a minute.

The serial output looks like this:

Code: Select all

GPY  : Dust value: 6713
EVENT: GP2Y#Dust=176.74
ACT  : gpio,14,0
SW   : GPIO 14 Set to 0
ACT  : gpio,12,1
SW   : GPIO 12 Set to 1
ACT  : gpio,15,0
SW   : GPIO 15 Set to 0
GPY  : Dust value: 6185
EVENT: GP2Y#Dust=162.79
ACT  : gpio,14,0
SW   : GPIO 14 Set to 0
ACT  : gpio,12,1
SW   : GPIO 12 Set to 1
ACT  : gpio,15,0
SW   : GPIO 15 Set to 0

Exception (0):
epc1=0x402471e0 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

ctx: sys 
sp: 3ffffd40 end: 3fffffb0 offset: 01a0

>>>stack>>>
3ffffee0:  00000000 3fffdc80 3fff4594 00000030  
3ffffef0:  00000000 3ffebe98 3ffebea4 40107a78  
3fffff00:  00000000 00000000 3ffebf38 00000000  
3fffff10:  3ffed160 3fff44fc 3fffff50 4024733d  
3fffff20:  00000002 005e0001 2a80fb00 3ffef4c0  
3fffff30:  000005e0 00000000 401044f1 3fff44fc  
3fffff40:  3ffed15a 00000000 3fff3f9c 402478ec  
3fffff50:  9711a8c0 00000001 4010561a 3ffeea90  
3fffff60:  3ffee1c0 40101f86 00000000 3ffee6b4  
3fffff70:  3ffee1c0 40101d53 00000000 00000000  
3fffff80:  40228276 3fffdab0 00000002 3fff4594  
3fffff90:  3fffdc80 00000000 3fff3f9c 4023c37f  
3fffffa0:  40000f49 3fffdab0 3fffdab0 40000f49  
<<<stack<<<

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

wdt reset
load 0x4010f000, len 1384, room 16 
tail 8
chksum 0x2d
csum 0x2d
v09826c6d
~ld
øªU
INIT : Booting Build nr:131
WIFI : Connecting... 1
WIFI : Connected!
INIT : I2C
INIT : Boot OK
INIT : Normal boot
EVENT: System#Boot

I separated the sensor, Display and LED to another power supply, put capacitors on the power supply of the ESP-chip, took another power supply for the chip itself... nothing changed. The only way to stop from crashing is disabling or deleting the rules.

Any idea anyone?

Regards
Shardan.
Regards
Shardan

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Rules crashing the ESP

#2 Post by Shardan » 24 Sep 2016, 13:52

Some further info:
Complied with: Arduino 1.6.11, ESP-Core 2.3, libraries given with R120.

I did some further testing and it showed that the rules do the crash but they are not the reason.
For testing i deleted and deactivated rules completely in ESPeasy and run a simple wget-batch from my pc:

Code: Select all

LOOP
D:\ExtProgramme\WinWGET64\wget.exe 192.168.17.197/control?cmd=GPIO,12,1 > nul
D:\ExtProgramme\WinWGET64\wget.exe 192.168.17.197/control?cmd=GPIO,14,1 > nul
D:\ExtProgramme\WinWGET64\wget.exe 192.168.17.197/control?cmd=GPIO,15,1 > nul
D:\ExtProgramme\WinWGET64\wget.exe 192.168.17.197/control?cmd=GPIO,12,0 > nul
D:\ExtProgramme\WinWGET64\wget.exe 192.168.17.197/control?cmd=GPIO,14,0 > nul
D:\ExtProgramme\WinWGET64\wget.exe 192.168.17.197/control?cmd=GPIO,15,0 > nul
goto LOOP
And voila! Even running this script leads to a exception and resets the ESP-Chip.
Further checking with simply switching on and off a single GPIO shows that my NodeMCU (ESP-12E) is rather sensitive with settiong GPIOs.
At least switching GPIOs 2,9,10 and 15 on and off leads to an exception and a reset by watchdog.

Is this behaviour correct?

In my humble opinion GPIOs are made for this?

Regards
Shardan
(who excuses for his wooden english, i'm no native speaker)
Regards
Shardan

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests