version 20220809 eventvalue=0 does not work any more?

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
_Cyber_
Normal user
Posts: 113
Joined: 20 Oct 2019, 09:46

version 20220809 eventvalue=0 does not work any more?

#1 Post by _Cyber_ » 15 Aug 2022, 17:32

Hello,

after update from 20220616 to 20220809 (ESP32 normal build in both cases) it looks like a event where eventvalue1 equals 0 is ignored.

following command and following rules:

command: event,ControlSZ=0

Code: Select all

on ControlSZ do
 Let,5,1  // Taskvalue Device
 Let,6,2  // Taskvalue Variable
 Let,7,=[SZ#S1] // Current shutter state
 Let,8,20 // Timer Seconds requested VAR Number
 Let,9,21 // Timer shutter direction VAR Number
 Let,10,20 // timershared shutter VAR Number
 Let,11,24 // shutter syssec_d start
 event,ControlShutter=%eventvalue1%,4,16,28
endon
and the called event ControlShutter:

Code: Select all

on ControlShutter do
 //control?cmd=event,ControlShutter=0
 // control shutter, in percent.
logentry,"here1"
 if %eventvalue1% >= 0 and %eventvalue1% <= 100 and [INT#%v8%] = 0
logentry,"here2"
  //open/close percent / complete
  Let,12,%eventvalue4%
  Let,13,(%eventvalue4%/100)*%eventvalue1%
  Let,14,(%eventvalue4%/100)*[VAR#7]
  if %eventvalue1% = 0 or [VAR#14] > [VAR#13]
   //open a bit / complete
   if %eventvalue1% != 0
    Let,12,[VAR#14]-[VAR#13]
   endif
   logentry,"GPIO=%eventvalue2%,%eventvalue3%_open_secs=[VAR#12]"
  elseif %eventvalue1% = 100 or [VAR#14] < [VAR#13]
   //close a bit / complete
   if %eventvalue1% != 100
    Let,12,[VAR#13]-[VAR#14]
   endif
   logentry,"GPIO=%eventvalue2%,%eventvalue3%_close_secs=[VAR#12]"
  else
   logentry,"something went wrong. VAR#13=[VAR#13] VAR#14=[VAR#14]"
  endif
  if [INT#12] > 0
   gpio,2,0
   TimerSet,8,[INT#12]
   TaskValueSet,[INT#5],4,1
   //delay,250
   LongPulse,%eventvalue2%,0,[INT#12]
   if %eventvalue1% = 0 or [VAR#14] > [VAR#13]
    LongPulse,%eventvalue3%,0,[INT#12]
    Let,%v9%,-1
   elseif %eventvalue1% = 100 or [VAR#14] < [VAR#13]
    gpio,%eventvalue3%,1
    Let,%v9%,1
   else
    logentry,"something went wrong. VAR#13=[VAR#13] VAR#14=[VAR#14]"
   endif
   Let,%v8%,[INT#12]
   //monitor gpio,%eventvalue2%
   if [INT#%v10%] > [INT#12] or [INT#15] > [INT#12]
    logentry,"TimerIDX 5 already set to [INT#%v10%] or [INT#15]"
   else
    Let,15,[INT#12]
    Let,16,%syssec_d%
    loopTimerSet_ms,5,1000,[INT#12]
   endif
  else
   logentry,"GPIO=%eventvalue2%,%eventvalue3% drive_secs below 1, nothing to do"
   TaskValueSet,[INT#5],[INT#6],%eventvalue1%
  endif
 elseif %eventvalue1% >= 0 and %eventvalue1% <= 100 and [INT#%v8%] != 0
  logentry,"GPIO=%eventvalue2%,%eventvalue3% currently active, need stop first!"
  logentry,"GPIO=%eventvalue2%,%eventvalue3%_stop"
  LongPulse,%eventvalue2%,0,0
  LongPulse,%eventvalue3%,0,0
  Let,%v8%,0
  event,ControlShutter,%eventvalue1%,%eventvalue2%,%eventvalue3%,%eventvalue4%
 elseif %eventvalue1% = 101
  //stop shutter
  logentry,"GPIO=%eventvalue2%,%eventvalue3%_stop"
  LongPulse,%eventvalue3%,0,0
  LongPulse,%eventvalue2%,0,0
  Let,%v8%,0
 elseif %eventvalue1% = 102 and [INT#%v8%] = 0
  //Cooling Mode
  logentry,"GPIO=%eventvalue2%,%eventvalue3%_cooling_mode to [INT#2] percent"
  event,ControlShutter=[INT#2],%eventvalue2%,%eventvalue3%,%eventvalue4%
 elseif %eventvalue1% = 103 and [INT#%v8%] = 0
  //slittingTOP
  //gpio,2,0
  //LongPulse,%eventvalue2%,0,2000
  //LongPulse,%eventvalue3%,0,2000
 elseif %eventvalue1% = 104 and [INT#%v8%] = 0
  //slittingALL
 endif
endon
this leads to the following log:

Code: Select all

428035: HTTP: event,ControlSZ=0
428105: EVENT: ControlSZ=0
428115: ACT : Let,5,1
428120: ACT : Let,6,2
428128: ACT : Let,7,=1.00
428132: ACT : Let,8,20
428136: ACT : Let,9,21
428140: ACT : Let,10,20
428144: ACT : Let,11,24
428148: ACT : event,ControlShutter=0,4,16,28
428151: EVENT: ControlShutter=0,4,16,28
and nothing more.

expected: here1, here2, GPIO=4,16_open_secs=28, and some more.

if I do the command event,ControlSZ=1 it works as expected:

Code: Select all

409276: HTTP: event,ControlSZ=1
409327: EVENT: ControlSZ=1
409338: ACT : Let,5,1
409342: ACT : Let,6,2
409350: ACT : Let,7,=0.00
409355: ACT : Let,8,20
409359: ACT : Let,9,21
409363: ACT : Let,10,20
409367: ACT : Let,11,24
409371: ACT : event,ControlShutter=1,4,16,28
409373: EVENT: ControlShutter=1,4,16,28
409382: ACT : logentry,'here1'
409384: here1
409395: ACT : logentry,'here2'
409397: here2
409398: ACT : Let,12,28
409402: ACT : Let,13,(28/100)*1
409407: ACT : Let,14,(28/100)*0
409436: ACT : Let,12,0.28-0
409442: ACT : logentry,'GPIO=4,16_close_secs=0.28'
409445: GPIO=4,16_close_secs=0.28
409500: ACT : logentry,'GPIO=4,16 drive_secs below 1, nothing to do'
409502: GPIO=4,16 drive_secs below 1, nothing to do
409505: ACT : TaskValueSet,1,2,1
428035: Webserver 1 Arguments: 0: 'cmd' length: 17
and also other values work correctly, only 0 not.
I did already change all %eventvalue% to %eventvalue1% in this code with no effect.
downgrading to 20220616 and the rules work as expected also with 0 again.

any ideas?

Thanks!

BR
Alois

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

Re: version 20220809 eventvalue=0 does not work any more?

#2 Post by Ath » 15 Aug 2022, 18:58

That's already reported in issue #4198 and being worked on.
/Ton (PayPal.me)

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

Re: version 20220809 eventvalue=0 does not work any more?

#3 Post by TD-er » 15 Aug 2022, 21:59

Yep, so we're now at 3 quite serious issues since the last build... (this one and issues with flashing ESP32 boards and Homey HTTP controller no longer works with authentication)

Well that will teach me not to mention to Ton that we haven't seen any issues about the new build in the 2 days after I made it.

_Cyber_
Normal user
Posts: 113
Joined: 20 Oct 2019, 09:46

Re: version 20220809 eventvalue=0 does not work any more?

#4 Post by _Cyber_ » 18 Aug 2022, 11:04

TD-er wrote: 15 Aug 2022, 21:59 Yep, so we're now at 3 quite serious issues since the last build... (this one and issues with flashing ESP32 boards and Homey HTTP controller no longer works with authentication)

Well that will teach me not to mention to Ton that we haven't seen any issues about the new build in the 2 days after I made it.
TD-er, Ton feel free to just mention me on github if you want to have one instance more for testing before release. I have currently over 15 units (except one ESP32 all ESP8266) and most of them are not critical and good accessible even by serial.

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

Re: version 20220809 eventvalue=0 does not work any more?

#5 Post by TD-er » 18 Aug 2022, 11:15

Can you test this GH Actions build when it is ready? https://github.com/letscontrolit/ESPEas ... 2881297409

_Cyber_
Normal user
Posts: 113
Joined: 20 Oct 2019, 09:46

Re: version 20220809 eventvalue=0 does not work any more?

#6 Post by _Cyber_ » 18 Aug 2022, 15:57

the zero eventvalue works with this build again.

i have flashed ESP_Easy_mega_20220818_normal_ESP32_4M316k.bin - I am on the ESP32 now still at mode:DOUT, clock div:2 so I guess I can not change this mode any more to test update as well?

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

Re: version 20220809 eventvalue=0 does not work any more?

#7 Post by TD-er » 18 Aug 2022, 17:36

In the latest GH Actions build of that PR that I linked the flash mode is locked to DOUT, so that's perfect.
Ton is doing a lot of testing work now to check what effects using different flashing tools and flashing modes may have on older builds upgrading to newer builds so that we can give a well educated advice on what units should be upgraded using what tools and settings.

N.B. where do you see the clock div. 2?

_Cyber_
Normal user
Posts: 113
Joined: 20 Oct 2019, 09:46

Re: version 20220809 eventvalue=0 does not work any more?

#8 Post by _Cyber_ » 19 Aug 2022, 12:20

I can see this in seriallog on booting. See here: viewtopic.php?t=9215

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

Re: version 20220809 eventvalue=0 does not work any more?

#9 Post by TD-er » 19 Aug 2022, 12:57

Ah check!

Code: Select all

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DOUT, clock div:2
I'm almost certain this means the flash speed is set to 40 MHz.
But I'm not sure if this is about the bootloader speed, or the speed of the flash when the "sketch" is active.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 21 guests