re-entry and massive problems

Moderators: grovkillen, Stuntteam, TD-er

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

Re: re-entry and massive problems

#51 Post by TD-er » 22 Dec 2022, 17:55

OK, maybe I should be a bit more bold here....
DO NOT USE THIS FLASHER!!!

Apparently on your system it is trying to use some quirks which will not work well on your setup.

It is known that this flasher will not correctly recognize some USB to serial chips. The exact cause is unknown. It can be due to drivers, or perhaps how it was once set in the Windows registry.

Anyway, if there is some terminal tool open (to read the logs), you will get an error when accessing the COM port.
This is regardless the flashing tool.

When you can't find what program is still accessing the COM port, you may disconnect and reconnect the USB device.

The Espressif Download Tool is a lot more predictable in its flashing.

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

Re: re-entry and massive problems

#52 Post by M*I*B » 22 Dec 2022, 18:35

Hey, calm down, take a break and a beer :D :D :D

I have take a look at the other tool but there are so many things to switch and tick that I'm afraid to make some bullshit...
The most thing is that the lowest "Flash size" I can chose is 4Mbit but the S20 only have 1M flash... Or am I wrong?!?
I will try it... But for some minutes the new S20 arrived. Just solder a pin header and Flashed it...

But what's that?!?
I have just create two devices (Button and Relais), identically like all my other S20. And also just copy&past the simple button-> relais rule... and... Nothing :?: :?: :?: :?:
I can set GPIO-12 manually and the value for Relais#RLY changes (and the blue LED goes on or off). Also if I push the button value for Taste#BTN changes. but the simple rule do nothing, even if I use "eventvalue1% instead of [Taste#BTN] (see viewtopic.php?p=61789#p61789)
... and yes; rules are enabled ... 8-)


Ohhh WOW...
If "Single event with all values:" set then it doesn't work in any way. Then %eventvalue1% is empty ever and [Taste#BTN] and also [Taste#All] isn't usable in a rule. If there anything I'm overseen?
Attachments
Bild_2022-12-22_183414310.png
Bild_2022-12-22_183414310.png (48.21 KiB) Viewed 3264 times
DLzG
Micha

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

Re: re-entry and massive problems

#53 Post by Ath » 22 Dec 2022, 19:54

M*I*B wrote: 22 Dec 2022, 18:35 The most thing is that the lowest "Flash size" I can chose is 4Mbit but the S20 only have 1M flash... Or am I wrong?!?
4 Mbit == 512 kByte = 0.5 MB so for the 1MB units you should select the 8 Mbit option
M*I*B wrote: 22 Dec 2022, 18:35 If "Single event with all values:" set then it doesn't work in any way. Then %eventvalue1% is empty ever and [Taste#BTN] and also [Taste#All] isn't usable in a rule. If there anything I'm overseen?
You are not responding to the taste#All event, but to the taste#BTN event, so it is to be expected nothing happens :lol:
The UI states that an event taskname#All with all available values will be generated...

Best bet for now: Turn off that Single event option, not much use for it when having a single value, the intended use is for environment sensors that have 2..4 values, measured at the same time, that you would want to send to some external system, without using a Controller (f.e. because there is no matching controller available...). Before this option was added, you had to gather multiple sensor values in a Dummy or some [var#X] variables, and send them out after all are available. Having them all at once is much more Easy 8-)
/Ton (PayPal.me)

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

Re: re-entry and massive problems

#54 Post by M*I*B » 22 Dec 2022, 20:40

Ahhh F*** :roll: BYTE and BIT are different, aren't they? :lol: :lol: :lol: :lol:
Need some new glasses I think :ugeek:
You are not responding to the taste#All event, but to the taste#BTN event, so it is to be expected nothing happens :lol:
Nope... I have try both but both don't work ...
Turn off that Single event option, not much use for it when having a single value,
Yep, you are absolutely right. I have tick that by mistake and haven't noticed that. Takes a while to find that... :roll:

Meanwhile the new S20 works well with the last FW and the Regulator thingy... I also have drilled the hole for the 3.5mm plug and install it all, incl. the missing earth-wire to gnd.
If I have time I also try to solder fine wire to the unused GPIO's. Who knows when I need that (Sonoff S20 with OLED? :lol: )
I also have buy two S20 where WiFi don't work while plugged on. Only if powered directly by 3v3 WiFi works well. Great way to burn time to find the problem (think some bad at the internal power supply)
DLzG
Micha

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

Re: re-entry and massive problems

#55 Post by Ath » 22 Dec 2022, 20:52

M*I*B wrote: 22 Dec 2022, 20:40 I also have buy two S20 where WiFi don't work while plugged on. Only if powered directly by 3v3 WiFi works well. Great way to burn time to find the problem (think some bad at the internal power supply)
You can try to fix that by replacing the capacitors in the power supply by better quality components, of the same specs (voltage should be the same or higher, polarity is important, but you seem to be experienced with electronics). Sonoff is really cutting corners in their design, and the cheap Chinese manufacturers often cut some more corners to scrape off a few pennies.
/Ton (PayPal.me)

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

Re: re-entry and massive problems

#56 Post by M*I*B » 22 Dec 2022, 21:02

but you seem to be experienced with electronics
Yepp, that's right.
by replacing the capacitors in the power supply by better quality components,
And yes, that is also my opinion. But 1st I try to make a oscillogram of the power source to see whats really happens. I think there a short break downs and/or dropouts in the switching regulator. The whole thingy is knitted with a hot needle (here we say so...) :roll:
DLzG
Micha

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

Re: re-entry and massive problems

#57 Post by Ath » 22 Dec 2022, 21:14

M*I*B wrote: 22 Dec 2022, 21:02 The whole thingy is knitted with a hot needle (here we say so...) :roll:
Often the quality is directly relatable to the price...
/Ton (PayPal.me)

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

Re: re-entry and massive problems

#58 Post by TD-er » 22 Dec 2022, 22:20

DON'T!!!!
Do not connect your scope to the power supply of the Sonoff.

Well, unless you really know what you're doing and using a variable transformer or something else to proper isolate the mains from what you're trying to measure.

Edit: Just searched for a some variac (variable transformer) and the ones I saw were all NOT isolated.
So those cannot be used to isolate the device from mains.


The problem with a scope is that the GND of the probes is connected to the earth pin of the mains plug.
That will at least trip your breaker, but more likely kill your scope.


Have you tried the exact build I linked?
The reason I'm nagging about it is that that exact build is running on a S20 here and it is running really stable.

If you have access to the WiFi when powering it via 3V3, you may want to check the "ECO mode" on the tools->Advanced page.
This will reduce the power consumption, which may give some extra breathing room for the weak power supply.

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

Re: re-entry and massive problems

#59 Post by M*I*B » 22 Dec 2022, 22:48

... calm down my friend :lol: You didn't take my advice to relax and have a beer, did you? 8-)

Trust me when I tell you that I have two degrees in electronics and worked in electronics development (hardware) and mechanical engineering for decades until last year...

https://www.kie-hb.de/en
https://www.ibpmt.com/
https://iwsmesstechnik.de/
https://www.pms-electronics.de/

Unfortunately I'm probably out now. At almost 61, no one wants me anymore. In addition, I'm slowly beginning to forget a lot and I have to read things up more and more often or ask questions like here to get back into it. The one thing I kind of never forget is anything tube related. This has been with me my whole life and I still repair and restore historic radio and audio equipment...
DLzG
Micha

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

Re: re-entry and massive problems

#60 Post by TD-er » 22 Dec 2022, 23:16

OK, I will calm down... and take my beer.
The "DO NOT USE THIS FLASHER" in my previous reply was in caps as I wanted to put it a bit more bold :)

And the DON'T in my previous reply is also meant to those who might read these posts when searching for something and may be thinking it might be a good idea to use a scope on mains connected devices.


One way to keep the brain in condition is to actually use it.
So maybe I will be a bit more cryptic in my posts to keep that brain of yours active :)

Just clicking through the links and I think you may have forgotten more than I have ever learned about electronics and you may still beat me in knowledge :)
At least you have (at least) 2 degrees more than I have.

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

Re: re-entry and massive problems

#61 Post by M*I*B » 22 Dec 2022, 23:20

At least you have (at least) 2 degrees more than I have.
... actually three, but my first degrees as a blacksmith has nothing to do with electronics; if at all with mechanical engineering ;)
DLzG
Micha

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

Re: re-entry and massive problems

#62 Post by TD-er » 22 Dec 2022, 23:35

Probably more since my last one was for tying my own shoe laces....

Oh and being a blacksmith has tought you all about "percussive maintainance", which has its applications in both mechanics and electronics :)

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

Re: re-entry and massive problems

