Search found 24 matches

by arion_p
31 May 2018, 11:22
Forum: ESP Easy: General Discussion
Topic: Rules if-then-else and fall-through
Replies: 4
Views: 5004

Re: Rules if-then-else and fall-through

A nice addition for cases like this would be a 'switch' statement, although it may be too much for the current parser.

Also and 'exit' or 'break' statement would help make some rules cleaner to read.
by arion_p
29 Apr 2018, 23:30
Forum: ESP Easy: General Discussion
Topic: Second Pulse Counter
Replies: 4
Views: 4204

Re: Second Pulse Counter

Is your sensor output open collector/ open drain? You may need to enable pull up on the GPIO. IIRC GPIO15 already has an external pull up, which would explain why it works but others don't (assuming of course open collector output). Edit: I just checked and GPIO15 usually has an external pulldown. S...
by arion_p
26 Apr 2018, 09:19
Forum: ESP Easy: General Discussion
Topic: Automated Reboot Option ?
Replies: 2
Views: 2741

Re: Automated Reboot Option ?

You can use rules to do that:

Code: Select all

on Clock#Time=All,03:00 do
  reboot
endon
by arion_p
25 Apr 2018, 22:44
Forum: ESP Easy: General Discussion
Topic: dev build free memory
Replies: 5
Views: 4187

Re: dev build free memory

Just did a build with only stable plugins + p115 + my own (based on MQTT Import) and got ~10K free RAM. Switching to 2.3.0 core added another 3.5K free RAM.
by arion_p
25 Apr 2018, 09:01
Forum: ESP Easy: General Discussion
Topic: dev build free memory
Replies: 5
Views: 4187

Re: dev build free memory

