-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32 LittleFS build PWM GPIO : port#2 is out of range #4962
Comments
Hmm I will have a look at it, looks like a bug |
Hmm looks like this recent change may have broken the PWM functionality: |
When this build has finished, you can test if it is also fixed on your node: |
Incredible fast you are...... |
Hmm I did see a potential bug in the Arduino code for reserving PWM channels. |
OK, just in case you need it, this ist the rule what stalls my node: on System#Boot do LoopTimerSet_ms,1,1500 on Rules#Timer=1 do |
Not 100% sure this will be done correctly, so maybe best to change this first rules line to this:
Anyway, the rest is I think asking for trouble as you try to constantly fade were it may try to update a running fade as the rules are triggered at the same offset (thus no drift) while the execution of the rules may sometimes be slightly delayed. So in this specific use case, you might be better of not using the loop timer, but rather restart the timer at the end of the rules block:
And maybe a good idea to not let the fade during be exactly the same as the timer interval. By the way, on older builds this was completely blocking as the fade command only ended when it was done. |
So may be I was just lucky it worked before, was only a fade test... |
Since ESP-IDF5 there is a fade command which is not blocking and it allows to add a callback function. So a fade loop like this could be done as a background running call, which we could trigger using a command like fadeloop in ESPEasy. Would that be a desired command? |
I use those "breathing" fades sometimes to indicate "normal" operation. So I don't know how much work that is for just am gimmick in my case... |
Just to be sure, what is 'stall' ? |
From what I can observe it stops completely. |
changed the rules, after the 40s timer 2 (to have the chance to get access and stop it from PWM) the node hangs completely
|
OK, will check your rules later today as I'm not near a computer right now. |
I ran it on an ESP32-C2 and it was running fine for a while. |
Found the cause... and made an issue for it: espressif/arduino-esp32#9212 I also have got a work-around and will make a commit for it. |
Thank you! |
There is still another potential bug in the Arduino code: espressif/arduino-esp32#9213 Here is the test build (still running) https://github.com/letscontrolit/ESPEasy/actions/runs/7790177773 |
Hmm it looks like this problem will also cause issues for other use cases, so I will append those to the same pull request. For example
|
Good morning Gijs! |
[PWM] Fix ESP32 LittleFS build PWM GPIO : port#2 is out of range (#4962)
In preparation to move to the LittleFS builds on ESP32 just flashed an ESP32 with with the ESP_Easy_mega_20240202_normal_ESP32_4M316k_LittleFS.factory.bin build.
Then I restored the rules wich only PWM fade the blue GPIO2 led.
On the non LittleFS build this worked fine, now I got the Logmessage:
521118: ACT : PWM,2,40,1500
521129: GPIO : port#2 is out of range
522609: ACT : PWM,2,300,1500
522619: GPIO : port#2 is out of range
524118: ACT : PWM,2,40,1500
524128: GPIO : port#2 is out of range
And the led stays dark.
When I use GPIO,2,0 or GPIO,2,1 instead of PWM it works and the led blinks.....
Is this a bug or what did change regarding PWM?
The text was updated successfully, but these errors were encountered: