rules problem

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
tiger125
New user
Posts: 8
Joined: 03 Feb 2021, 10:08

rules problem

#1 Post by tiger125 » 10 Feb 2025, 12:19

Hi,

I have a pulse monitor. Nodemcu v2 is restarted every day. After that, it usually happens that the rules menu is switched off and all the devices in the device menu are disabled.

What is causing this random behavior?

Attached is the setting and the rule I use!

Anyone have an idea what's causing it?
Attachments
rule.png
rule.png (24.4 KiB) Viewed 1881 times
06.png
06.png (69.69 KiB) Viewed 1881 times
05.png
05.png (62.49 KiB) Viewed 1881 times
04.png
04.png (51.82 KiB) Viewed 1881 times
03.png
03.png (46.94 KiB) Viewed 1881 times
02.png
02.png (47.93 KiB) Viewed 1881 times
01.png
01.png (50.75 KiB) Viewed 1881 times

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

Re: rules problem

#2 Post by TD-er » 10 Feb 2025, 12:24

Can you copy/paste the rules as text in the [ code ] ... [ /code ] tags (without the spaces)?

The last "on clock#time ..."
doesn't have a closing "endon"

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

Re: rules problem

#3 Post by TD-er » 10 Feb 2025, 12:30

If you experience that tasks/controllers or rules are disabled after a reboot, then ESPEasy has detected it was crashing a lot and did just try to disable items one-by-one till it successfully completes a (re)boot.

So there is something which causes the ESP to reboot which may be resolved by disable the rules.

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

Re: rules problem

#4 Post by TD-er » 10 Feb 2025, 12:36

Can you also disable the rule to reboot at 2 minutes past midnight?
If the ESP is somehow unable to get the time via NTP, then it might trigger this behavior as the system time is then starting at 00:00 when no system time is set.

tiger125
New user
Posts: 8
Joined: 03 Feb 2021, 10:08

Re: rules problem

#5 Post by tiger125 » 10 Feb 2025, 15:43

I don't use the daily restart now!
However, it may be a hardware problem, because nodemcu v2 has a hard time trying to recover and starts to restart the power supply!

Now I'm using the esp32c3 supermini, but even there for some reason I sometimes lose the network connection with it. I use this for the other devices as well, and there really isn't a problem with them. If the Wi-Fi signal strength is bad, it is possible that the esp does not connect to the network!

Code: Select all

// Generic - Dummy Device, name: Gasmeter, output data type: LastAction (0 decimals),  LastTotal (5 decimals),SummaTimes (0 decimals), Total (5 decimals)

On GPIO#2 Do // GPIO-2 = D0 on boards
  If %eventvalue1%=0 
    Let,1,%syssec_d% 
  Else 
    Event,Calc
    AsyncEvent,TransmitPower 
  Endif
  Let,5,!%eventvalue1%
  LogEntry,"Fogyasztás [int#5#O#C], Mért: [Gasmeter#SummaTimes] másodperc [Gasmeter#Total#d.4] m3"
Endon

On Calc Do
  TaskValueSet,Gasmeter,SummaTimes,[Gasmeter#SummaTimes]+%syssec_d%-[int#1],LastAction
  Let,4,[Gasmeter#SummaTimes]*[var#3]
  If [var#4]>0
    TaskValueSet,Gasmeter,LastAction,%syssec_d%-[int#1]
    TaskValueSet,Gasmeter,LastTotal,(%syssec_d%-[int#1])*(2.8/3600)
    TaskValueSet,Gasmeter,Total,[var#4]/3600
  Endif
  TaskRun,Gasmeter
Endon

On TransmitPower Do
  SENDTOHTTP 192.168.0.10,80,/devices/gazkazan/gazkazan_run.php?LASTACTION=[Gasmeter#LastAction]&LASTTOTAL=[Gasmeter#LastTotal]&SUMMATIMES=[Gasmeter#SummaTimes]&TOTAL=[Gasmeter#Total]
Endon

On Clock#Time=All,00:00 Do
  If [Plugin#GPIO#PinState#2]=0 
    Event,Calc
  Endif
  Let,1,0 
  TaskValueSet,Gasmeter,LastAction,0
  TaskValueSet,Gasmeter,LastTotal,0
  TaskValueSet,Gasmeter,SummaTimes,0
  TaskValueSet,Gasmeter,Total,0
Endon

On System#Boot Do
  Monitor,gpio,2
  Let,3,(2.8) // 2.8m3/h a gázkazán fogyasztása //2.6
Endon

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

Re: rules problem

#6 Post by TD-er » 10 Feb 2025, 16:05

Yep, a stable power supply is important for a stable WiFi connection.
When starting the WiFi radio, a RF calibration is performed.
The RF calibration is highly dependent on the supplied voltage.
Also RF calibration takes over 500 mA in very short peaks. So if your power supply can't keep up with these short spikes, or your wires are too thin, the actual voltage supplied will dip quite a bit and thus render the RF calibration useless.

Also make sure there is no metal near the antenna, as this affects the antenna tuning.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 18 guests