Limit of task in file.esp ?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
a_k
Normal user
Posts: 12
Joined: 16 Aug 2019, 09:10

Limit of task in file.esp ?

#1 Post by a_k » 12 Sep 2019, 17:30

https://www.letscontrolit.com/wiki/inde ... _Dashboard

Is it normal for me to add a maximum of 9 tasks? Subsequent ones do not return any value...

Screen Shot 09-12-19 at 05.29 PM.PNG
Screen Shot 09-12-19 at 05.29 PM.PNG (38.06 KiB) Viewed 260 times
Screen Shot 09-12-19 at 05.29 PM 001.PNG
Screen Shot 09-12-19 at 05.29 PM 001.PNG (19.19 KiB) Viewed 260 times

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

Re: Limit of task in file.esp ?

#2 Post by TD-er » 12 Sep 2019, 22:08

A quick look at the code in WebServer_CustomPage.ino tells me that this .esp file is considered as a single command line (like in the rules)
So I think you're hitting the max. length of a command line.

If you're using shorter names, will it then stop working after 10th or later item?

a_k
Normal user
Posts: 12
Joined: 16 Aug 2019, 09:10

Re: Limit of task in file.esp ?

#3 Post by a_k » 12 Sep 2019, 22:15

Unfortunately, the situation is the same.
Screen Shot 09-12-19 at 10.15 PM.PNG
Screen Shot 09-12-19 at 10.15 PM.PNG (9.72 KiB) Viewed 217 times
Screen Shot 09-12-19 at 10.14 PM.PNG
Screen Shot 09-12-19 at 10.14 PM.PNG (3.67 KiB) Viewed 217 times

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

Re: Limit of task in file.esp ?

#4 Post by TD-er » 12 Sep 2019, 22:24

Ah, opened a new beer and now it has become clear.
Just had to hit the right Balmer peak I guess :)

Code: Select all

/********************************************************************************************\
  Parse string template
  \*********************************************************************************************/
String parseTemplate(String &tmpString, byte lineSize)
{
  String newString = "";
  newString.reserve(lineSize);

  parseSystemVariables(tmpString, false);

  // replace task template variables
  int leftBracketIndex = tmpString.indexOf('[');
  if (leftBracketIndex == -1)
    newString = tmpString;
  else
  {
    byte count = 0;
    byte currentTaskIndex = ExtraTaskSettings.TaskIndex;

    while (leftBracketIndex >= 0 && count < 10 - 1)
    {
    [....]
      leftBracketIndex = tmpString.indexOf('[');
      count++;
    }
    [...]
So there you have your "10 - 1" or as some people say "9".
I have no idea yet why it is set to "10 - 1", nor if it is needed anymore.

a_k
Normal user
Posts: 12
Joined: 16 Aug 2019, 09:10

Re: Limit of task in file.esp ?

#5 Post by a_k » 12 Sep 2019, 22:54

So there's nothing I can do about it? :| I still have an idea. Create a temp2.esp and in temp1.esp create a button to quickly move between pages...

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

Re: Limit of task in file.esp ?

#6 Post by TD-er » 13 Sep 2019, 12:38

a_k wrote:
12 Sep 2019, 22:54
So there's nothing I can do about it? :| I still have an idea. Create a temp2.esp and in temp1.esp create a button to quickly move between pages...
Like I said, I have no idea why this limit was introduced in the first place, but you can try and remove (or increase) the limit to see if it does fix your issue.

a_k
Normal user
Posts: 12
Joined: 16 Aug 2019, 09:10

Re: Limit of task in file.esp ?

#7 Post by a_k » 13 Sep 2019, 17:02

How to change? Do I have to compile espeasy again?

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

Re: Limit of task in file.esp ?

#8 Post by TD-er » 13 Sep 2019, 18:13

a_k wrote:
13 Sep 2019, 17:02
How to change? Do I have to compile espeasy again?
Yep it is part of the source code.
I can also have a look at it, but that may take a while (lots and lots of other issues at hand)

a_k
Normal user
Posts: 12
Joined: 16 Aug 2019, 09:10

Re: Limit of task in file.esp ?

#9 Post by a_k » 13 Sep 2019, 18:50

If you can change it in the next version it would be great. I'll try to compile it myself...

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

Re: Limit of task in file.esp ?

#10 Post by TD-er » 13 Sep 2019, 19:34

a_k wrote:
13 Sep 2019, 18:50
If you can change it in the next version it would be great. I'll try to compile it myself...
To what value?
Like I said, I have no idea why this limit is being used in the first place, and also why it has such a strange notation (10 - 1).
So I will not change it until I know what this limit is used for and what may break if it is changed.

a_k
Normal user
Posts: 12
Joined: 16 Aug 2019, 09:10

Re: Limit of task in file.esp ?

#11 Post by a_k » 13 Sep 2019, 19:59

20 would be enough. Or maybe you want to compile such a bulid especially for me?

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

Re: Limit of task in file.esp ?

#12 Post by TD-er » 14 Sep 2019, 22:47

a_k wrote:
13 Sep 2019, 19:59
20 would be enough. Or maybe you want to compile such a bulid especially for me?
Just to let you know, I've been taking a thorough look at the code and made some major changes.
See pull request https://github.com/letscontrolit/ESPEasy/pull/2617

I will build a test build for it, so you can test if it all is working.
It should have no limit any more, except for free memory (which is different per configuration)
At least it should be using quite a bit less memory allocations, which does save time and resources.

Edit:
Please try this test build: https://www.dropbox.com/s/68u55dhvayhok ... 7.zip?dl=0

a_k
Normal user
Posts: 12
Joined: 16 Aug 2019, 09:10

Re: Limit of task in file.esp ?

#13 Post by a_k » 15 Sep 2019, 00:26

Now it's working great. ;) 35 lines and each one gets the data correctly. Is it possible to use it in subsequent versions? I would like to use the latest versions with this feature :)
Screen Shot 09-15-19 at 12.24 AM.PNG
Screen Shot 09-15-19 at 12.24 AM.PNG (48.46 KiB) Viewed 44 times

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

Re: Limit of task in file.esp ?

#14 Post by TD-er » 15 Sep 2019, 00:55

Well, it is a pull-request, meant to be merged eventually (likely tomorrow)

I've spent almost all free time of today on it to make the routine as memory efficient as possible, since it was quite a resource user with all the memory allocations done inside.
So let's hope it will also make ESPeasy more stable.

Post Reply

Who is online

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