Accessing COM port from WSL

When WSL first came out, first thing I checked was COM port support. I think any IoT hacker would love to have COM port support from WSL, it gives all Linux tools on windows and access the boards.

If you haven’t used WSL, I highly recommend it. Its very easy to install. Just run the following command in power shell as admin then go to Microsoft store and pick the distribution you want and done. (You can install multiple distros as well)

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

We can access the COM ports (Serial interface) from WSL. Which means programs running in WSL can talk to the hardware. Like serial monitor tools, flashing tools etc. Mapping of the windows COM port to Linux tty is done automatically, COM<N> is mapped to ttyS<N>, for example for COM5 the device name in WSL would be /dev/ttyS5.

10 Comments

Add a Comment

Your email address will not be published. Required fields are marked *