Closed balloob closed 1 year ago
Question: would it be possible to skip changing the baud if this.baudrate == this.rom_baudrate ?
Sounds reasonable, I can't think of any downside.
(The whole connection flow could use some clean-up, by the way. It's odd that we have both detect_chip and connect, but we need to call an aptly named main_fn.)
Same problem here, and fix by @balloob suggestion.
The change does fix our noticed issue when using current esptool.js With the change it does work well. A new release would be nice.
We use esptool-js to power ESP Web Tools. When it starts installing using esploader, it passes an existing port. The port has been opened, used to query improv, and then closed.
ESPLoader
will, as part ofmain_fn()
, callawait this.change_baud();
. This command is causing the connection to timeout and make the connection unusable.The fix for ESP Web Tools is to apply a patch to the installed node module to comment out the changing of the baud rate. When done, everything works fine.
I've been looking into the code trying to understand what's going on:
baudrate
androm_baudrate
param. Second one defaults to115200
main_fn()
callsdetect_chip()
detect_chip() calls
connect()connect()
callstransport.connect(this.rom_baudrate)
transport.connect()
opens the port at the requested baud rate and stores it astransport.baudrate
change_baud
.change_baud
sends a packet. Then disconnects and opens again.Question: would it be possible to skip changing the baud if
this.baudrate == this.rom_baudrate
?