openframeworks / openframeworks/openFrameworks

ofSerial setup method doesn't work with deviceNumber when used with STMicroelectronics Virtual COM Port

Open
#6,081 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10.4k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
9

Description

Hi,

I noticed that when I tried to open the first serial device found by the system (setup function with deviceNumber), I got the error "[ error ] ofSerial: setup(): unable to open COM Port (COM13". However when I tried to open the serial with its portName, it works.

I checked what is performed inside the ofSerial::setup(int deviceNumber, int baud) function, and I realized that the error is due to an incorrect devicePath of the device stored in the devices vector (std::vector devices). Indeed, in my case the devicePath is "COM Port (COM13" while it should be "COM13"!

I am using OF V0.10.0 on Visual Studio 2017 and Windows 10 x64.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ofSerial::setup(int deviceNumber, int baud) and the std::vector devices path described in the issue. Reproduce the device discovery and opening behavior on Windows with an STMicroelectronics Virtual COM Port, then verify that selecting by deviceNumber opens the same port as selecting by portName.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.