Wemos ESP8266 D1 mini RX as GPIO issue when using external power

I'm using a Wemos ESP8266 D1 mini to control some LEDs using the Neopixelbus library. The library uses the RX pin to send data to the LEDs. When I connect the ESP8266 to the computer via USB I have no issues, but connecting it to an external powersupply stops the PIN from working. If I boot connected to the USB and then connect the powersupply, the LEDs get brighter. If I then change the color of the LEDs nothing happens, but if I remove the external power it immediately changes. What could the problem be?

As usual, without a schematic, we are simply guessing. Your last statement may be a clue, but without a schematic (NOT a Fritzing "Legos" picture), I would only be guessing.

How are you powering the ESP? (Schematic).
Why can't you simply change the data pin assignment?


I tried to create a schematic. Hopefully it can give some idea of how I have wired things.

SteveMann:
Why can't you simply change the data pin assignment?

The NeoPixelBus library automatically chooses the GPIO3/RX pin, so I'm unable to change it.

d-march:
The NeoPixelBus library automatically chooses the GPIO3/RX pin, so I'm unable to change it.

That is most improbable indeed.

Please specify where you obtained the library?

You presumably need to choose another GPIO pin - no shortage on the WeMOS D1 Mini.

The problem is that the "RX" pin is connected (via a 470 Ohm resistor but apparently only in some versions!) to the TXD pin of the CH340 USB interface, which restricts its ability to drive the LED strip.


Expand

I obtained the library from the Arduino IDE. I'm using the NeoEsp8266Dma800KbpsMethod explained here: ESP8266 NeoMethods · Makuna/NeoPixelBus Wiki · GitHub

d-march:
I obtained the library from the Arduino IDE. I’m using the NeoEsp8266Dma800KbpsMethod explained here: https://github.com/Makuna/NeoPixelBus/wiki/ESP8266-NeoMethods

I would not use a library this poorly written:
“The ESP8266 requires hardware support to be able to reliably send the data stream. Due to this and the restrictions on which pins are used by each hardware peripheral, only I/O pins GPIO1, GPIO2, and GPIO3 can be used. The Pin argument is ignored and can be omitted.”

Exactly what are you trying to do? Most of us use the FastLED.h library, and I am confident that there is nothing in the Makuna library that can’t be done using the fastLED library.

It also appears that you are using ESPHome. But, I am completely unfamiliar with ESPHome, preferring HomeAssistant.

Paul__B:
The problem is that the "RX" pin is connected (via a 470 Ohm resistor but apparently only in some versions!) to the TXD pin of the CH340 USB interface, which restricts its ability to drive the LED strip.

Interesting. I needed another interrupt pin on a Wemos project. I felt sure that I'd used the Rx pin before for this but it wouldn't work! Had to use the Tx pin & lost my serial debugging :frowning:

SteveMann:
I would not use a library this poorly written:
"The ESP8266 requires hardware support to be able to reliably send the data stream. Due to this and the restrictions on which pins are used by each hardware peripheral, only I/O pins GPIO1, GPIO2, and GPIO3 can be used. The Pin argument is ignored and can be omitted."

Exactly what are you trying to do? Most of us use the FastLED.h library, and I am confident that there is nothing in the Makuna library that can't be done using the fastLED library.

It also appears that you are using ESPHome. But, I am completely unfamiliar with ESPHome, preferring HomeAssistant.

I would love to use the FastLED library, but I'm trying to control RGBW strips and as far as I know, there is no support for it. However, I saw something about a fork having support for RGBW so maybe I will look into that.

d-march:
I would love to use the FastLED library, but I’m trying to control RGBW strips and as far as I know, there is no support for it. However, I saw something about a fork having support for RGBW so maybe I will look into that.

It looks like the fork also requires the RX/GPIO3 pin on an ESP8266. FastLED/README.md at dma · EmteZogaf/FastLED · GitHub

Strange

I use

#include <Adafruit_NeoPixel.h>

And

// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
Adafruit_NeoPixel leds = Adafruit_NeoPixel( LED_COUNT, 26, NEO_GRB + NEO_KHZ800 );

Where I assign the number of pixels and the GPIO pin to be used.

I used to use the Adafruit Neopixel library, but I got constant timing issues when sending data from a website on the ESP8266, so I switched to the NeoPixelBus library which works except when I connect it to power...

d-march:
,,, which works except when I connect it to power...

Note, you cannot power the ESP from the USB and the 5V pin at the same time.

SteveMann:
Note, you cannot power the ESP from the USB and the 5V pin at the same time.

It doesn't work with only external power either. Is there some way around this? Or should I just use a different esp8266 board?

d-march:
It doesn't work with only external power either. Is there some way around this? Or should I just use a different esp8266 board?

What do you mean "either"? In your first statement, it works when powered through the USB.

The problem of using a different ESP board is in the library being hard-coded for specific GPIO pins. It doesn't matter which ESP8266 board you use, Rx is GPIO3.

I am more certain that you have a power wiring problem because if you power the board from the USB OR from an external 5V power supply (the emphasis on OR), should make absolutely no difference in the running of the ESP.

I mean

SteveMann:
What do you mean "either"? In your first statement, it works when powered through the USB.

I meant only through the power supply. But changing the power supply solved the issue. Using a power supply with varying voltage it seems that around 5.2V the LEDs stop working (the original power supply was 5.4V). Why is that?

Anyway, thanks for the help!

d-march:
I meanI meant only through the power supply. But changing the power supply solved the issue. Using a power supply with varying voltage it seems that around 5.2V the LEDs stop working (the original power supply was 5.4V). Why is that?

Anyway, thanks for the help!

I would suspect your wiring because I would expect the LED to work down to 5V

SteveMann:
I would suspect your wiring because I would expect the LED to work down to 5V

I should have phrased that differently. The LEDs doesn't stop working, but the ESP8266 seems to stop sending any data.