-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Wrong #define LED_BUILTIN for NodeMCU board #4715
Comments
This issue is previously covered but I guess they haven't decided to do anything about it. 😢 |
The official Nodemcu has the integrated led connected to the GPIO16 pin (with inverse logic by the way). The led in GPIO2 to which you refer, is integrated into the ESP12e and this is integrated into Nodemcu. But be careful because not all ESP12e cards have this led. Therefore, LED_BUITIN in GPIO16 is correct. |
Thanks to lrmoreno007 esp8266#4715
@lrmoreno007 is correct, the led on an esp12e is tied to io2/txd1 and is used for com ind, meaning it will blink if you use serial2. io16 is the correct definition for nodemcu. |
@devyte since defines seem to be correct, shouldn't this be closed? |
I'm confused. My understanding is that for all boards based on the esp12 reference hw the builtin led is gpio2. Yes, it blinks when using serial2, but it also blinks e.g. with a dht22 shield on a wemos d1 r2. |
Hmm it was changed at some point? |
blink works fine on nodemcu (amica), and a wemos v3 pro Either way it looks fine to me ( unless we add LED_BUILTIN_2 at some point ) IMHO boards with an aux led should be mapped to LED_BUILTIN and ones without should be mapped to esp led. Sounds reasonable to me |
@TridentTD @NobleAscent Could you elaborate ? |
Fyi same goes for adafruit huzzah it has 2 leds builtin defined for aux led io 0 |
I have only cheap "replicas" of nodemcu boards but even the cheapest without ESP-12 module (esp directly on pcb w/o metal can) has both leds... |
Are there any of these boards that don't have a led on gpio2? |
Every dev board I know of uses 12e or 12f so no, but there is a lot of boards. I can start looking |
@tablatronix If all esp12-based boards have a led on gpio2, then I'd think that led should be the builtin one. That makes it consistent and assures that the blink example will always work, putting this recurring topic to rest. If there is any variant that does not have a led on gpio2, then we can discuss further what to do. @d-a-v any thoughts here? |
@devyte |
LED_BUILTIN does not work on my NodeMCU boards |
https://github.com/nodemcu/nodemcu-devkit |
LED_BUILTIN is defined as 16 and does not activate an LED, neither HIGH nor LOW This is what people keep reporting. GPIO16 does NOT activate an on board LED on Multiple NodeMCU boards that I bought recently. I don't know how to tell what version they are but they use the CH340 drivers and have "HW-625" silkscreened near the antenna. The chip is marked ESP8266MOD. |
Can you propose a pull request to change led definition to 2 ? |
I am not sure how to do that, nor do I feel confident about submitting a change. I was confirming what has been reported and seemingly dismissed. |
The official nodemcu boards have a led on gpio 16, maybe you are using some lolin verison or something. Nodemcu official boards use cp2102, I am not sure if these clone boards have a board definition or not. |
I can confirm that LED_BUILTIN for ESP-12E nodeMCU is GPIO 16 == D0:
output:
|
I have to disagree: |
There are boards with a led on 2, boards with a led on 16, and boards with both, all called nodemcu. I'm defining the builtin as 2 to match other boards based on the esp12 that have the led. If your board has a led on 16, please use the aux. |
That should work , although there is only one real official nodemcu. |
An observation of what I think I am reading here and what I have seen, there appears to be an ESP-12E development board containing an ESP-12E module. The ESP-12E module (and its various clones) sometimes have an LED on GPIO-2. The LED would appear to be optional at least on some of the cloned modules. The schematic reference above of a development board has an LED on GPIO-16. Last, and frustratingly the schematic in the datasheet for the ESP-12E module fails to show there is an LED on the module; however, a reversed engineered schematic shows it on GPIO-2. |
There are two possibilities:
|
IMO there already far too many entries in the boards menu for either esp8266 type, so I would be fine with option b) |
@dyslexia there is a filtering capability now to only show boards you're interested in. |
@devyte |
@dsyleixa, devyte is referring to this How to create an abridged boards.txt file it is in the FAQ. Also for the non-ESP8266 boards.txt files, that are too long, you can manually edit those down to the boards you use. Note, you cannot delete all of them. There must be at least one board in a boards.txt file. Don't forget to make a backup copy. |
@mhightower83 |
@dsyleixa ?? only the 1st two commands are needed for what you want. You can do copy-paste and edit the favorites file. The rest are additional things that can be done. Or are you referring to the lake of a GUI interface? |
well, this is not the topic here, but I doubt that me or other common Arduino users would ever do that. |
Basic Infos
ESP8266 Arduino Core 2.4.1 has a mistake (?) #define LED_BUILTIN
for NodeMCU board to pin gpio16 , then when using BLINK example ,
it can't blink the LED_BUILTIN
https://github.com/esp8266/Arduino/blob/master/variants/nodemcu/pins_arduino.h#L35
It should be defined to pin gpio 2 ?
Platform
Settings in IDE
The text was updated successfully, but these errors were encountered: