-
-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use physical serial port if present on WSL2 #2790
Conversation
PR Summary
|
35bf25b
to
d6f2549
Compare
@mikee47 This PR is approved. Waiting for @callimero to confirm that this fix works also for him. |
Still...
I could not make it work. Maybe I did something wrong or just don't understand enough. What I did: checked out the PR branch ` Basic_Blink: Invoking 'flash' for Esp8266 (debug) architecture . . . powershell.exe -Command "/usr/bin/python3 /home/cw/smingwslser/Sming/Sming/Components/esptool/esptool/esptool.py -p /dev/ttyUSB0 -b 115200 --chip esp8266 --before default_reset --after hard_reset write_flash -z -fs 1MB -ff 40m -fm dio 0x00000 out/Esp8266/debug/firmware/rboot.bin 0x000fa000 out/Esp8266/debug/firmware/partitions.bin 0x00002000 out/Esp8266/debug/firmware/rom0.bin 0x000fc000 /home/cw/smingwslser/Sming/Sming/Arch/Esp8266/Components/esp8266/sdk/bin/esp_init_data_default.bin " I put some debug output in, WSL_COMPORT_POWERSHELL is not 1 still powershell.exe is used. Where should I look/what todo, to provide you with the information you need? Cheers, |
I tried hard this morning. Sorry. Could not get it to work. (see edited answer). Carsten |
Heads up! make terminal works So I changed (just poking around here...) Components/esptool/component.mk ` ifdef TERMINAL . . . Works like a charm so far. All the best, |
@callimero Thanks for persisting! See https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally. NB. Note triple backtick for block code quotes! |
Ahhhh! Why is the menu called "code" if it still formats as md... Cheers, |
Single backticks are for |
Further to #2790 esptool of course uses COM ports and same issue applies when physical ports available in WSL2.
WSL2 doesn't natively support USB devices such as serial ports, so Sming uses runs the python terminal application inside Windows natively using powershell.
However, as discussed in #2789 this prevents software such as usbipd from working.
This PR adds an additional check when running inside WSL2 to see if the nominated port, via
COM_PORT
, is actually present. If so, then it runs the python terminal application normally. If the path isn't present then it is assumed to be a Windows port and powershell is invoked as usual.Because the
TERMINAL
environment variable is cached by Sming this can cause issues. To maintain existing behaviour this variable is still cached but left empty to indicate default behaviour. IfTERMINAL
has been redefined then that will be run instead. This will requiremake config-clean
to clear the existing cached value.