iotile / iotile/coretools

Verify and then change bled112 default speed to 230230 baud

Open
#710 0 comments 0 reactions 0 assignees View on GitHub
class:self-contained transport-bled112 type:enhancement
Dominant language
Python
Stars
14
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Our default baud rate in `bled112` is set at 256000 baud. Turns out that this is a "nonstandard baud" which means that it uses a different `ioctl` command to set than a standard baud. This has never been an issue because most usb serial drivers support both ioctls.

However when running CoreTools on Windows Subsystem for Linux, they implement a mapping between `COMX` and `/dev/ttySX` so that we can use the BLED112 dongle from linux but they do not implement the `ioctl` for nonstandard buad rates:

- https://github.com/Microsoft/WSL/issues/2595
- https://github.com/pyserial/pyserial/blob/master/serial/serialposix.py#L139

So if we use a standard baud then bled112 will work on WSL, otherwise it won't. The closest standard baud is `230,400`:
- https://github.com/pyserial/pyserial/blob/master/serial/serialposix.py#L106

I don't think it actually matters what number we put in there because the BLED112 is native usb just presenting a usb-serial compatible interface to use a standard driver so there shouldn't be any speed impact in picking 230400 over 256000 but we'll need to verify that.

The key ptoential upside here is that Windows users (e.g. me) can do screencasts demonstrating how to use the `iotile` tool using `asciinema` and `termtosvg` which are posix only.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.