How many Nested EVENTS?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: How many Nested EVENTS?

#11 Post by toffel969 » 28 Mar 2018, 09:23

Martinus wrote: 27 Mar 2018, 17:36 The rule engine currently processes at three levels max. However, the protection mechanism didn't work properly on the Mega where we have multiple rule sets and it crashed the system because of to many open files. The dev branch has been updated. It now stops processing before a new file handle is opened.
Exceeding nesting level should give a logged warning.
Hi Martinus

Just a question on that. Does the nesting limitation also apply the workaround using multiple events? Or are you referring to the new feature of boolean nesting within one event?
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

Martinus

Re: How many Nested EVENTS?

#12 Post by Martinus » 28 Mar 2018, 16:44

It's true that the boolean checks are also limited to three according to the wiki.

But this is about calling events from an event. Technically this is a recursive function call with all the usual challenges. Each level occupies stack space and also has a file handle open to SPIFFS. This has never been thoroughly tested and it mail fail due to lack of resources like file handles and RAM. The current limit of 3 could well work on a bare unit and still fail when many RAM hungry tasks/plugins are loaded.

User avatar
toffel969
Normal user
Posts: 469
Joined: 03 Jan 2017, 10:58
Location: Germany

Re: How many Nested EVENTS?

#13 Post by toffel969 » 28 Mar 2018, 17:25

Martinus wrote: 28 Mar 2018, 16:44 It's true that the boolean checks are also limited to three according to the wiki.

But this is about calling events from an event. Technically this is a recursive function call with all the usual challenges. Each level occupies stack space and also has a file handle open to SPIFFS. This has never been thoroughly tested and it mail fail due to lack of resources like file handles and RAM. The current limit of 3 could well work on a bare unit and still fail when many RAM hungry tasks/plugins are loaded.
Thanks for making that clear. Maybe we should add a warning to the wiki. I will do so when I find time
Domoticz on Raspi 2 -- 14 ESP units (hacked Sonoff,NodeMCUs, Wemos, self-built units) running with RC140- Mega 2.0.0 dev8

TD-er
Core team member
Posts: 8752
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: How many Nested EVENTS?

#14 Post by TD-er » 28 Mar 2018, 19:52

leel1967l wrote: 27 Mar 2018, 23:00 [...]
I update the MQTT import1 values through OPENHAB MQTT.

Result: after few updates the unit crashes on this line of code: core_esp8266_main.cpp:98 __yield
[...]
That error may occur when yield, or delay is being called from outside setup() or loop().
That's only possible when using events (that's why I know this, see last updates to the WiFi code ;) )
So somewhere an event handler function is calling some command which does eventually call yield().
Maybe somewhere in the PubSubClient library (handling MQTT) ???

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: How many Nested EVENTS?

#15 Post by kimot » 29 Mar 2018, 21:12

Are you compile itself or using .bin file.
I see NESTED parameters define in source code, but you never know setting for your bin. file

leel1967l
Normal user
Posts: 73
Joined: 30 Nov 2017, 18:29

Re: How many Nested EVENTS?

#16 Post by leel1967l » 30 Mar 2018, 00:13

I am using the .bin file.
I do not compile myself.

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: How many Nested EVENTS?

#17 Post by kimot » 31 Mar 2018, 17:57

So you must try how many nested is compiled.
I think three with my _dev13

Post Reply

Who is online

Users browsing this forum: No registered users and 108 guests