external power supply via tp04056 leads to command unknown entries in the log

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
espgraf
Normal user
Posts: 22
Joined: 11 Jun 2024, 20:13
Location: Germany

external power supply via tp04056 leads to command unknown entries in the log

#1 Post by espgraf » 06 Jul 2024, 18:58

for my current projet i need an ESP32-board with a power supply from a battery.
I found a good description here https://randomnerdtutorials.com/power-e ... onitoring/
and have setup the solution like in the picture
Screenshot 2024-07-06 181755.png
Screenshot 2024-07-06 181755.png (100.71 KiB) Viewed 25380 times
My problem now is, that i get a lot of "Command unknown:" entries with different text behind in the log when i provide the power via USB or the Batterie on the TP4056 board.
Screenshot 2024-07-06 185107.png
Screenshot 2024-07-06 185107.png (110.68 KiB) Viewed 25380 times
This is not the case when i provide the power via USB on the ESP32-WROOM-32U - board without the TP04056.
I am running ESP_Easy_mega_20240414_collection_B_ESP32_4M316k
I did a lot of research in different forum but was not able to figure out what might be the problem.

what might be the source for the "Command unknown:" as besides the 3v3 and GND nothing is connectet to the ESP32-WROOM-32U board?

User avatar
Ath
Normal user
Posts: 4330
Joined: 10 Jun 2018, 12:06
Location: NL

Re: external power supply via tp04056 leads to command unknown entries in the log

#2 Post by Ath » 06 Jul 2024, 20:37

This seems like the serial chip doesn't like 3.3V only, and it echoes back the serial output, distorted, to the serial input.
Probably the best solution is to disable the serial log on the Tools/Advanced page, as you won't be using that, AFAICS.
/Ton (PayPal.me)

espgraf
Normal user
Posts: 22
Joined: 11 Jun 2024, 20:13
Location: Germany

Re: external power supply via tp04056 leads to command unknown entries in the log

#3 Post by espgraf » 06 Jul 2024, 21:06

to what serial chip you are referring to?
Just to disable the logging might not be a good solution as the load is always above 50% without anything running on the sysetm.

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: external power supply via tp04056 leads to command unknown entries in the log

#4 Post by TD-er » 06 Jul 2024, 21:13

When you power the ESP board via 5V, the USB to serial chip will also be powered.
If you power the board via only 3V3, this chip doesn't seem to be powered and thus may be in some undefined state.

N.B. this may differ from board to board and also from chip to chip as the CP2101 will act completely different compared to the CH340 and some boards have a protection diode present while others have not. (to protect the PC from feeding power back into the PC)

Turning off the ESPEasy console or moving it to some other GPIO pins (tools->Advanced page) will at least prevent those command unknown errors.
But these issues with the USB to serial chip which is in some undefined state may cause other issues like triggering the RST pin at random and/or the GPIO-0 pin causing the ESP to reboot and enter flash mode for example.

User avatar
ThomasB
Normal user
Posts: 1362
Joined: 17 Jun 2018, 20:41
Location: USA

Re: external power supply via tp04056 leads to command unknown entries in the log

#5 Post by ThomasB » 07 Jul 2024, 21:14

Perhaps try this: The MCU board already has a 3.3V regulator on it. So remove the external 3.3V regulator and apply battery power to "Vin" pin. In many cases this is sufficient to power the onboard serial chip. And if you need 3.3V for external sensors, it will be available on the board's 3.3V pin.

- Thomas

espgraf
Normal user
Posts: 22
Joined: 11 Jun 2024, 20:13
Location: Germany

Re: external power supply via tp04056 leads to command unknown entries in the log

#6 Post by espgraf » 07 Jul 2024, 22:51

thanks for all the tipps.
I did some more tests.
Disabling the console: Messages in the log are gone, but the blue led on the tp4056 board is still flickering. problem still exists, but without the messages.

Power supply direct from tp4056 board to vin (5v) on the MCU: does not boot anymore. Maybe the voltage from the tm4056 is to low (4,15 V).

