I am using Platformio (Compiled & uploaded ESPmon to Robotdyn UNO+Wifi board, but when it started, I saw the old ESP logi, as well as the required ESPmon-xxx login, so then tried to erase the ESP8266 memory. ESPtools are in Platformio, but could not work out how to acess that, so loaded ESPtools & ran from root terminal. Results below:
[root@localhost doug]# esptool.py -p /dev/ttyUSB0 erase_flash
esptool.py v2.6
Serial port /dev/ttyUSB0
Connecting...
Traceback (most recent call last):
File "/usr/bin/esptool.py", line 2959, in <module>
_main()
File "/usr/bin/esptool.py", line 2952, in _main
main()
File "/usr/bin/esptool.py", line 2646, in main
esp = ESPLoader.detect_chip(each_port, initial_baud, args.before, args.trace)
File "/usr/bin/esptool.py", line 259, in detect_chip
detect_port.connect(connect_mode)
File "/usr/bin/esptool.py", line 460, in connect
last_error = self._connect_attempt(mode=mode, esp32r0_delay=False)
File "/usr/bin/esptool.py", line 419, in _connect_attempt
self._setRTS(True) # EN=LOW, chip in reset
File "/usr/bin/esptool.py", line 391, in _setRTS
self._port.setDTR(self._port.dtr)
AttributeError: 'Serial' object has no attribute 'dtr'
(end)
Completely at sea here! I have enough knowledge to be dangerous! Can someone help pls??
ps: apparently the next version of Platformio is better, but I am still running the supported
version.
I have been in a similar situation to you. I also use PlatformIO with just about enough understanding to be dangerous.
Somebody suggested I switch to Visual Studio Code and run platform from there. I did that and since then I have had much less difficulty.
The erase command is
esptool.py --port COM5 erase_flash
Works like a charm for me. Obviously that’s a Windows command and you will need to use the correct usb port. Also I have found you need to keep the PlatformIO environment up to date but that is fairly easy.
The issue was there were old versions of pyserial hanging around. Deleted them all (some by uninstalling from my Distro, & others as pip uninstall pyserial in a root terminal. (or use Sudo at your own risk! PCLinuxOS frowns on Sudo…)
The other issue I fixed was to install the correct USB parameters for the Linux /etc/udev/rules.d/99-platformio-udev.rules where I added the CH340 section:
# CH341 USB UART
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1A86", ATTRS{idProduct}=="7523", MODE:="0666"
regards, Doug
(& thanks Ian: I have not used M$ windoze for abt 20 years! (Even loaded PCLinuxOS on my new Dell 2:1 I5 tablet.)