FVdS
December 9, 2023, 12:06pm
1
Hellow, i’ve bought a esp32 4relay board ac/dc.
There is no micro usb port on it.
How can I connect it with mij pc on windows, so I can first flash it, and after it use OTA?
aceindy
(Aceindy)
December 9, 2023, 12:13pm
2
to program it you’ll need something like
1x
f.e. connected to an esp01:
(Check
this link for more options flashing esp-01’s)
2 Likes
FVdS
December 10, 2023, 11:59am
3
Hellow,
Thanks for the answer,
I’m using this Serial adapter: https://www.diyhobi.com/wp-content/uploads/2017/07/Programming-ESP-01-using-USB-to-TTL-CH340G-Converter-Module-Adapter.jpeg
And I use this board: ESP32_DevKit_C_V4_Pinout.pdf (shopify.com)
I’m powering the board by the micro usb port.
When I connect the Rx to the Tx, and the Tx to the Rx, I can view logs of the Esp32 board.
But what have I got to do for downloading a new program?
When I do it with Web-Esphome, he says ’ failed to connect’
And with Esphome flasher:
I can read the logs.
but when I want to flash I get : Unexpected error: could not open port com6: PermissionError(13, ‘Access denied.’, None, 5)
aceindy
(Aceindy)
December 10, 2023, 12:35pm
4
I also have that error sometimes, i usually solve it by downgrading the drivers
FVdS
December 10, 2023, 3:39pm
5
do you also use ESPhome flasher?
aceindy
(Aceindy)
December 10, 2023, 3:54pm
6
Yes, i do (on W10)
But I have the same issue when trying to install. y means of the web-serial through the esphome addon
FVdS
December 10, 2023, 4:50pm
7
aceindy
(Aceindy)
December 10, 2023, 5:45pm
8
not that one, the one from my picture.
But, since they are both CH34x based, a driver downgrade should fix it:
opened 08:09PM - 01 May 23 UTC
closed 08:22AM - 02 May 23 UTC
Type: Bug
### Operating System
Win10
### Esptool Version
v4.5.1
### Python Version
3.… 9.10
### Full Esptool Command Line that Was Run
esptool --before default_reset --after soft_reset --chip esp8266 --port COM5 --baud 921600 write_flash --flash_mode dout --flash_size 1MB 0x0 .pio\build\esp01_1m\firmware.bin
### Esptool Output
```shell
esptool.py v4.5.1
Serial port COM5
A serial exception error occurred: Cannot configure port, something went wrong. Original message: PermissionError(13, 'Ein an das System angeschlossenes Gerät funktioniert nicht.', None, 31)
Note: This error originates from pySerial. It is likely not a problem with esptool, but with the hardware connection or drivers.
For troubleshooting steps visit: https://docs.espressif.com/projects/esptool/en/latest/troubleshooting.html
```
### What is the Expected Behaviour?
Open port COM5 successfully and start firmware upload.
This is from a successfull run with ch340/341 driver version 3.5 and the same command as above:
```
esptool.py v4.5.1
Serial port COM5
Connecting....
Chip is ESP8266EX
Features: WiFi
Crystal is 26MHz
MAC: e8:9f:6d:93:3c:e5
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Configuring flash size...
Flash will be erased from 0x00000000 to 0x00042fff...
Flash params set to 0x0320
Compressed 272752 bytes to 200366...
Wrote 272752 bytes (200366 compressed) at 0x00000000 in 3.3 seconds (effective 663.8 kbit/s)...
Hash of data verified.
Leaving...
Soft resetting...
```
### More Information
This was executed in a PlatformIO project.
I had troubles with the generic esp-01_1m project and from my limited knowledge I suspect the `dout` instead of the default `qio` to be the culprit.
In the process of trouble shooting, I updated the CH340/CH341 drivers to the latest **version 3.8 from 2023-03-16**, see: http://www.wch-ic.com/products/CH341.html?
After that, the error occured.
I downloaded an older **version 3.5 from 2019-03-18** with help of archive.org: https://web.archive.org/web/20211129002033/http://www.wch-ic.com/downloads/CH341SER_EXE.html
After installtion, the problem was fixed!
I noticed that the pySerial project has no new releases since mor then 6 months ago. So maybe there is a problem...?
Also, I noticed the technical staff of the manufacturer of CH340 of this bug report.
### Other Steps to Reproduce
- Update driver for CH430/431 to version 3.8 from http://www.wch-ic.com/products/CH341.html?
- start upload procedure with a usb-serial-converter with CH340/341 chip
I downloaded an older version 3.5 from 2019-03-18 with help of archive.org : https://web.archive.org/web/20211129002033/http://www.wch-ic.com/downloads/CH341SER_EXE.html
After installtion, the problem was fixed!
And for some reason W10 keeps on updating the driver regularly, even without asking…
So i just store the old drivers, and downgrade whenever the fault re-appears
The 3.5 driver is also for your CH340G
FVdS
December 10, 2023, 7:08pm
9
Hey,
I finally made it.
I make the connection with the following adapter: ESP-PROG - Open Source Hardware Board (olimex.com)
aceindy
(Aceindy)
December 10, 2023, 7:19pm
10
Good to hear you fixed it; that was indeed another option…
The permission issue is related to the driver of the CH340G, and has on itself nothing to do with esphome or espflasher
And, if i may ask, is your ‘solution’ really related to the original question?
It basically doesn’t matter what kind of ttl-serial usb-connector you use, the point is that you need to use one.
And I am even pretty sure you CH340G will also work if you downgrade your drivers (and that would have saved you €3,95 + shipping too)
So shouldn’t the solution be the 1st reply on your post ??
FVdS
December 10, 2023, 7:44pm
11
Maybe, but i’m happy it works now