I also testet the original setup with an Freenove ESP32 WROVER board. Here set whole setup is working like expectet. No "Command unknown" entries in the log an the blue LED on the TP40456 board is also only flickering form time to time (> 30 sec).

the Board what it use is this one:
iHaospace ESP32-DevKitC Core Board ESP32-WROOM-32U Development Board (WROOM-32U)
The serial chip is a CP2102, the voltage regulator is a AMS1117 33 DN911.
I have choosen this board as i need a connetor for an external WIFI antenna.

One option what i have in mind is to use instead of the LDO regulator (MCP1700-3302E) a step-up to 5V and connect these 5V to the 5V pin of the MCU. 2 example i have found:
https://eckstein-shop.de/Pololu5VStep-U ... torS9V11F5 or
https://www.az-delivery.de/products/mt3 ... up-modul-1

Another option could be to use an USB DC-DC 0,9--5V auf 5V Step-Up Spannungsregler and connect it via usb-cable to the usb-input of the MCU.
https://eckstein-shop.de/USBDC-DC02C9-5 ... 2b72LPvQ44

any comments and tipps are welcome.

User avatar
ThomasB
Normal user
Posts: 1362
Joined: 17 Jun 2018, 20:41
Location: USA

Re: external power supply via tp04056 leads to command unknown entries in the log

#7 Post by ThomasB » 08 Jul 2024, 02:43

Disabling the console: Messages in the log are gone, but the blue led on the tp4056 board is still flickering. problem still exists, but without the messages.
The TP04056 board's description indicates that the Charge LED will be on when charging and it will be flashing when no battery is connected. The Done LED will be on when charging is done or no battery is connected.

Neither of these LED operations seem to be a ESP32 concern. If the LED blinking bothers you, then try by increasing the value of the MCP1700's 100uF cap. No promises, but maybe 1000uF will help.
... the voltage regulator is a AMS1117 33 DN911.
The AMS117 has 1V dropout. Not a good choice for single cell lithium battery operation. You will need to use 5V.

Using a 5V DC-DC step-up convertor is a legit way to operate the ESP32 from the single cell. Your first two examples appear to have the best efficiency.

- Thomas

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: external power supply via tp04056 leads to command unknown entries in the log

#8 Post by TD-er » 08 Jul 2024, 05:41

I think a step-up converter is the better choice here as it will also allow the board to work when the battery gets discharged below 3.0V.
N.B. the ESP32 will probably work on voltages < 3.0V, but the likelyhood of a reboot due to a brown-out (lower voltage due to current spikes) will increase a lot and the ESP32(classic) is known for having issues booting after a brown-out.
Also some other chips/sensors will likely start having issues below 3.0V

Please check to see if you can find any information on the quiescent current of the DC/DC converter you would like to use.
The AMS1117 is already not a very energy efficient one when it comes to 'idle power' consumption, so no need to make it worse by using a DC/DC converter which will also consume several mA for doing nothing. (AMS1117 uses 5 - 10 mA when nothing is connected or the ESP is in deep sleep)

espgraf
Normal user
Posts: 22
Joined: 11 Jun 2024, 20:13
Location: Germany

Re: external power supply via tp04056 leads to command unknown entries in the log

#9 Post by espgraf » 18 Jul 2024, 18:39

To go ahead, i have bought a Pololu 5V Step-Up/Step-Down Voltage Regulator S9V11F5 and i have setup the test configuration.
The output from the regulator is 5,05 V without the ESP-board.
When i connect the regulator with to esp-board 5v the red LED from the esp-board goes on but the ESP does not boot!
Also pushing the EN button does not start the ESP-board.
When the red LED is on then V on the 5v pin is 4,84.
The ESP32 Boad is a
iHaospace ESP32-DevKitC Core Board ESP32-WROOM-32U Development Board ESP32 WiFi Bluetooth Development Board (WROOM-32U) bought at A...
Summary so far: esp-board
-works with power supply via USB
-is booting with power supply via 3v3, but creates a lot of command unknown entries in the log an the load is > 90%
-does not boot with power supply via 5v
I have 2 boards and both show the same behavior.
looks like this board only works corrrect with power supply via USB.
Seems i need to find another board with a good deep sleep behavior and an external power supply via Li-ON 18650 Akku .

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: external power supply via tp04056 leads to command unknown entries in the log

#10 Post by TD-er » 18 Jul 2024, 21:24

I know there are boards which have an error on the silkscreen (the white text printed on the PCB), so GND and 5V may not be what the silkscreen suggests.

User avatar
ThomasB
Normal user
Posts: 1362
Joined: 17 Jun 2018, 20:41
Location: USA

Re: external power supply via tp04056 leads to command unknown entries in the log

#11 Post by ThomasB » 19 Jul 2024, 17:25

I searched Amazon for iHaospace ESP32-DevKitC Core Board ESP32-WROOM-32U and the picture I see is Identical to an ESP32 I bought from China. It is powered by external DC-DC VReg 5V, works fine.

See photo below. Is your ESP32 board identical (exact copy, not a variation)?
Attachments
ESP32 works from external 5V
ESP32 works from external 5V
ProtoBoard1.jpg (349.77 KiB) Viewed 24859 times

User avatar
ThomasB
Normal user
Posts: 1362
Joined: 17 Jun 2018, 20:41
Location: USA

Re: external power supply via tp04056 leads to command unknown entries in the log

#12 Post by ThomasB » 21 Jul 2024, 18:37

Just a heads up on the ESP32 board seen in my previous post. When powered through the 5V input, it sometimes resets the ESP32 memory on a cold start. EVERYTHING but WiFi settings are lost. Never see this when powered by USB. Very unusual issue, still investigating.

I don't think that this is what you are experiencing. But certainly another thing to deal with if you are using the same board.

- Thomas

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: external power supply via tp04056 leads to command unknown entries in the log

#13 Post by TD-er » 21 Jul 2024, 18:40

Sounds like ESPEasy detects the RX and TX pin to be connected and thus performs a factory reset.

User avatar
ThomasB
Normal user
Posts: 1362
Joined: 17 Jun 2018, 20:41
Location: USA

Re: external power supply via tp04056 leads to command unknown entries in the log

#14 Post by ThomasB » 21 Jul 2024, 19:26

Sounds like ESPEasy detects the RX and TX pin to be connected and thus performs a factory reset.
Brilliant. That explains it.

I'm not using the Tx/Rx pins. I suppose the USB/serial chip is confused when the USB port is unused. Too bad there isn't a setting in ESPEasy to disable the reset feature.

EDIT: It appears that the USB serial chip is missing power when using the 5VDC input pin method. Same as some other boards, so it's odd it affects this one. I'll see if a gentle 3.3V pullup on the RX pin helps out.

- Thomas

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: external power supply via tp04056 leads to command unknown entries in the log

#15 Post by TD-er » 21 Jul 2024, 21:50

ThomasB wrote: 21 Jul 2024, 19:26 [...]
Too bad there isn't a setting in ESPEasy to disable the reset feature.
[...]
Not sure if we should add those settings even though we do allow users to shoot themselves in their foot regarding other settings.
There was also another request made by a user to add a setting to disable the "detect bootloop crashes and disable tasks" feature which I know is extremely useful when you need it.

User avatar
ThomasB
Normal user
Posts: 1362
Joined: 17 Jun 2018, 20:41
Location: USA

Re: external power supply via tp04056 leads to command unknown entries in the log

#16 Post by ThomasB » 21 Jul 2024, 23:44

No worries. Thank you for identifying the culprit. The amnesia issue is resolved.

A 3.3K ohm pullup resistor seems to have fixed it. One end on the ESP32's RX pin, the other on the 3.3V pin. USB serial still works and powering by the 5V pin now avoids the memory resetting issue.

- Thomas

User avatar
Ath
Normal user
Posts: 4330
Joined: 10 Jun 2018, 12:06
Location: NL

Re: external power supply via tp04056 leads to command unknown entries in the log

#17 Post by Ath » 22 Jul 2024, 08:23

