TimeoutError: Could not automatically find serial port

Hi,
MACOS Monterey 12.3.1
VS Code Version : 1.68.1
Target : ESP8266

2 issues since version 6.1.0RC

  1. upload_speed is not recognised anymore

Library Manager: Installing upload_speed
Warning! Could not find the package with ‘upload_speed’ requirements for your system ‘darwin_x86_64’

  1. Serial port is not recognised automatically anymore
    ([“upload”], [".pio/build/stagingSerial/firmware.bin"])
    AVAILABLE: espota, esptool
    CURRENT: upload_protocol = esptool
    MethodWrapper([“upload”], [".pio/build/stagingSerial/firmware.bin"])
    TimeoutError: Could not automatically find serial port for the NodeMCU 1.0 (ESP-12E Module) board based on the declared HWIDs=[[‘0x10C4’, ‘0xEA60’]]

Could you help to get it working because upload is only working @115200 bauds and working with multiple serial port is not possible
Thanks

This just indicates that your platformio.ini is mis-formatted or mis-indented. Can you show the platformio.ini?

1 Like

That one’s a separate issue I have also encountered when I want to treat my board as another board… Maybe PlatformIO should fallback to its old behavior there if it cannot find the specified HWID to try an upload at all.

the platformio.ini was working is the previous version.

[env]
platform = espressif8266
board = nodemcuv2
board_build.filesystem = littlefs
framework = arduino
monitor_speed = 115200
monitor_filters = esp8266_exception_decoder, colorize
;,send_on_enter
targets = sign_bin
build_type =debug
extra_scripts =
	pre:env.py
	post:post_build.py
lib_deps = 
	yutter/ArduinoJWT@^1.0.1
	knolleary/PubSubClient@^2.8
	bblanchon/ArduinoJson@^6.19.4
	suculent/AESLib@^2.2.1
	;arduino-libraries/NTPClient@^3.2.1

upload_speed = 921600


[version]
version = 1.3.0.0

[common]
host78760 = MaPool78760
hoststaging = MaPoolOTA
hosttest = MaPool-0000AB0
maquette = MaPool-???????
hostprod = MaPoolPRO
build_flags = 
	-D VERSION='"1.X.X.1"'
		-Wl,-Map=MAPOOL.map,--cref 
	-D PIO_FRAMEWORK_ARDUINO_LWIP2_LOW_MEMORY
	;-D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED
	-DOTA_LOCAL
	-DTELNET
	-DHOME
	-DPROC_ESP

[local]
build_flags = 
	${common.build_flags}
	-D ENV='"LOCAL"'
	-D SERVER_URL='"http://192.168.1.15:3666"'
	-D MQTT_URL='"dev.mqtt.ma-pool.fr"'
;	-D HOSTNAME='"${common.hostdev}"'

[env:local]
build_flags = ${local.build_flags}

This looks good, but the error message indicates that you have at least one space in front of the upload_speed option. Can you double check? There must be none.

You might also have weird linebreaks.

Correct strange char, I retype the line and now upload_speed in recognised. Thank you
What about the 2nd issue ? I have 1 mega connected on 1 USB serial, 1 Jtab on other USB serial and 1 ESP8266 on other USB serial. With the previous versions it was working well and automatically . Any solution ?

What PID and VID does it show when when you type pio device list in the CLI?

dev/cu.BLTH
------------
Hardware ID: n/a
Description: n/a

/dev/cu.Bluetooth-Incoming-Port
-------------------------------
Hardware ID: n/a
Description: n/a

/dev/cu.usbserial-1420
----------------------
Hardware ID: USB VID:PID=1A86:7523 LOCATION=20-2
Description: USB Serial

It’s expecting

due to

which is a CP210x UART Bridge, but you have 1A86:7523 which is a CH340 USB converter, hence why it fails.

I don’t see how one could declare a double-array in the platformio.ini to overwrite board_build.hwids

You can however force an upload port with

upload_port = /dev/cu.usbserial-1420

in the platformio.ini.

@ivankravets what do you think? The HWID filtering is too strict with those popular clone boards like the NodeMCUv2 which can either have CH340 or CP210x on them. Other developers might use this board definition with a Parallax USB converter or an FTDI and it will fail for them too. Best to try some port (e.g. the last one in the list of ports) if no exact match is found instead of failing?

1 Like

I clean installation, reinstall, sill doesn’t work, downgraded to 6.0.2
other issues not fixed in version (6.0.2) and RC

  1. RAM size and Flash are not printed correctly , it show 0 ( only for ESP8266)
RAM:   [          ]   0.0% (used 0 bytes from 81920 bytes)
Flash: [          ]   0.0% (used 0 bytes from 1044464 bytes)
text       data     bss     dec     hex filename
  1. during the size process; all symbols are print , buffer of console become full, so only way to read report of compilation is to make redirection to a file. Solution I found to avoid this issue.
    to change line 178&179in ~/.platformio/platforms/espressif8266/builder/main.py
    SIZECHECKCMD=“$SIZETOOL -A -x $SOURCES”,
    SIZEPRINTCMD=‘$SIZETOOL -B -x $SOURCES’,
    by
    SIZECHECKCMD=“$SIZETOOL -B -x $SOURCES”,
    SIZEPRINTCMD=‘$SIZETOOL -B -x $SOURCES’,

  2. just a personal questionning, why JTAB for MEGA is not implemented , it just some line to add in platform.py to get atmelice & avarice running

Fixed in Remove non-official HWIDs · platformio/platform-espressif8266@a77caa0 · GitHub

We should remove hwids for non-official boards (clones) that do not have their own VIP/PID and use generic USB → UART. If the hwids field is not declared, PlatformIO will read compatible devices from https://github.com/platformio/platformio-core/blob/develop/scripts/99-platformio-udev.rules

Does Development Version work for you?

[env]
platform = https://github.com/platformio/platform-espressif8266.git

yep, HWID has been introduced in 6.1.x it is the difference , removing it is working , does it mean that change has to be made for each new version ?

Yes development Version work

1 Like

the same problem appeared

CURRENT: upload_protocol = esptool
Looking for upload port...
TimeoutError: Could not automatically find serial port for the `NodeMCU 1.0 (ESP-12E Module)` board based on the declared HWIDs=[['0x10C4', '0xEA60']]
Error: Please specify `upload_port` for environment or use global `--upload-port` option.
For some development platforms it can be a USB flash drive (i.e. /media/<user>/<device name>)
*** [upload] Explicit exit, status 1

But the platform doesn’t declare those anymore. Is that project using https://github.com/platformio/platform-espressif8266.git too?

used to
[env:nodemcuv2]
platform = espressif8266@^2
board = nodemcuv2

Write

[env:nodemcuv2]
platform = https://github.com/platformio/platform-espressif8266.git 
board = nodemcuv2
framework = arduino

instead. (Or downgrade the PlatformIO core)

This is kinda bad timing. The core enforces the HWIDs really hardcore but the platforms are not yet up to speed in their stable versions :frowning:

1 Like

Your version of platformio works. How “downgrade the PlatformIO core”?

CLI + pip install "platformio==6.0.2".

1 Like

Do we have reports for other boards? It is not a problem to bump patch releases for the affected dev-platforms.