Well, yes and no. My main project only needs P115 HeatpumpIR. With the recent changes I can now create a custom plugin set to include P115 (and probably exclude some plugins that I won't need). The other thing I'm currently working on is a rules compiler. The rules are being compiled on the browser ...
by arion_p
25 Apr 2018, 01:13
Forum: ESP Easy: General Discussion
Topic: dev build free memory
Replies: 5
Views: 4187

dev build free memory

I just updated my local git repo from upstream (24-04-2018) and rebuild an new firmware. Now I get around 6500 bytes free RAM!

Is this normal? is free RAM so low on recent (official) dev builds or am I doing something wrong?

Thanks in advance.
by arion_p
08 Apr 2018, 22:48
Forum: ESP Easy: General Discussion
Topic: loop over all plugins optimisation
Replies: 2
Views: 3009

Re: loop over all plugins optimisation

Another option that could speed execution of rules would be to compile the rules to some sort of IL(*). That would not only speed up the rules but would also allow more complex rules. The compiler need not be written in C. It can be written in Javascript and use one of the many open source parser ge...
by arion_p
07 Apr 2018, 15:20
Forum: ESP Easy: General Discussion
Topic: MQTT max characters
Replies: 3
Views: 3023

Re: MQTT max characters

In most cases topic length is limited to 40 bytes (plus terminating null). I am not aware of any exceptions, bit I' fairly new, so take it with a grain of salt. I can't remember the value limit but that should not be a problem considering only float values are accepted (exception: Publish command in...
by arion_p
27 Mar 2018, 12:28
Forum: ESP Easy: General Discussion
Topic: How many Nested EVENTS?
Replies: 16
Views: 13886

Re: How many Nested EVENTS?

As such there should be no limit on how many events can be nested. That is not true. Every nested event will consume stack space. As a result the maximum nesting level is limited by stack space (RAM). I don't know if there is protection against stack overflow. If there is, the expected behaviour wo...
by arion_p
21 Mar 2018, 18:43
Forum: ESP Easy: General Discussion
Topic: Hummm, so where is the - I'm a dork" section? :-)
Replies: 10
Views: 7191

Re: Hummm, so where is the - I'm a dork" section? :-)

They also have the same public port which actually IS the issue. The router has no way of knowing which rule to use when connecting from the outside to port 80. Furthermore, some ISPs block port 80, so using another port will solve both issues. Finally there is a source ip address. I don't know what...
by arion_p
17 Mar 2018, 19:23
Forum: ESP Easy: General Discussion
Topic: Dynamic SleepMode
Replies: 11
Views: 9727

Re: Dynamic SleepMode

I used the portable syslog server mentioned here , and see this: it looks like the SystemSleep Rule is executed 3 times: .... I have also seen that it was executed 2 times (when the OR Rule is false). Is there any explanation for this? I can see why it is executed twice (but I cannot imagine why it...
by arion_p
13 Mar 2018, 17:13
Forum: ESP Easy: General Discussion
Topic: Dynamic SleepMode
Replies: 11
Views: 9727

Re: Dynamic SleepMode

You can achieve the same result using rules and the deepSleep command. deepSleep puts the system to sleep immediately and takes one argument the duration of the sleep. So depending on the conditions you choose you can set different duration. You can use the System#Sleep event to take over control an...
by arion_p
11 Mar 2018, 02:28
Forum: ESP Easy: General Discussion
Topic: MQTT Import and deep sleep
Replies: 18
Views: 10613

Re: MQTT Import and deep sleep

As a matter of fact there is an issue with this commit https://github.com/letscontrolit/ESPEasy/commit/bcca0514dde993a5a9ec2a70e339af62d5d3fde0 . If after wake up isDeepSleepEnabled() will return true for the first iteration of the loop enabling shortcircuit running all tasks. But this will also hap...
by arion_p
11 Mar 2018, 02:13
Forum: ESP Easy: General Discussion
Topic: MQTT Import and deep sleep
Replies: 18
Views: 10613

Re: MQTT Import and deep sleep

There is no need to add a new command as there already is one: deepSleep, and I have actually tested it and it works. The only problem with this is that it will not honor some special rules that isDeepSleepEnabled() does. In particular: After cold boot, isDeepSleepEnabled() will delay sleep for 30 s...
by arion_p
11 Mar 2018, 00:12
Forum: ESP Easy: General Discussion
Topic: MQTT Import and deep sleep
Replies: 18
Views: 10613

Re: MQTT Import and deep sleep

Yes, I think that'll work much better. In the meantime I run some tests on the last version. I ended up setting the delay to 10 seconds to get MQTT Import to get a response. It seems the boot/connect process is taking quite some time and 10 seconds is marginally enough. Currently I only receive one ...
by arion_p
10 Mar 2018, 03:50
Forum: ESP Easy: General Discussion
Topic: MQTT Import and deep sleep
Replies: 18
Views: 10613

Re: MQTT Import and deep sleep

The check for deep sleep is at the end of the loop, so all is being handled at least as much as before. This is not entirely true. The check for deep sleep is done twice inside the loop, once at the top and once at the end of it. The first check shortcircuits any timouts and simply calls all 4 peri...
by arion_p
09 Mar 2018, 13:36
Forum: ESP Easy: General Discussion
Topic: MQTT Import and deep sleep
Replies: 18
Views: 10613

Re: MQTT Import and deep sleep

Sounds like a reasonable assumption to me. Also MQTT Import will subscribe after the 1st second elapses which means it has little, if any, time left to receive any values if wake up time is set to just 1 second. Another perhaps improvement would be to run all scheduled tasks once upon wake up like w...
by arion_p
09 Mar 2018, 09:30
Forum: ESP Easy: General Discussion
Topic: Analog input - internal "Oversampling"
Replies: 6
Views: 5764

Re: Analog input - internal "Oversampling"

Actually the deep sleep information may not be relevant anymore. There has been a change to deep sleep handling yesterday. I am not really sure how/if oversampling is affected by it.
by arion_p
09 Mar 2018, 09:23
Forum: ESP Easy: General Discussion
Topic: MQTT Import and deep sleep
Replies: 18
Views: 10613

Re: MQTT Import and deep sleep

grovkillen wrote: 09 Mar 2018, 09:19 Setting it up 0 gives the old behavior I think.
Actually setting it to 0 disables sleep altogether.
by arion_p
09 Mar 2018, 09:10
Forum: ESP Easy: General Discussion
Topic: MQTT Import and deep sleep
Replies: 18
Views: 10613

Re: MQTT Import and deep sleep

That's great news. I will certainly give it a try and report back. In the meantime I played a little with deepSleep command and rules. I disabled deep sleep from config and tried to get similar behaviour using rules. While it is possible, it is awkward and a lot of work if I want to implement all as...
by arion_p
08 Mar 2018, 21:58
Forum: ESP Easy: General Discussion
Topic: MQTT Import and deep sleep
Replies: 18
Views: 10613

Re: MQTT Import and deep sleep

Actually there is already a command to put system to sleep from a rule. The command is deepSleep and is effective immediatelly. As far as I can tell, deep sleep need not be enabled for this to work. It takes a parameter which is the number of seconds before the system wakes up again. You can use rul...
by arion_p
08 Mar 2018, 10:41
Forum: ESP Easy: General Discussion
Topic: Analog input - internal "Oversampling"
Replies: 6
Views: 5764

Re: Analog input - internal "Oversampling"

According to the code linked, samples are taken every 100ms (roughly).It will use as many samples as fit within the configured delay.

As far as I can tell, if deep sleep is enabled it will only take one sample
by arion_p
07 Mar 2018, 09:13
Forum: ESP Easy: General Discussion
Topic: MQTT Import and deep sleep
Replies: 18
Views: 10613

Re: MQTT Import and deep sleep

So, I guess no one is using MQTT Import along with deep sleep. Anyway, had a look at the code in GitHub and as far as I can tell this cannot possibly work. Receiving values from MQTT uses a callback that is probably called from within PubSubClient.loop() . In MQTT Import plugin PubSubClient.loop() i...
by arion_p
05 Mar 2018, 22:25
Forum: ESP Easy: General Discussion
Topic: MQTT Import and deep sleep
Replies: 18
Views: 10613

MQTT Import and deep sleep

Hi guys, I'm trying to use MQTT import with deep sleep and retain flag to send commands/data from OpenHAB to ESPEasy. I have compiled my own version using v2.0-20180130 and P155 (HeatpumpIR). I have setup some items in OpenHAB that, when changed, send their values with retain flag to MQTT broker on ...