platformio / platform-espressif8266

Espressif 8266: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/espressif8266
Apache License 2.0
325 stars 219 forks source link

OTA port detection falsely triggers for serial ports #134

Closed maxgerhardt closed 5 years ago

maxgerhardt commented 5 years ago

It has been reported (see here) that PlatformIO attempts to use the OTA uploader for serial ports, such as COM5.

This behaviour was made possible by this commit: https://github.com/platformio/platform-espressif8266/commit/54cd0fb1e2f61b1c6624d708f749372a37dd9648

This is in turn because on some DNS configurations, COM ports are actually resolvable. This might be because the user's ISP has chosen to return the IP to a search website for all non-resolvable names.

Possible fixes:

ivankravets commented 5 years ago

Thanks, Maximilian for the report. I've just rewritten upload logic in https://github.com/platformio/platform-espressif8266/commit/ae96496766b0aeeae60cfc81d45801b535bee66c and added support for espota protocol. This is the right solution.

tablatronix commented 4 years ago

Why do I still have this problem ? If I have no upload-flags set why is this not using the upload_tool from boards?

nodemcuv2.upload.tool=esptool ?

[env:nodemcuv2_dev]
platform = https://github.com/platformio/platform-espressif8266.git#feature/stage
board = nodemcuv2
framework = arduino
build_flags = -DWM_DEBUG_PORT=Serial -DWM_DEBUG_LEVEL=3
lib_extra_dirs = /Users/shawn/projects/microcontrollers/dev/libraries
upload_speed = 921600

pio run -t upload -e nodemcuv2_dev --upload-port /dev/cu.SLAB_USBtoUART

Use manually specified: /dev/cu.SLAB_USBtoUART
"penv/bin/python" "/Users/shawn/.platformio/packages/tool-espotapy/espota.py" --debug --progress -i /dev/cu.SLAB_USBtoUART -f .pio/build/nodemcuv2_dev/firmware.bin
22:21:30 [DEBUG]: Options: {'timeout': 10, 'esp_ip': '/dev/cu.SLAB_USBtoUART', 'host_port': 14750, 'image': '.pio/build/nodemcuv2_dev/firmware.bin', 'host_ip': '0.0.0.0', 'auth': '', 'esp_port': 8266, 'spiffs': False, 'debug': True, 'progress': True}
22:21:30 [INFO]: Starting on 0.0.0.0:14750
22:21:30 [INFO]: Upload size: 380720

Its really pissing me off, any suggestions?

tablatronix commented 4 years ago

ok so if it resolves it just changes it to espota, I am not setting upload_protocol in all my ini files, to hell with that, I guess ill rip this resolve crap out of main.py for now. or bash my stupid router with a hammer lol