ESPEasy Status LED is not working on ESP32 with buildin LED

Created on 13 Mar 2020  路  7Comments  路  Source: letscontrolit/ESPEasy

Expected behavior

i have installed the latest Version ESPEasy mega-20200305 on an ESP32.
Tried to use buildin LED (GPIO2) as WIFI Traffic indicator (like it is working on ESP8266 devices)

Actual behavior

The LED stays always drak.

Steps to reproduce

  1. Use buildin LED (GPIO2) as a normal device and switsch it on and off-> working. So GPIO2 is the right one.
  2. Now assing it as WIFI Traffic indicator. Nothing happend.
  3. Reboot the device. Nothing happend.
  4. Sorry i have not tried an external LED because i don't have enyone.

System configuration


Hardware:
ESP32-WROOM-32 (ESP32S) (Hardware like nodemcu)
ESP32 NodeMCU IoT Development Board mit Espressif ESP-WROOM-32
grafik



ESP Easy version:
mega-20200305


ESP Easy settings/screenshots:
grafik
grafik

ESP32 Fixed Bug

Most helpful comment

@thomastech
@TD-er
i can confirm the fix work's. Now my led is blinking like in esp8266 devices

All 7 comments

The notification LED is using the PWM feature, so maybe that's the problem with ESP32?

I've tested with mqtt command PWM,2,0,2000 or PWM,2,1000,2000
The builin LED changes the brightness. So PWM is working fine.
I fear there is somthing wrong pin assignment to WIFI or the WIFI module don't deliver data for dimming.

I've tested also external LED with mqtt command PWM,2,23,2000 or PWM,23,1000,2000
The external LED changes the brightness. So PWM is working fine.
But GPIO23 as WIFI Traffic indicator, no chance.

In the statusLED() function (see Misc.ino) the Status LED's analogWrite() is only available to the ESP8266. See the code here: https://github.com/letscontrolit/ESPEasy/blob/mega/src/Misc.ino#L757

Maybe something like this (untested) is the solution?

    #if defined(ESP8266)
      analogWrite(Settings.Pin_status_led, pwm);
    #endif // if defined(ESP8266)
    #if defined(ESP32)
       analogWriteESP32(Settings.Pin_status_led, pwm);
    #endif // if defined(ESP32)
  • Thomas

@thomastech That looks like a valid fix indeed.

@thomastech
@TD-er
i can confirm the fix work's. Now my led is blinking like in esp8266 devices

Fixed it along with another PR I am about to merge.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MarceloProjetos picture MarceloProjetos  路  4Comments

jroux1 picture jroux1  路  6Comments

ghtester picture ghtester  路  3Comments

ronnythomas picture ronnythomas  路  3Comments

Barracuda09 picture Barracuda09  路  5Comments