re-entry and massive problems
Moderators: grovkillen, Stuntteam, TD-er
Re: re-entry and massive problems
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.
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.
Re: re-entry and massive problems
Hey, calm down, take a break and a beer
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 ...
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?
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 ...
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 (48.21 KiB) Viewed 3264 times
DLzG
Micha
Micha
Re: re-entry and massive problems
4 Mbit == 512 kByte = 0.5 MB so for the 1MB units you should select the 8 Mbit option
You are not responding to the taste#All event, but to the taste#BTN event, so it is to be expected nothing happens
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
/Ton (PayPal.me)
Re: re-entry and massive problems
Ahhh F*** BYTE and BIT are different, aren't they?
Need some new glasses I think
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? )
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)
Need some new glasses I think
Nope... I have try both but both don't work ...You are not responding to the taste#All event, but to the taste#BTN event, so it is to be expected nothing happens
Yep, you are absolutely right. I have tick that by mistake and haven't noticed that. Takes a while to find that...Turn off that Single event option, not much use for it when having a single value,
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? )
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
Micha
Re: re-entry and massive problems
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)
Re: re-entry and massive problems
Yepp, that's right.but you seem to be experienced with electronics
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...)by replacing the capacitors in the power supply by better quality components,
DLzG
Micha
Micha
Re: re-entry and massive problems
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.
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.
Re: re-entry and massive problems
... calm down my friend You didn't take my advice to relax and have a beer, did you?
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...
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
Micha
Re: re-entry and massive problems
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.
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.
Re: re-entry and massive problems
... actually three, but my first degrees as a blacksmith has nothing to do with electronics; if at all with mechanical engineeringAt least you have (at least) 2 degrees more than I have.
DLzG
Micha
Micha
Re: re-entry and massive problems
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
Oh and being a blacksmith has tought you all about "percussive maintainance", which has its applications in both mechanics and electronics
Re: re-entry and massive problems
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)
- Attachments
-
- Bild_2022-12-23_083809240.png (308.44 KiB) Viewed 3160 times
DLzG
Micha
Micha
Re: re-entry and massive problems
Ok, after breakfast I try to make it more comfortable... and failed again
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?
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
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
Micha
Re: re-entry and massive problems
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)
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.
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]"
If it doesn't get replaced, then you know the .enabled feature is not yet present in your build.
Re: re-entry and massive problems
I use the last I think: ESP_Easy_mega_20221213_normal_ESP8266_1M_VCC
Ok, then I haven't it yet... shitt...
Ok, then I haven't it yet... shitt...
DLzG
Micha
Micha
Re: re-entry and massive problems
Was added here:
https://github.com/letscontrolit/ESPEasy/pull/4421
So should be included in this test build: https://github.com/letscontrolit/ESPEas ... 3762162635
https://github.com/letscontrolit/ESPEasy/pull/4421
So should be included in this test build: https://github.com/letscontrolit/ESPEas ... 3762162635
Re: re-entry and massive problems
... 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 ...
I have no idea what I have to do with that stuff your provided link show me ...
DLzG
Micha
Micha
Re: re-entry and massive problems
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 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.
Re: re-entry and massive problems
Right there ? 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
Micha
Re: re-entry and massive problems
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.
Re: re-entry and massive problems
I also have a number of Sonoff units and the "old ones" seem to behave better than the newer ones.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.
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.
Re: re-entry and massive problems
Ok ... I just wanted to let you know of my success ...
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!
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
Micha
Re: re-entry and massive problems
Great you got it running (and apparently also using the latest build, which is a good test for the upcoming "Christmas Build" )
Re: re-entry and massive problems
... I'm glad that my amateur handicrafts have something good for you too
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
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
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
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
DLzG
Micha
Micha
Re: re-entry and massive problems
...i have to hurry with my PR for #4421
Re: re-entry and massive problems
... always the same shit with Christmas! Always comes all of a sudden and without notice...
DLzG
Micha
Micha
Re: re-entry and massive problems
<panic mode>
But what about the isolation from mains?
</panic mode>
Re: re-entry and massive problems
... ... that's just a lame excuse because you want another beer
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
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
Micha
Re: re-entry and massive problems
... 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...
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
Micha
Re: re-entry and massive problems
Thank you, and Merry Christmas to you too
Have you tried the "taskrun,regler" command?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...
/Ton (PayPal.me)
Re: re-entry and massive problems
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...
I'll investigate...
/Ton (PayPal.me)
Re: re-entry and massive problems
uh-uh... You know what we agreed... No new bugs until the 27th...
Re: re-entry and massive problems
öhhh ...
Can it be that the {task}#settings.enabled thingy isn't implemented into the XMas release mega-20221224 ?
Can it be that the {task}#settings.enabled thingy isn't implemented into the XMas release mega-20221224 ?
DLzG
Micha
Micha
Re: re-entry and massive problems
hmmm ... Ok ... My rule don't work anymore ... crasy ...
Funny thing... Flashed again with "20221224_normal_ESP8266_1M_VCC" and now it works
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
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...
Funny thing... Flashed again with "20221224_normal_ESP8266_1M_VCC" and now it works
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
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
Micha
Re: re-entry and massive problems
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
But it can way easier (since only a few weeks, new option)
See: https://espeasy.readthedocs.io/en/lates ... ernal-gpio
When you set the task enabled/disabled, you can set/clear the longpulse.Example: longpulse,2,1,1,1,-1 Continuous blinking of the onboard LED at 0.5 Hz. (50% duty cycle)
Re: re-entry and massive problems
GREAT - GREAT - GREAT ...
I have overseen the "continous" -1 thingy... Many ty for the Hint!
So I set i.e. ...
... for flashing and ...
... to switch that off?
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
Code: Select all
longpulse_ms,13,0
DLzG
Micha
Micha
Re: re-entry and massive problems
Seems right.
Depends on whether you need to invert the LED, of course
Depends on whether you need to invert the LED, of course
Re: re-entry and massive problems
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...Depends on whether you need to invert the LED, of course
So I think I have some misunderstanding about that...
Code: Select all
LongPulse_mS,<GPIO>,<state>,<duration high>,<duration low>,<nr of repeats>
... 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
Micha
Re: re-entry and massive problems
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.
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.
Re: re-entry and massive problems
Well I have to admit, it isn't the most intuitive way to clear the longpulse timer.
Re: re-entry and massive problems
Yepp... takes a while to dive into ...
SO... I have change the Rule like this:
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?
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
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
Micha
Re: re-entry and massive problems
This one needs an extra parameter, the duration:
Code: Select all
longpulse_ms,13,0
Who is online
Users browsing this forum: Bing [Bot] and 35 guests