ESP32 - Waterflow sensor causes panic

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Icestan
Normal user
Posts: 13
Joined: 20 Feb 2019, 16:46

ESP32 - Waterflow sensor causes panic

#1 Post by Icestan » 22 May 2019, 21:26

Hello ESPEasy-Community,
i don´t know if my Problem with the ESP32 is Part of the Issue #2475 and i hope you can Help me.

I have a garden project where I switch 6 solenoid valves and one pump via relays. Everything is controlled and operated via the ioBroker. In addition, I have 4 water flow sensors that cause me problems.
In the past, I still had an ESP8266 with a PCF8564 used as an expander for the relays and this works quite well. Even with the current ESP32, the controller works really well.

Now I wanted to switch on the water flow sensors to monitor the amounts of water. But as soon as I open the valves and start the pump, the controller crashes and I get the following message after a few seconds:
9887 : IMPT : [GV_States2#Ventil5] : 0.00
9887 : EVENT: GV_States2#Ventil5=0.00
10056 : ACT : GPIO,17,1
10058 : SW : GPIO 17 Set to 1
10631 : EVENT: H6#ml=0.00
10759 : EVENT: H6#Total=0.00
10871 : EVENT: H6#Time=0.00
20629 : EVENT: H6#ml=27.00
20753 : EVENT: H6#Total=36.00
20869 : EVENT: H6#Time=114.00
Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed)
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IllegalInstruction). Exception was unhandled.
Memory dump at 0x401f0470: bad00bad bad00bad bad00bad
Guru Meditation Error: Core 1 panic'ed (IlleGuru Meditation Error: Core 1 panic'ed (Unhandled debug exception)
Debug exception reason: Stack canary watchpoint triggered (loop$ @4)
Guru Meditation Error: Core 1 panic'ed (Guru Meditation Error: Core 1 panic'ed (Guru Meditation Error: Core 1 panic'ed (Double exception)
1r▒▒▒▒?d▒▒?▒▒?Debug exception reason: ▒▒▒?ndled debug $ @4▒▒?Debug exception reason: Debug exception reason: ▒▒▒?%% 1r▒▒▒▒?d▒▒?▒▒?Debug exception reason: ets Jun 8 2016 00:22:57
My settings are on all devices for the flow sensors are:
2019-05-22 20_51_17-Gartenverteiler.png
Flowsensor Settings
2019-05-22 20_51_17-Gartenverteiler.png (17.82 KiB) Viewed 6919 times

The List of Devices is this:
2019-05-26 21_36_22-Gartenverteiler.png
Devicelist
2019-05-26 21_36_22-Gartenverteiler.png (64.74 KiB) Viewed 6710 times

I think the signals are clean enough to do an evaluation. The flow sensors are connected to a separate power supply (5V) and are connected to the ESP via a step-down device (to 3.3V). In addition, capacitors (100nF) and pull-up resistors (10k) have been considered. I bought a very cheap oscilloscope (20 €) to look at the signals from the sensors.
IMG_20190522_171602.jpg
IMG_20190522_171602.jpg (82.34 KiB) Viewed 6919 times
IMG_20190522_171554.jpg
IMG_20190522_171554.jpg (87.13 KiB) Viewed 6919 times

Unfortunately, I run out of ideas and would be glad for any support.

Thank you in advance
Last edited by Icestan on 26 May 2019, 21:45, edited 2 times in total.

Icestan
Normal user
Posts: 13
Joined: 20 Feb 2019, 16:46

Re: ESP32 - Waterflow sensor causes panic

#2 Post by Icestan » 26 May 2019, 13:51

Hello Community,

can somebody help me please?

User avatar
ThomasB
Normal user
Posts: 406
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESP32 - Waterflow sensor causes panic

#3 Post by ThomasB » 26 May 2019, 19:35

i don´t know if my Problem with the ESP32 is Part of the Issue #2475 and i hope you can Help me.
I have no experience with the issue. But I would suggest you try a release before the April 2019 commit that altered P003 pulse.

Also, are you sure it is the flow sensor that is the actual problem source? Maybe it is an induced voltage spike from a relay, solenoid, or pump. To check this, leave the flow sensor in the circuit (don't move any wires!) and turn off the water source so it does not measure any flow. Does it still reboot? Testing it this way is more real-world than simply disabling the pulse counter plugins.

Lastly, what are your using to logic convert the 5V flow signal to 3.3V? Post the schematic if available.

- Thomas

Icestan
Normal user
Posts: 13
Joined: 20 Feb 2019, 16:46

Re: ESP32 - Waterflow sensor causes panic

#4 Post by Icestan » 26 May 2019, 21:35

Hallo Thomas,

thank you for answer.
I don´t have a schematic, yet.

But to avoid misunderstandings, I would like to add something.
- Only if the pulse sensors in the ESP controller are deactivated, all the relays be switched and everything runs stably.
I'm sorry if the picture is misleading.

- I have been working on adding the flow sensors for a year now. Since I had the same effect as today with the Esp8266, I thought I'd try it with the esp32. Unfortunately it is not like that.
That's why I already tested Images before April 2019 and after that time.

- The power supply for the sensors and the ESP each run on a separate DC-DC converter (XL6009).
The sensores working with 5V and the GPIO´s get Impulses with 3.3V over a Step-Down-Unit

- I have already done another test with this configuration, with only one sensor connected to the controller. Successful pulses <2 seconds through the sensor.
I see a value on the controller. As soon as the pulse lasts longer, the controller crashes after 5 seconds at the latest. In my Testconfiguration, i used an other Sensor and an other Powersupply.

That's why my last guess, which still remains, was a problem with the interrupts.

User avatar
ThomasB
Normal user
Posts: 406
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESP32 - Waterflow sensor causes panic

#5 Post by ThomasB » 26 May 2019, 22:00

Since I had the same effect as today with the Esp8266, I thought I'd try it with the esp32
It is unclear -- Do you mean that a ESP8266 crashes the same as the ESP32 when flow is measured? Or if the ESP8266 works well then why not use it?
That's why my last guess, which still remains, was a problem with the interrupts.
Your cautious conclusion is shared by me. It does appear that the plugin is the culprit; Maybe it is consuming too much CPU time and is causing havoc with the other plugins.

I may have a workaround idea. But first a sanity test is needed. Use a spare ESP32 or ESP8266. Perform a full erase and install a ESPEasy version that is pre Apr-2019 (you can try post Apr-2019 in another test). Then install only the pulse counter plugins and connect to your flow sensors. Do NOT install any other plugins. What I mean is that your device page should only show the pulse counters and nothing else.

Does this minimal configuration reliably measure the flow without rebooting? If it does then I may have a workaround solution for you.

- Thomas

Icestan
Normal user
Posts: 13
Joined: 20 Feb 2019, 16:46

Re: ESP32 - Waterflow sensor causes panic

#6 Post by Icestan » 26 May 2019, 22:08

Since I had the same effect as today with the Esp8266, I thought I'd try it with the esp32
It is unclear -- Do you mean that a ESP8266 crashes the same as the ESP32 when flow is measured? Or if the ESP8266 works well then why not use it?
I have the problem on Both Controllertypes.
But first a sanity test is needed.
I will Test the sensors with only One Plugin, tomorrow.

Thanks for your Support
I'll get back to you soon

Best regards
Icestan

Icestan
Normal user
Posts: 13
Joined: 20 Feb 2019, 16:46

Re: ESP32 - Waterflow sensor causes panic

#7 Post by Icestan » 28 May 2019, 21:56

Hello,

I have Tested some Images with Esp8266 (Wemos D1)-Module and with ESP32 (DEVKITV1)-Module.
I have used a Pulsegenerator with a adjustable Frequency from 1Hz till 100Hz.
The Result is very Confuse for me.

(ESP8266) : With Images "mega-20190202" and with the newest Image "mega-20190522"
I could set Devices for 4 PulseCounter, MQTT-Import etc. without Crashes.
It was possible, too. To change settings while pulses were being measured.

(ESP32) : With Images "mega-20181214", "mega-20190315" and "mega-20190522"
I could set one Device for 1 PulseCounter. If i set a second Device (Pulsecounter, Switch or MQTT-Import)
If Enabled or Disabled. The Controller Crashed if some Impulses are sending.
In addition, I had the effect, the controller has also crashed as soon as changes
to the settings are stored and pulses were sent to ESP at the same time. Frequencies of 5 Hz have already been sufficient.

It is a pity that the ESP did not reach the performance I was expecting. :( :?
Well, I have already put in so much work and everything in vain.

Have a nice Day

User avatar
grovkillen
Core team member
Posts: 3274
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP32 - Waterflow sensor causes panic

#8 Post by grovkillen » 28 May 2019, 21:59

You should look into compiling your own version if you need sub-second timing.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Icestan
Normal user
Posts: 13
Joined: 20 Feb 2019, 16:46

Re: ESP32 - Waterflow sensor causes panic

#9 Post by Icestan » 28 May 2019, 22:25

Hello grovkillen,

I have very high respect for your work and what you have done.
In my smart home projects, I have already installed some ESP modules. Like me, many of my colleagues swear by your firmware.
Especially with this special structure I have here, it is a garden irrigation with 6 solenoid valves, it is very frustrating for me why the ESP32 has no better behavior than the esp8266.

best regards

User avatar
grovkillen
Core team member
Posts: 3274
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP32 - Waterflow sensor causes panic

#10 Post by grovkillen » 28 May 2019, 22:28

We haven't (yet) made ESP Easy optimized for the big brother ESP32.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

User avatar
ThomasB
Normal user
Posts: 406
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESP32 - Waterflow sensor causes panic

#11 Post by ThomasB » 29 May 2019, 01:09

It is a pity that the ESP did not reach the performance I was expecting. Well, I have already put in so much work and everything in vain.
Let's try to salvage your project. I understand you want to use a ESP32 but it crashes when water flow is measured. However, you found that the ESP8266 is able to measure the flow.

So I would like to propose a workaround. It's not going to be the solution you planned, but implementation is practical and cost is low.

I suggest you keep the ESP32 but remove the pulse counter plugins from it. Install the counter plugins on a separate ESP8266 module and wire it to the flow sensors. Then use the built-in UDP Inter-ESPEasy Network (or MQTT if you prefer) to send the flow measurements from the ESP8266 to the ESP32. Use the shared real-time data in your ESP32 rules.

In this configuration the ESP32 should avoid the flow measurement crashes because it has off-loaded that function to the more stable ESP8266.

- Thomas

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 9 guests