ThomasB wrote: 21 Jul 2024, 23:44 The amnesia issue is resolved.
I hope you have found the Tools/Backup feature that has been added relatively recent? (earlier this year) That'll backup all files on the file system in a single .tar archive, and can be restored on the same, or another, unit without much fuss. Only thing to watch out for is that Chrome, when saving the .tar file, suggests to not store the file :o (.tar format is somewhat '90s/oldish) so you have to convince it to keep it by clicking the appropriate button.
/Ton (PayPal.me)

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: external power supply via tp04056 leads to command unknown entries in the log

#18 Post by TD-er » 22 Jul 2024, 08:36

I would assume TAR is as old as there are POSIX files to be stored to tape, so I guess it might be more like '60s or '70s file format.
Anyway it is still a very widely used format as even the Espressif toolchain files are downloaded as .tar file while building ESPEasy ;) (Actually .tar.xz, which might be a bit of a tainted choice these days since the quite recent exploit-attempt to create a Linux backdoor in the .xz compression libraries. Good read by the way if you like to know more....)

User avatar
ThomasB
Normal user
Posts: 1362
Joined: 17 Jun 2018, 20:41
Location: USA

Re: external power supply via tp04056 leads to command unknown entries in the log

#19 Post by ThomasB » 22 Jul 2024, 17:27

I hope you have found the Tools/Backup feature that has been added relatively recent? (earlier this year)
Yes, I have been using that new feature a lot. Thanks for adding it!

- Thomas

espgraf
Normal user
Posts: 22
Joined: 11 Jun 2024, 20:13
Location: Germany

Re: external power supply via tp04056 leads to command unknown entries in the log

#20 Post by espgraf » 22 Jul 2024, 21:42

@ThomasB:
The picture you have posted is exactly like my board.
I haven't experienced a factory reset because when i power the board via usb it still starts with everything what i have already configured with ESPEasy.
As i don't have an 3.3K ohm resistor at hand (only 1k or 10k) i can't test whether this would also solve my problem.

