Task limit to 12 ?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
pitchout
Normal user
Posts: 34
Joined: 13 Oct 2021, 19:57

Task limit to 12 ?

#1 Post by pitchout » 03 Nov 2021, 11:58

hello, I can't find a post regarding the task limit to 12 ... Is it possible to increase this limit ... 16 would be ideal in my case. Thank you

User avatar
Ath
Normal user
Posts: 3480
Joined: 10 Jun 2018, 12:06
Location: NL

Re: Task limit to 12 ?

#2 Post by Ath » 03 Nov 2021, 12:11

ESP8266 units support a maximum of 12 tasks, though there is a configuration possible that has 24. That wouldn't be (backward) compatible with the 12 tasks setup, as that changes the configuration files.

ESP32 units are 'limited' to 32 tasks, so that could be a fine alternative, prices for ESP32 modules are barely higher than for ESP8266, the CPU is much faster, has more RAM, and 4 or 16MB flash, and also comes with more, and more flexible, GPIO pins.
/Ton (PayPal.me)

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

Re: Task limit to 12 ?

#3 Post by TD-er » 03 Nov 2021, 13:37

Yep, the limit for number of tasks is set at compile time and is affecting the structure of the settings file also.
In other words, changing to 24 tasks will render the existing settings incompatible.

In order to use 24 tasks on an ESP8266, you must define the following 2 defines:

-DUSE_NON_STANDARD_24_TASKS
-DTASKS_MAX=24

the -D prefix is when you set it in PlatformIO.
Or you set it in your Custom.h

Code: Select all

#define USE_NON_STANDARD_24_TASKS
#define TASKS_MAX 24

pitchout
Normal user
Posts: 34
Joined: 13 Oct 2021, 19:57

Re: Task limit to 12 ?

#4 Post by pitchout » 03 Nov 2021, 23:50

Sorry but i dont understand how to do this ?

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

Re: Task limit to 12 ?

#5 Post by TD-er » 04 Nov 2021, 00:14

What don't you understand? Where to use these C++ defines, or just how to build a custom version of ESPEasy?

pitchout
Normal user
Posts: 34
Joined: 13 Oct 2021, 19:57

Re: Task limit to 12 ?

#6 Post by pitchout » 04 Nov 2021, 09:11

if I understand correctly, I have to use software in C to open the bin and add or modify lines of programs? Then redo a custom .bin?

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

Re: Task limit to 12 ?

#7 Post by TD-er » 04 Nov 2021, 13:44

pitchout wrote: 04 Nov 2021, 09:11 if I understand correctly, I have to use software in C to open the bin and add or modify lines of programs? Then redo a custom .bin?
Well it is a bit more than that.
Maybe we can later discuss how bad you need it as we can of course make a test build for you but that would mean a lot of work to keep you updated.
So please tell why you need it now, maybe we can already help you to work around this limitation right now.

pitchout
Normal user
Posts: 34
Joined: 13 Oct 2021, 19:57

Re: Task limit to 12 ?

#8 Post by pitchout » 09 Nov 2021, 10:56

Hello to solve this little problem, I switched to esp32 wroom32 which with a suitable .bin, I am in 32 task.

BUD ...!!!

I have a problem with my esp in mqtt mode. My esp is coupled with a mcp23017 to increase the IN and OUT. When I use a mcp ... I2c input quickly (two pulses second for example) and the output concerned starts to flash constantly (see photo) ... I do not understand why. I have other ESPWemos that don't have this problem. Thank you