#63 Post by M*I*B » 23 Dec 2022, 08:37

TD-er wrote: 22 Dec 2022, 23:35 Oh and being a blacksmith has tought you all about "percussive maintainance", which has its applications in both mechanics and electronics :)
Definitive! This reduces the waste volume of disposed Chinese scrap enormously!
You often need it with our vintage cars/machines... They don't have a diagnostic connector, but sometimes they even have a holder for a 5kg hammer (Atlas 1200) :D :lol:
Attachments
Bild_2022-12-23_083809240.png
Bild_2022-12-23_083809240.png (308.44 KiB) Viewed 3160 times
DLzG
Micha

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

Re: re-entry and massive problems

#64 Post by M*I*B » 23 Dec 2022, 10:38

Ok, after breakfast I try to make it more comfortable... and failed again :(

Code: Select all

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

// Let the LED blink if Task "Regler" disabled
on Rules#Timer=1 do
	if [Regler#settings.enabled] = 0 and [Dummy#LED] = 1
		gpio,13,0
	elseif [Regler#settings.enabled] = 0 and [Dummy#LED] = 0
		gpio,13,1
	endif
endon

// Ask Keypress
on Taste#BTN do
	if [Regler#settings.enabled] = 1 and %eventvalue1% > 9 // Regler ON and Longpress?
		TaskDisable,4
		gpio,12,0
	elseif [Regler#settings.enabled] = 0 and %eventvalue1% > 9 // Regler OFF and Longpress?
		TaskEnable,4
	elseif [Regler#SET] = 1 or %eventvalue1% = 1
		gpio,12,1
	elseif [Regler#SET] = 0 and %eventvalue1% = 0
		gpio,12,0
	endif
endon
What I'm unsure about is the stuff mit the "LongPress" and the asking if a Task are enabled or disabled. "TaskEn-/Disable,x" woks well by hand so I believe correct.
The Taskname of the "Regulator - Level Control" is "Regler" and the 4th task. So is that right if I ask "if [Regler#settings.enabled] = 0/1 then blabla" ?
And what's about the LongPress- Thingy? I have set it as "Active at LOW and HIGH" so the event have to be 10 or 11 (and at least higher then 9) while LongPress and have to be 0 or 1 after ShortPress...


What am I doing wrong?
DLzG
Micha

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

Re: re-entry and massive problems

#65 Post by TD-er » 23 Dec 2022, 11:14

What build are you using?
The .enabled feature was only programmed days ago, thus only available in test builds.

Just as a tip for debugging rules, use the logentry command.
Keep in mind you need to probably wrap the argument in quotes as you probably use a space (which is an argument separator)

Code: Select all

LogEntry,"Regler enabled: [Regler#settings.enabled] DummyLed: [Dummy#LED]"
N.B. you can also send this single command via the command field on the Tools page and have another tab open with the web logs.
If it doesn't get replaced, then you know the .enabled feature is not yet present in your build.

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

Re: re-entry and massive problems

#66 Post by M*I*B » 23 Dec 2022, 11:38

I use the last I think: ESP_Easy_mega_20221213_normal_ESP8266_1M_VCC

Ok, then I haven't it yet... shitt...
DLzG
Micha

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

Re: re-entry and massive problems

#67 Post by TD-er » 23 Dec 2022, 12:35


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

Re: re-entry and massive problems

#68 Post by M*I*B » 23 Dec 2022, 12:45

... jepp, but I'm not able to compile it by myself with my knowledge ...
I have no idea what I have to do with that stuff your provided link show me ...
DLzG
Micha

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

Re: re-entry and massive problems

#69 Post by chromo23 » 23 Dec 2022, 13:15

I feel to need say something about sonoff devices since they do not seem to have the best reputation here.
I have around 16 Sonoff devices. (2x sonoff th 16, 4x sonoff dual, 2 sonoff basic and the rest are sonoff s20 with different revisions).
They all run 24/7 for a couple of years now. They all run ESPeasy since around 2019. Some of the S20 are updated constantly since i replaced the flash with a 4MB variant. All others run with different versions of ESPeasy through the years.
They all are modified in terms of adding devices to them. E.g. almost all S20s have either a bme280, dht22, dht22+TSOP4838, ds18b20 or Oled installed and half of them sending constantly data to thingspeak.
I never had a single issue with them! (The only thing is one sonoff basic which has bad reception and therefore it needs sometimes a bit time to access the webui)

So maybe i am just lucky and if so, i hope that stays that way. :)

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

Re: re-entry and massive problems

#70 Post by chromo23 » 23 Dec 2022, 13:17

M*I*B wrote: 23 Dec 2022, 12:45 I have no idea what I have to do with that stuff your provided link show me ...
Bildschirmfoto 2022-12-23 um 13.15.34.png
Bildschirmfoto 2022-12-23 um 13.15.34.png (24.39 KiB) Viewed 3117 times

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

Re: re-entry and massive problems

#71 Post by M*I*B » 23 Dec 2022, 13:24

chromo23 wrote: 23 Dec 2022, 13:17 Bildschirmfoto 2022-12-23 um 13.15.34.png
:?: :?: :?: Right there ?
Bild_2022-12-23_132257379.png
Bild_2022-12-23_132257379.png (74.4 KiB) Viewed 3111 times
There is nothing I can download ...


EDIT: Ok, I have to have a account at GitHub... Now I can...
Last edited by M*I*B on 23 Dec 2022, 13:27, edited 1 time in total.
DLzG
Micha

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

Re: re-entry and massive problems

#72 Post by chromo23 » 23 Dec 2022, 13:27

Are you registered at GitHub? I think download is only then possible.. but i can also provide you with a binary... just one second....
EDIT: Ok, I have to have a account at GitHub... Now I can.
👍

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

Re: re-entry and massive problems

#73 Post by TD-er » 23 Dec 2022, 14:20

chromo23 wrote: 23 Dec 2022, 13:15 I feel to need say something about sonoff devices since they do not seem to have the best reputation here.
I have around 16 Sonoff devices. (2x sonoff th 16, 4x sonoff dual, 2 sonoff basic and the rest are sonoff s20 with different revisions).
They all run 24/7 for a couple of years now. They all run ESPeasy since around 2019. Some of the S20 are updated constantly since i replaced the flash with a 4MB variant. All others run with different versions of ESPeasy through the years.
They all are modified in terms of adding devices to them. E.g. almost all S20s have either a bme280, dht22, dht22+TSOP4838, ds18b20 or Oled installed and half of them sending constantly data to thingspeak.
I never had a single issue with them! (The only thing is one sonoff basic which has bad reception and therefore it needs sometimes a bit time to access the webui)

So maybe i am just lucky and if so, i hope that stays that way. :)
I also have a number of Sonoff units and the "old ones" seem to behave better than the newer ones.
But since they are not using ESP modules, but rather have the ESP soldered on their boards, these units may be a lot more susceptible to small tolerances in components.
Having the WiFi antenna etched on the PCB is probably a very cheap solution, but it is also quite tricky.
The impedance of an antenna (and the apparent "length" for 2.4 GHz signals) depends on a lot of factors.
Even the orientation of the glass fibers in the PCB substrate matters.
So when the PCB is rotated 90 degree during production, the antenna will perform differently.

Also the thickness of the PCB and the copper matters.
You can tune an antenna using capacitors, but those also have quite a tolerance.

And on top of that, I have a very strong feeling there are differences in ESP8266 silicon revisions when it comes to power consumption and WiFi stability.

TL;DR
When they're cutting costs too much, it becomes a lottery.

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

Re: re-entry and massive problems

#74 Post by M*I*B » 23 Dec 2022, 14:57

Ok ... I just wanted to let you know of my success ...
Bild_2022-12-23_141821987.png
Bild_2022-12-23_141821987.png (18.43 KiB) Viewed 3091 times
Simple work...

If you LongPress (1s) you can enable or disable the "Regulator - Level Control". If you disable it, the GPIO for the Relays will be set OFF and also the LED (who show you the WiFi in normal operation) blink fast as a warning, that you just disable the whole thingy.
If you LongPress again and switch the "Regulator - Level Control" to active, the LED goes back to normal operation (showing WiFi).
Depending on the value of the button (0/1), the controller now works in automatic mode (button value = 0) or the connected device is permanently in operation (button value = 1). The Button value is set to "0" while coming back to operative mode to prevent trouble...
So you can choose between OFF, AUTOMATIC and ON...
From FHEM I can also see all statuses and values, use the temperature for other control purposes and also change the value of the button, the switching point of the controller or the hysteresis, for example.

My construct is certainly not the last of the egg, but I'm happy with myself for now.
If anyone knows of another, better way to create this functionality... I'd love to learn!

Code: Select all

// Initialize Tick-Tack with 200ms on boot up
on System#Boot do
	LoopTimerSet_ms,1,200
endon

// Let the LED blink if Task "Regler" disabled
on Rules#Timer=1 do
	if [Regler#settings.enabled] = 0 and [Dummy#LED] = 1
		gpio,13,0
	elseif [Regler#settings.enabled] = 0 and [Dummy#LED] = 0
		gpio,13,1
	elseif [Regler#SET] = 1 or [Taste#BTN] = 1
		gpio,12,1
	elseif [Regler#SET] = 0 and [Taste#BTN] = 0
		gpio,12,0
	endif
endon

// Ask Keypress
on Taste#BTN do
	if [Regler#settings.enabled] = 1 and %eventvalue1% > 9 // Regler ON and Longpress?
		TaskDisable,4
		gpio,12,0
	elseif [Regler#settings.enabled] = 0 and %eventvalue1% > 9 // Regler OFF and Longpress?
		taskvalueset,1,1,0
		TaskEnable,4
	endif
endon
DLzG
Micha

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

Re: re-entry and massive problems

#75 Post by TD-er » 23 Dec 2022, 15:38

Great you got it running (and apparently also using the latest build, which is a good test for the upcoming "Christmas Build" :) )

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

Re: re-entry and massive problems

#76 Post by M*I*B » 23 Dec 2022, 16:32

... I'm glad that my amateur handicrafts have something good for you too :D :geek:

I just ordered some other connectors. The 3.5mm stereo (3pin) are also available als 4pin version (former used as Headset/Microphon/PTT) . I have also take a look for the 2.5mm version but this one are'n available at the moment, if you don't like to pay extremely much for it :roll:
So with the new connectors I'm able to flash the S20 without the need to open it and I also can connect any peripherals on it with two ports available; two birds with one stone :lol:
DLzG
Micha

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

Re: re-entry and massive problems

#77 Post by chromo23 » 23 Dec 2022, 16:53

TD-er wrote: 23 Dec 2022, 15:38 upcoming "Christmas Build" )
:o ...i have to hurry with my PR for #4421

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

Re: re-entry and massive problems

#78 Post by M*I*B » 23 Dec 2022, 17:03

... always the same shit with Christmas! Always comes all of a sudden and without notice... :lol: :lol: :lol:
DLzG
Micha

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

Re: re-entry and massive problems

#79 Post by TD-er » 23 Dec 2022, 22:17

M*I*B wrote: 23 Dec 2022, 16:32 [...]
So with the new connectors I'm able to flash the S20 without the need to open it and I also can connect any peripherals on it with two ports available; two birds with one stone :lol:
<panic mode>
But what about the isolation from mains?
</panic mode>

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

Re: re-entry and massive problems

#80 Post by M*I*B » 23 Dec 2022, 22:47

... ... that's just a lame excuse because you want another beer :lol: :lol: :lol:

Remember and DON'T FORGET to solder a wire between the E-contact and GND. Then all is save in any way.
You can just use a plain wire or better a 47R (10R to 100R is also ok) parallel with 100n between the Earth and GND.

See also viewtopic.php?p=61815#p61815
DLzG
Micha

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

Re: re-entry and massive problems

#81 Post by TD-er » 23 Dec 2022, 22:59

Ahhh cheers ! :)

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

Re: re-entry and massive problems

#82 Post by M*I*B » 25 Dec 2022, 16:41

... merry Christmas again...

Ok, I think I found a bug or more like an omission in the "Regulator - Level Control".

If I change the value at "Set Level" or "Hysteresis", neither is sent to the selected controller, even if I change the value from external (FHEM).
As a result, I can't see the set value in FHEM and I can't reach it via UserReading either...
That's pretty bad, because I can't react to a change from elsewhere, let alone react to a value change from FHEM...
DLzG
Micha

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

Re: re-entry and massive problems

#83 Post by Ath » 25 Dec 2022, 16:51

M*I*B wrote: 25 Dec 2022, 16:41 ... merry Christmas again...
Thank you, and Merry Christmas to you too :)
M*I*B wrote: 25 Dec 2022, 16:41 Ok, I think I found a bug or more like an omission in the "Regulator - Level Control".

If I change the value at "Set Level" or "Hysteresis", neither is sent to the selected controller, even if I change the value from external (FHEM).
As a result, I can't see the set value in FHEM and I can't reach it via UserReading either...
That's pretty bad, because I can't react to a change from elsewhere, let alone react to a value change from FHEM...
Have you tried the "taskrun,regler" command?
/Ton (PayPal.me)

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

Re: re-entry and massive problems

#84 Post by M*I*B » 25 Dec 2022, 16:53

Ath wrote: 25 Dec 2022, 16:51 Have you tried the "taskrun,regler" command?
:?: Nope... Not really know what you mean :oops:
DLzG
Micha

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

Re: re-entry and massive problems

#85 Post by Ath » 25 Dec 2022, 16:59

Doesn't work, indeed, had to build a bin including that plugin to test for myself, but it won't work from taskrun either.

I'll investigate...
/Ton (PayPal.me)

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

Re: re-entry and massive problems

#86 Post by M*I*B » 25 Dec 2022, 17:29

Clipboarder.2022.12.25-002.png
Clipboarder.2022.12.25-002.png (78.71 KiB) Viewed 2955 times
DLzG
Micha

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

Re: re-entry and massive problems

#87 Post by TD-er » 25 Dec 2022, 23:27

uh-uh... You know what we agreed... No new bugs until the 27th... ;)

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

Re: re-entry and massive problems

#88 Post by M*I*B » 26 Dec 2022, 09:38

Clipboarder.2022.12.26-002.png
Clipboarder.2022.12.26-002.png (154.99 KiB) Viewed 2887 times
DLzG
Micha

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

Re: re-entry and massive problems

#89 Post by M*I*B » 26 Dec 2022, 10:59

öhhh ...

Can it be that the {task}#settings.enabled thingy isn't implemented into the XMas release mega-20221224 ?
DLzG
Micha

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

Re: re-entry and massive problems

#90 Post by Ath » 26 Dec 2022, 11:03

M*I*B wrote: 26 Dec 2022, 10:59 öhhh ...

Can it be that the {task}#settings.enabled thingy isn't implemented into the XMas release mega-20221224 ?
It is: https://github.com/letscontrolit/ESPEasy/pull/4421
/Ton (PayPal.me)

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

Re: re-entry and massive problems

#91 Post by M*I*B » 26 Dec 2022, 11:06

hmmm ... Ok ... My rule don't work anymore ... crasy ...

Funny thing... Flashed again with "20221224_normal_ESP8266_1M_VCC" and now it works :? :shock:

EDIT:
Now it runs like a charm but creates more load as expected. The way I use the timer only for the situation the "Regulator - Level Control" is disabled and let the LED flashing as a warning is not really ideal :o

I have look into the available devices and also into the "https://espeasy.readthedocs.io/en/lates ... Rules.html" but can't find a generic thingy to simple let a LED (GPIO) flash.

I have try to work around but that don't work well due if I set GPIO 12 to 0 and disable Task2 (Relay) the relays goes ON and not OFF as expected...
Without disable Task2 (only Regulator is DIS) I have the problem that a short Keypress switch on the relay. I'm sure I have overseen some ...
I have thing about some more over all that... :?

Code: Select all

// Initialize Tick-Tack with 200ms on boot up
on System#Boot do
	LoopTimerSet_ms,1,200
	timerPause,1
endon

// Let the LED blink if Task "Regler" disabled
on Rules#Timer=1 do
	if [Regler#settings.enabled] = 0 and [Dummy#LED] = 1
		gpio,13,0
	elseif [Regler#settings.enabled] = 0 and [Dummy#LED] = 0
		gpio,13,1
	endif
endon

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

// Ask Keypress and LC
on KeyCheck do
	if [Regler#settings.enabled] = 1 and %eventvalue1% > 9 // Regler ON and Longpress?
		gpio,12,0
		TaskDisable,2
		TaskDisable,4
		timerResume,1
	elseif [Regler#settings.enabled] = 0 and %eventvalue1% > 9 // Regler OFF and Longpress?
		taskvalueset,1,1,0
		TaskEnable,4
		TaskEnable,2
		timerPause,1
	elseif [Regler#settings.enabled] = 1 and [Regler#SET] = 1 or [Taste#BTN] = 1
		gpio,12,1
		timerPause,1
	elseif [Regler#settings.enabled] = 1 and [Regler#SET] = 0 and [Taste#BTN] = 0
		gpio,12,0
	endif
endon


DLzG
Micha

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

Re: re-entry and massive problems

#92 Post by TD-er » 26 Dec 2022, 12:41

You don't seem to set the dummy state in your "LED flash" call.
But it can way easier (since only a few weeks, new option)

See: https://espeasy.readthedocs.io/en/lates ... ernal-gpio
Example: longpulse,2,1,1,1,-1 Continuous blinking of the onboard LED at 0.5 Hz. (50% duty cycle)
When you set the task enabled/disabled, you can set/clear the longpulse.

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

Re: re-entry and massive problems

#93 Post by M*I*B » 26 Dec 2022, 12:52

GREAT - GREAT - GREAT ...
I have overseen the "continous" -1 thingy... Many ty for the Hint!

So I set i.e. ...

Code: Select all

longpulse_ms,13,1,200,200,-1
... for flashing and ...

Code: Select all

longpulse_ms,13,0
... to switch that off?
DLzG
Micha

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

Re: re-entry and massive problems

#94 Post by TD-er » 26 Dec 2022, 12:54

Seems right. :)
Depends on whether you need to invert the LED, of course :)

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

Re: re-entry and massive problems

#95 Post by M*I*B » 26 Dec 2022, 13:02

Depends on whether you need to invert the LED, of course
Hmmm... The LED is the same who show the WLAN- status. The other one is unusable due they are hardwired in parallel to the Relay and not independent usable...
So I think I have some misunderstanding about that...

Code: Select all

LongPulse_mS,<GPIO>,<state>,<duration high>,<duration low>,<nr of repeats>
GPIO = 13 ... Same as the WLAN one
Bild_2022-12-26_125935368.png
Bild_2022-12-26_125935368.png (4.63 KiB) Viewed 2860 times
<state> means what? The HIGH (1) resp. LOW (0) condition of the the 1st Pulse? Or is that to switch on or off the "flasher"?
... rest of the line is clear ...
The Q is how I completely disable the "flasher" so the WLAN can take back the control over the LED
DLzG
Micha

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

Re: re-entry and massive problems

#96 Post by TD-er » 26 Dec 2022, 13:10

When you send a longpulse (or longpulse_ms for msec durations) with the last parameter set to 0 or just omitted, you will clear the repeat state.
The first "duration" parameter is not optional.
But you have to keep in mind that after this "duration" the set state will be inverted again.

Thus if you set the "state" to 1 for the longpulse, it will set it to "1" for the given duration and then back to "0".
But you intend to have it turned off afterwards, so you need to experiment a bit with the given state.
If the LED is "inverted" (thus "0" is on), then you might need to set the last longpulse to state "0" as it will then switch back to "1" after the given period.

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

Re: re-entry and massive problems

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

:? :shock: 8-) :lol:
Ok, get it... Open my knot in brain slooooowwwwlllyyy
DLzG
Micha

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

Re: re-entry and massive problems

#98 Post by TD-er » 26 Dec 2022, 13:16

Well I have to admit, it isn't the most intuitive way to clear the longpulse timer.

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

Re: re-entry and massive problems

#99 Post by M*I*B » 26 Dec 2022, 13:22

Yepp... takes a while to dive into ...

SO... I have change the Rule like this:

Code: Select all

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

// Ask Keypress and LC
on KeyCheck do
	if [Regler#settings.enabled] = 1 and [Regler#SET] = 1 or [Regler#settings.enabled] = 1 and [Taste#BTN] = 1
		gpio,12,1
	elseif [Regler#settings.enabled] = 1 and [Regler#SET] = 0 and [Taste#BTN] = 0
		gpio,12,0
	elseif [Regler#settings.enabled] = 1 and %eventvalue1% > 9 // Regler ON and Longpress?
		gpio,12,0
		TaskDisable,4
		longpulse_ms,13,1,200,200,-1
	elseif [Regler#settings.enabled] = 0 and %eventvalue1% > 9 // Regler OFF and Longpress?
		taskvalueset,1,1,0
		TaskEnable,4
		longpulse_ms,13,0
	endif
endon
Much shorter then before due the whole Timer-stuff are gone.
But unfortunately it doesn't work this way. I think the 1st IF never match; can I do it this way witch IF a AND b OR a AND c ??? I think I'm right if I say that NOT comes before AND comes before OR ... Right?
DLzG
Micha

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

Re: re-entry and massive problems

#100 Post by TD-er » 26 Dec 2022, 13:24

This one needs an extra parameter, the duration:

Code: Select all

		longpulse_ms,13,0

Post Reply

Who is online

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