I did some research for an ESP32-board which hopefully fulfills my requirements and have ordered now an
OLIMEX ESP32-DevKit-Lipo-EA (https://www.olimex.com/Products/IoT/ESP ... e-hardware).
The ESP modul seems to be the same as on the current board (iHaospace ESP32-DevKitC) so i hope it also works with ESPEasy.
- Josef

User avatar
Ath
Normal user
Posts: 4330
Joined: 10 Jun 2018, 12:06
Location: NL

Re: external power supply via tp04056 leads to command unknown entries in the log

#21 Post by Ath » 22 Jul 2024, 21:48

espgraf wrote: 22 Jul 2024, 21:42 As i don't have an 3.3K ohm resistor at hand (only 1k or 10k) i can't test whether this would also solve my problem.
10k will also do fine for the purpose of pulling it up from GND.
espgraf wrote: 22 Jul 2024, 21:42 I did some research for an ESP32-board which hopefully fulfills my requirements and have ordered now an
OLIMEX ESP32-DevKit-Lipo-EA (https://www.olimex.com/Products/IoT/ESP ... e-hardware).
The ESP modul seems to be the same as on the current board (iHaospace ESP32-DevKitC) so i hope it also works with ESPEasy.
That board should run just fine with ESPEasy. Nothing strange I can see, we've used a lot of (different) Olimex boards, so this shouldn't be an exception ;)
/Ton (PayPal.me)

User avatar
ThomasB
Normal user
Posts: 1362
Joined: 17 Jun 2018, 20:41
Location: USA

Re: external power supply via tp04056 leads to command unknown entries in the log

#22 Post by ThomasB » 22 Jul 2024, 22:20

The picture you have posted is exactly like my board.
I haven't experienced a factory reset because when i power the board via usb it still starts with everything what i have already configured with ESPEasy.
It seems you avoided the frustration that got me.
As i don't have an 3.3K ohm resistor at hand (only 1k or 10k) i can't test whether this would also solve my problem.
I don't expect a single 10K pullup will work out in this situation. If you want to try my solution for testing purposes, three pieces of 10K in parallel will provide the 3.3K ohms.

BTW, this hardware fix has proven to be a winner on my board. Several dozen cold boots since yesterday, works every time.

- Thomas

User avatar
ThomasB
Normal user
Posts: 1362
Joined: 17 Jun 2018, 20:41
Location: USA

Re: external power supply via tp04056 leads to command unknown entries in the log

#23 Post by ThomasB » 22 Jul 2024, 23:24

... when i power the board via usb it still starts with everything what i have already configured with ESPEasy.
I have a feeling that something innocent is getting in the way of your success (when powered by 5V).

For example, the ESP32's pin that is next to the 5V input pin, is labeled "CMD." But if you have tired eyes it probably looks like it says "GND." Any chance you made the mistake of connecting your 5V power ground to this pin?

And for useful troubleshooting, power the board by USB and confirm it works. Then measure the voltage on EVERY pin (38 places). Compare these measurements (USB vs. 5V operation) after powering the board with the 5V supply. If any pins are different (more than ±0.25V), then that could be a clue on diagnosing the problem. You are welcome to share the measurements here for review.

And a clear close-up photo of the project board might help us identify something suspicious.

- Thomas

espgraf
Normal user
Posts: 22
Joined: 11 Jun 2024, 20:13
Location: Germany

Re: external power supply via tp04056 leads to command unknown entries in the log

#24 Post by espgraf » 23 Jul 2024, 21:47

Ok understood, as i was out today i will do the measurements tomorrow. The topic with the CMD pin i have alteady red in other forums and i haven‘t used the CMD Pin at all.
- Josef

espgraf
Normal user
Posts: 22
Joined: 11 Jun 2024, 20:13
Location: Germany

Re: external power supply via tp04056 leads to command unknown entries in the log

#25 Post by espgraf » 25 Jul 2024, 22:11

today i found some time to measure the voltage of each PIN. I did the measurement for USB, external Power (via the USB plug there) with 3.3V and 5V, see results in the table below and soem additional pictures from the test setup.
ESP32-Board
0 Board.jpg
0 Board.jpg (1.61 MiB) Viewed 24314 times
extern with TP4056 and USB Powersupply
1 extern .jpg
1 extern .jpg (1.96 MiB) Viewed 24314 times
3.3V MCP1702
3.3V.jpg
3.3V.jpg (2.1 MiB) Viewed 24314 times
5V with Pololu S9V11F5
5.5V Test0.jpg
5.5V Test0.jpg (2.46 MiB) Viewed 24314 times
5.5V Test1.jpg
5.5V Test1.jpg (2.14 MiB) Viewed 24314 times
5.5V Test3.jpg
5.5V Test3.jpg (2.14 MiB) Viewed 24314 times
i hope this provides the information you requested

User avatar
ThomasB
Normal user
Posts: 1362
Joined: 17 Jun 2018, 20:41
Location: USA

Re: external power supply via tp04056 leads to command unknown entries in the log

#26 Post by ThomasB » 25 Jul 2024, 22:50

Thanks for the photos. I don't see the comparison list of pin voltages.

- Thomas

espgraf
Normal user
Posts: 22
Joined: 11 Jun 2024, 20:13
Location: Germany

Re: external power supply via tp04056 leads to command unknown entries in the log

#27 Post by espgraf » 25 Jul 2024, 23:02

sorry forgot to add it, here you go
Attachments
Power.jpg
Power.jpg (205.73 KiB) Viewed 24304 times

User avatar
ThomasB
Normal user
Posts: 1362
Joined: 17 Jun 2018, 20:41
Location: USA

Re: external power supply via tp04056 leads to command unknown entries in the log

#28 Post by ThomasB » 26 Jul 2024, 00:06

Hmm. I don't see anything obvious. But I have some suggestions for the 5V testing.

1. The inexpensive DC-DC VRegs, especially with long leads, are often noisy. Add decoupling caps directly across ESP32 Gnd and 5V pins. Typically something like 0.1uF ceramic with 47uF to 220uF electrolytic in parallel. Short leads, solder directly on the ESP32.

2. Jumper the three ground pins together. My build has done that.

3. Add the 3.3K ohm pullup (3.3V) resistor to the RX pin. Doubtful it has happened yet, but this will ensure you don't get bitten by the issue I ran into.

Keep in mind that long leads can sometimes cause weird issues with microprocessor builds. So do your best to avoid long wires until the issue is resolved. Not saying to trim them to a little stub, but choose the shortest jumpers you have for your testing.

- Thomas

User avatar
ThomasB
Normal user
Posts: 1362
Joined: 17 Jun 2018, 20:41
Location: USA

Re: external power supply via tp04056 leads to command unknown entries in the log

#29 Post by ThomasB » 26 Jul 2024, 19:05

Hold on a moment. Looking at the voltages again, it occurred to me that original problem won't be solved with 5V operation. That is because the USB serial chip will still be in an undefined state, as I discovered with the ESPEasy memory reset/clear experienced on my project that uses this board.

The best answers to your problem were provided at the beginning. Ath provided a good explanation to what is happening. And TD-er offered a practical solution (turn off serial console or move it to unused pins).

Since you will be using battery power, the ideal power solution is the one that draws the least amount of current. So I suggest comparing current draw between your various supply connection choices and select the one that has the lowest power requirements.

- Thomas

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: external power supply via tp04056 leads to command unknown entries in the log

#30 Post by TD-er » 26 Jul 2024, 19:15

When running battery powered, it is even better to not having the parts present which you will not use.
Extra pull-up or -down resistors also draw current and when compared to the current draw from the ESP itself during deep sleep, this might be quite significant.
Some voltage regulators, like the AMS1117 even draw 5 - 15 mA when you have nothing connected to them (thus also when an ESP in deep sleep is connected)

To compare, the typical current consumption of an ESP in deep sleep (depending on the model) is 60 uA

espgraf
Normal user
Posts: 22
Joined: 11 Jun 2024, 20:13
Location: Germany

Re: external power supply via tp04056 leads to command unknown entries in the log

#31 Post by espgraf » 06 Aug 2024, 14:50

meanwhile i have implemented a solution with an Olimex ESP32-DevKit-Lipo-EA board and an 18650 Lion-Accu.
ESPEasy version ESP_Easy_mega_20240730_collection_B_ESP32_4M316k is running quite well.
IMG_0544.jpg
IMG_0544.jpg (1.22 MiB) Viewed 21921 times
The VL53L1X is in a separate box connected via a cat6-cable (~1,3m).
IMG_0542.jpg
IMG_0542.jpg (2.24 MiB) Viewed 21921 times
To optimise the power consumption i will to some finetuning for deepsleep.

I will also to some further tests for the original approach and post the results here.

TD-er
Core team member
Posts: 9884
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: external power supply via tp04056 leads to command unknown entries in the log

#32 Post by TD-er » 06 Aug 2024, 16:17

Not sure whether there will be something power related is present on those solder joints on the last picture.
Maybe you want to add some tape or hotglue to those solder joints.
If it is connected to the 18650 and it might get wet, you can have quite a large current there causing a fire as those batteries can output quite high currents.
Those wires will probably melt away or the solder joint may come loose, which can even cause a better short circuit connection.

User avatar
ThomasB
Normal user
Posts: 1362
Joined: 17 Jun 2018, 20:41
Location: USA

Re: external power supply via tp04056 leads to command unknown entries in the log

#33 Post by ThomasB » 06 Aug 2024, 19:50

Glad you solved it. I read the details to the Olimex ESP32-DevKit-Lipo-EA and it certainly simplifies your installation a lot.

- Thomas

espgraf
Normal user
Posts: 22
Joined: 11 Jun 2024, 20:13
Location: Germany

Re: external power supply via tp04056 leads to command unknown entries in the log

#34 Post by espgraf » 06 Aug 2024, 21:51

@TD-er
the brown/brown-white are connectet to the +3.3V and GND pins of the board, so no direct connection to the battery.
But your are right, i will add some hotglue to make it more save.
Thanks for the hint.

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 16 guests