re-entry and massive problems

Moderators: grovkillen, Stuntteam, TD-er

Message
Author
User avatar
M*I*B
Normal user
Posts: 370
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: re-entry and massive problems

#101 Post by M*I*B » 26 Dec 2022, 13:30

ok, I have hang a 0 after...
But this loop I never touch... I hung ...
If I press the button longer then 1s I got the 11 as event but the asking about at ...

Code: Select all

...
elseif [Regler#settings.enabled] = 1 and %eventvalue1% > 9 // Regler ON and Longpress?
		gpio,12,0
		TaskDisable,4
		longpulse_ms,13,1,200,200,-1
...
... will not be TRUE. I never catch this IF :?:
DLzG
Micha

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

Re: re-entry and massive problems

#102 Post by TD-er » 26 Dec 2022, 13:33

Please note that when pushing a button, the one with eventvalue set to 11 (longpress) is not the first event.
When pressed, it will send an event (with either 0 or 1) and after the longpress timeout, it will send another one.

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

Re: re-entry and massive problems

#103 Post by TD-er » 26 Dec 2022, 13:37

Oh and another one....
You are using asyncevent, which is what you should do in almost all occasions.
But you also try to evaluate the state of the button.
This state may already have been changed, since asyncevent is added to a queue and thus processed later.
So you may want to either add the button state as an extra eventvalue when generating the asyncevent, or use "event" instead.

User avatar
M*I*B
Normal user
Posts: 370
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: re-entry and massive problems

#104 Post by M*I*B » 26 Dec 2022, 13:40

... yes, you are absolutely right! While you writing this exactly that is flashing up in my brain :D

I have placed that at the 1st asking and then it goes as expected :lol:

But...
The flasher starts as expected but if the WLAN send a pulse to the same GPIO the flasher just stops ...
So you may want to either add the button state as an extra eventvalue when generating the asyncevent, or use "event" instead.
Yes, you are right again; fine tuning... I will use event. Seems to be the best way...

EDIT:
Nope... In the AND / OR / AND %eventvalue1% can be from Button or also from Regler. At this point you can't say from who it is ...
DLzG
Micha

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

Re: re-entry and massive problems

#105 Post by TD-er » 26 Dec 2022, 13:51

Like I said you can add an extra eventvalue

Code: Select all

asyncevent,Myevent=%eventvalue1%,[button#state] //Or whatever value you need there

on myevent do
  logentry,"Myevent: val1: %eventvalue1%  val2: %eventvalue2%"
endon

User avatar
M*I*B
Normal user
Posts: 370
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: re-entry and massive problems

#106 Post by M*I*B » 26 Dec 2022, 14:03

Bild_2022-12-26_143548768.png
Bild_2022-12-26_143548768.png (20.11 KiB) Viewed 1337 times
Ok, an other way that I understand it next year also:

Code: Select all

// Create own Events to check Key and LC at once
on Regler#SET do
	asyncevent,KeyCheck=%eventvalue1%
	LET,1,%eventvalue1%
endon
on Taste#BTN do
	asyncevent,KeyCheck=%eventvalue1%
	LET,2,%eventvalue1%
endon

// Ask Keypress and LC
on KeyCheck do
	if [Regler#settings.enabled] = 1 and %v2% > 9 // Regler ON and Longpress?
		gpio,12,0
		TaskDisable,4
		longpulse_ms,13,0,200,200,-1
	elseif [Regler#settings.enabled] = 0 and %v2% > 9 // Regler OFF and Longpress?
		taskvalueset,1,1,0
		TaskEnable,4
		longpulse_ms,13,1,0	
	elseif [Regler#settings.enabled] = 1 and %v1% = 1 or [Regler#settings.enabled] = 1 and %v2% = 1
		gpio,12,1
	elseif [Regler#settings.enabled] = 1 and %v1% = 0 and %v2% = 0
		gpio,12,0

	endif
endon
Now the only thingy to solve is the kick off of the flashing LED while WLAN fire on the same port. But for now I have too cook the midday meal for my family ... Time to relax a bit ...
DLzG
Micha

User avatar
M*I*B
Normal user
Posts: 370
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: re-entry and massive problems

#107 Post by M*I*B » 26 Dec 2022, 15:45

Sodele... the rolled roast is in the oven (I'm currently testing our new Bosch tripple gastro convection/grill/microwave). Let's see if at least that works :roll:

I exumed the timer again. I couldn't think of another solution in connection with the kick-off through the WLAN.

Code: Select all

// Initialize Tick-Tack with 3s on boot up
on System#Boot do
	LoopTimerSet,1,3
endon

// Create own Events to check Key and LC at once
on Regler#SET do
	asyncevent,KeyCheck=%eventvalue1%
	LET,1,%eventvalue1%
endon
on Taste#BTN do
	asyncevent,KeyCheck=%eventvalue1%,[Regler#SET],[Taste#BTN]
	LET,2,%eventvalue1%
endon

// Ask Keypress and LC
on KeyCheck do
	if [Regler#settings.enabled] = 1 and %v2% > 9 // Regler ON and Longpress?
		gpio,12,0
		TaskDisable,4
		longpulse_ms,13,0,200,200,5
	elseif [Regler#settings.enabled] = 0 and %v2% > 9 // Regler OFF and Longpress?
		taskvalueset,1,1,0
		TaskEnable,4
		longpulse_ms,13,1,0	
	elseif [Regler#settings.enabled] = 1 and %v1% = 1 or [Regler#settings.enabled] = 1 and %v2% = 1
		gpio,12,1
	elseif [Regler#settings.enabled] = 1 and %v1% = 0 and %v2% = 0
		gpio,12,0

	endif
endon

on Rules#Timer=1 do
	if [Regler#settings.enabled] = 0
		longpulse_ms,13,0,200,200,5
	endif
endon

DLzG
Micha

User avatar
M*I*B
Normal user
Posts: 370
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: re-entry and massive problems

#108 Post by M*I*B » 26 Dec 2022, 23:36

Some OT before bedtime:

1.
Sysinfo VCC shows 3.469V but real they are 3,286V (Aneng A3008, Metex M-4650, McVoice M-980T --> +/- 3mV). So it shows round about 180mV too much of. This is with all ESP's I just check (two S20, two ESP-07, one ESP-07S, one D1miniPRO)
Is there a way to calibrate that at the root without change the code and recompile and not with a Formular?

2.
If I use GPIOtoggle,13 and GPIO13 is set as WLAN->LED in "Hardware" the log show me ...

Code: Select all

ACT  : GPIOtoggle,13
GPIO : port#13 is not an output port
If I set WLAN->LED to none then it worked like expected. You ask about the funny thingy in this?
At 1st GPIO13 is always an output-port and 2nd if you use "longpulse,13,*" or simple "GPIO,13,1/0" you can manipulate GPIO13 as well. So why not with toggle? I Don't get that ...

Good n8 all ...
Last edited by M*I*B on 27 Dec 2022, 10:21, edited 1 time in total.
DLzG
Micha

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

Re: re-entry and massive problems

#109 Post by TD-er » 27 Dec 2022, 00:29

When you use the ADC plugin (the internal ADC) you can easily set a 2-point calibration, of which you only need to set 1 (the other one is 0 -> 0)

N.B. on my S20 I used this one for the ADC (when using a VCC build)
1024 -> 0.968

User avatar
M*I*B
Normal user
Posts: 370
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: re-entry and massive problems

#110 Post by M*I*B » 27 Dec 2022, 10:18

... yes, that is what I'm looking for... But where can I do that???

Ok, you mean the extra Device "Analog input - internal ", aren't you?
If so we are talking about different things. Picture shows more then 1000 words...
Bild_2022-12-27_103653313.png
Bild_2022-12-27_103653313.png (18.32 KiB) Viewed 1276 times
DLzG
Micha

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

Re: re-entry and massive problems

#111 Post by Ath » 27 Dec 2022, 10:51

In the Formula field for Value VCC you can enter "%value%*0.947", that should get you the correction factor applied
/Ton (PayPal.me)

User avatar
M*I*B
Normal user
Posts: 370
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: re-entry and massive problems

#112 Post by M*I*B » 27 Dec 2022, 11:10

... unfortunately not. This changes the value sent to the activated controller, but not the value in the device itself ... I have check that out yesterday ...
DLzG
Micha

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

Re: re-entry and massive problems

#113 Post by TD-er » 27 Dec 2022, 12:54

M*I*B wrote: 27 Dec 2022, 11:10 ... unfortunately not. This changes the value sent to the activated controller, but not the value in the device itself ... I have check that out yesterday ...
That would be a bug...
<checking calendar>.... yep allowed...</>

User avatar
M*I*B
Normal user
Posts: 370
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: re-entry and massive problems

#114 Post by M*I*B » 27 Dec 2022, 12:58

... LOL ... Then call me BUG-DIGGER right now :lol: :lol: :lol:

I just think a bit about...
The formular- field is more for other stuff in my eyes and not the place to calibrate the ADC. Is'tn it possible to to create a command like "CalADC,<adc>,<factor>" that you just can enter by hand at TAB "Tools" and store that into the flash? So to use the topic viewtopic.php?p=61994#p61994 point 1. as example I just type "CalADC,1,0.947247"?

Command back!
I just test the formula- field at "Generic - System Info#VCC" again and now it works also local?! Ok, now I'm a little confused... I have try it more then 5 times yesterday and never get a changing; don't ask me why it works now.. I have no idea :?
DLzG
Micha

User avatar
chromo23
Normal user
Posts: 827
Joined: 10 Sep 2020, 16:02
Location: germany

Re: re-entry and massive problems

#115 Post by chromo23 » 27 Dec 2022, 13:24

I just wanted to write you that i tested formulas in sysinfos and it worked.... :)
So no bug....

EDIT: i guess it was inference with the bosch microwave :D

User avatar
M*I*B
Normal user
Posts: 370
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: re-entry and massive problems

#116 Post by M*I*B » 27 Dec 2022, 13:34

chromo23 wrote: 27 Dec 2022, 13:24 i guess it was inference with the bosh microwave :D
... don't ask me that :lol: I have no idea. Can also be my amateur radios or my copter or just the little green christmas elves ... I have no idea :roll:
The only thing I know is that our new superdupercombi oven was worth the money. Extremely delicious rolled roast in a third of the time... Awesome number 8-)
DLzG
Micha

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

Re: re-entry and massive problems

#117 Post by Ath » 27 Dec 2022, 13:51

M*I*B wrote: 27 Dec 2022, 12:58 ... LOL ... Then call me BUG-DIGGER right now :lol: :lol: :lol:
I'd suggest M*I*B = Man In Bughunt :lol:
M*I*B wrote: 27 Dec 2022, 12:58 I just test the formula- field at "Generic - System Info#VCC" again and now it works also local?! Ok, now I'm a little confused... I have try it more then 5 times yesterday and never get a changing; don't ask me why it works now.. I have no idea :?
As the last release hasn't touched anything in that area, I withheld my response until you would find it to be working as intended 8-) ;), and then, experience taught me that sometimes bugs are healed by time passing by...
/Ton (PayPal.me)

User avatar
M*I*B
Normal user
Posts: 370
Joined: 22 Jan 2018, 15:47
Location: Germany
Contact:

Re: re-entry and massive problems

#118 Post by M*I*B » 27 Dec 2022, 14:02

experience taught me that sometimes bugs are healed by time passing by...
... yep, sometimes things happen that make you wonder what's going on... especially these days :roll: :lol:
DLzG
Micha

Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 12 guests