INFO :
I use ESP32 Wroom32
Version .bin : ESP_Easy_mega_20211105_test_A_ESP32-wrover-kit_4M316k (Impossible to flash directly with ESPEasy .. I use tasmota first and then upgrade firmware ...
When i disable "Home Assistant (openHAB) MQTT" in "controllers protocol" ... the anomaly disappears which confirms the mqtt problem since the esp only works with the rules.

normal log without mqtt of in normal use
Image

abnormal issue
Image

Maybe my rulse are broken ...


Code: Select all

On BP1#BP1State=0 do
  
     MCPGPIOTOGGLE,1
endon

On BP2#BP2State=0 do
  
     MCPGPIOTOGGLE,2
endon

On BP3#BP3State=0 do
  
     MCPGPIOTOGGLE,3
endon

On BP4#BP4State=0 do
  
     MCPGPIOTOGGLE,4
endon

On BP5#BP5State=0 do
  
     MCPGPIOTOGGLE,5
endon

On BP6#BP6State=0 do
  
     MCPGPIOTOGGLE,6
endon

On BP7#BP7State=0 do
  
     MCPGPIOTOGGLE,7
endon

On BP8#BP8State=0 do
  
     MCPGPIOTOGGLE,8
endon

On BP9#BP9State=0 do
  
     MCPGPIOTOGGLE,9
endon

On BP10#BP10State=0 do
  
     MCPGPIOTOGGLE,10
endon

On BP11#BP11State=0 do
  
     MCPGPIOTOGGLE,11
endon

On BP12#BP12State=0 do
  
     MCPGPIOTOGGLE,12
endon

On BP13#BP13State=0 do
  
     MCPGPIOTOGGLE,13
endon

On BP14#BP14State=0 do
  
     MCPGPIOTOGGLE,14
endon

On BP15#BP15State=0 do
  
     MCPGPIOTOGGLE,15
endon

On BP16#BP16State=0 do
  
     MCPGPIOTOGGLE,16
endon



on System#Boot do
  
  monitor,mcp,17 // Monitor MCP23017 INPUT pins.
  monitor,mcp,18
  monitor,mcp,19
  monitor,mcp,20
  monitor,mcp,21
  monitor,mcp,22
  monitor,mcp,23
  monitor,mcp,24
  monitor,mcp,25
  monitor,mcp,26
  monitor,mcp,27
  monitor,mcp,28
  monitor,mcp,29
  monitor,mcp,30
  monitor,mcp,31
  monitor,mcp,32
  monitor,mcp,1
  monitor,mcp,2

endon


on mcp#1 do
  Publish,%sysname%/MCPGPIO/1,[plugin#mcpgpio#pinstate#1]
endon

on mcp#2 do
  Publish,%sysname%/MCPGPIO/2,[plugin#mcpgpio#pinstate#2]
endon

on mcp#3 do
  Publish,%sysname%/MCPGPIO/3,[plugin#mcpgpio#pinstate#3]
endon

on mcp#4 do
  Publish,%sysname%/MCPGPIO/4,[plugin#mcpgpio#pinstate#4]
endon

on mcp#5 do
  Publish,%sysname%/MCPGPIO/5,[plugin#mcpgpio#pinstate#5]
endon

on mcp#6 do
  Publish,%sysname%/MCPGPIO/6,[plugin#mcpgpio#pinstate#6]
endon

on mcp#7 do
  Publish,%sysname%/MCPGPIO/7,[plugin#mcpgpio#pinstate#7]
endon

on mcp#8 do
  Publish,%sysname%/MCPGPIO/8,[plugin#mcpgpio#pinstate#8]
endon

on mcp#9 do
  Publish,%sysname%/MCPGPIO/9,[plugin#mcpgpio#pinstate#9]
endon

on mcp#10 do
  Publish,%sysname%/MCPGPIO/10,[plugin#mcpgpio#pinstate#10]
endon

on mcp#11 do
  Publish,%sysname%/MCPGPIO/11,[plugin#mcpgpio#pinstate#11]
endon

on mcp#12 do
  Publish,%sysname%/MCPGPIO/12,[plugin#mcpgpio#pinstate#12]
endon

on mcp#13 do
  Publish,%sysname%/MCPGPIO/13,[plugin#mcpgpio#pinstate#13]
endon

on mcp#14 do
  Publish,%sysname%/MCPGPIO/14,[plugin#mcpgpio#pinstate#14]
endon

on mcp#15 do
  Publish,%sysname%/MCPGPIO/15,[plugin#mcpgpio#pinstate#15]
endon

on mcp#16 do
  Publish,%sysname%/MCPGPIO/16,[plugin#mcpgpio#pinstate#16]
endon
Thanks a lot
Attachments
Snag_abf41f5.png
Snag_abf41f5.png (73.76 KiB) Viewed 6552 times
Snag_abf3227.png
Snag_abf3227.png (73.84 KiB) Viewed 6552 times
Last edited by TD-er on 09 Nov 2021, 11:53, edited 1 time in total.
Reason: Changed quote to code tags

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

Re: Task limit to 12 ?

#9 Post by TD-er » 09 Nov 2021, 12:01

Just take this part of your rules:

Code: Select all

On BP1#BP1State=0 do
  
     MCPGPIOTOGGLE,1
endon
I think this is causing the flashing.

Events are being queued, and take some time to process.
Do you also have a switch task assigned to these pins?
What is the configuration of one of such tasks (e.g. the one that is now toggling)
And what kind of controller do you use? Is there some domotica software interacting with this pin too?

pitchout
Normal user
Posts: 34
Joined: 13 Oct 2021, 19:57

Re: Task limit to 12 ?

#10 Post by pitchout » 09 Nov 2021, 12:26

my home automation works with jeedom.
I tested by deactivating jeedom and by deactivating the mqtt protocol of jeedom ... Always the same thing. The question is why with domoticz I do not have this problem?

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

Re: Task limit to 12 ?

#11 Post by TD-er » 09 Nov 2021, 16:51

When using Domoticz as described in the documentation, thus using the Domoticz helper, this "Domoticz Helper" does prevent the "flip-flop" behavior you're seeing.

I think the processing of the state is a bit delayed, so calling the toggle will probably call it twice as there are 2 events in the queue.
For example:
- BP1#BP1State=0
- BP1#BP1State=1

So by the time the event is processed, the state is no longer reflecting the event value.
Maybe you should not call the "toggle" but rather explicitly set the state.

pitchout
Normal user
Posts: 34
Joined: 13 Oct 2021, 19:57

Re: Task limit to 12 ?

#12 Post by pitchout » 09 Nov 2021, 17:33

Hi,
Maybe you should not call the "toggle" but rather explicitly set the state.
I have to use the "toggle" function because when you press a button at home, it must turn on and then a second pulse to turn off the light point.

Image

I must try to understand what its options are used for in the mqtt ... maybe the solution is there or then modify the communication from BPState to Jeedom which is useless. If I managed to get jeedom to not receive this info, then it won't do anything.
Attachments
Snag_c2bc7c5.png
Snag_c2bc7c5.png (50.72 KiB) Viewed 6520 times

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

Re: Task limit to 12 ?

#13 Post by TD-er » 09 Nov 2021, 19:58

What does Jeedom do when it receives an update?
If Jeedom does do the switching, then maybe you should not do anything in the rules.

Also what tasks do you have?
It seems like you have something called BP1 and an MCP GPIO extender. But are they the same?
Or is "BP1" a switch input connected to another extender than what you're trying to switch?

You do post a lot of rules stuff and logs, but I don't know what is connected to what.
Maybe you should not try to do all at once, but just start with 1.

Just as I mentioned here: viewtopic.php?p=55743#p55743
So please tell why you need it now, maybe we can already help you to work around this limitation right now.

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests