Yarp: Yarp SerialDevice opening error

Created on 11 Sep 2019  路  7Comments  路  Source: robotology/yarp

I am trying to run the serialdevice on a windows machine as shown in the example https://github.com/robotology/yarp/tree/devel/src/devices/serialport

yarpdev.ext --device serialport --comport COM23 --file serial.ini

````

The serial port `COM23` and the contents of it are read using `Realterm` software and I can see the data streamed in the port. The file ` serial.ini` containts correct configuration parameters that are similar to those present in `Realterm` but still when I try to launch the yarp serial device, I get the following error:

[DEBUG]Subdevice serialport
[INFO]Starting Serial Port in COM23
[ERROR]Invalid communications port in COM23: No such file or directory
yarpdev: ERROR driver was found but could not open
[ERROR]cannot make
yarpdev: ERROR driver was found but could not open
[ERROR]yarpdev: ERROR device not available.
[INFO]Suggestions:
[INFO]+ Do "yarpdev --list" to see list of supported devices.
[INFO]+ Or append "--verbose" option to get more information.

```

On windows machine, yarpdev.exe --list does not work and the terminal is hung when tried to execute it. But alternatively, as @diegoferigo pointed out yarp plugin --list shows serialport in the list.

Devices QSupport Upstream Feedback Reminder - Documentation Needed

Most helpful comment

On windows COM23 is not properly managed by ACE. You need to rename the port using _windows device manager_ and use a smaller number (not sure about the maximum number but

All 7 comments

@randaz81 please take a look at this issue. Thanks.

I followed the tutorial in https://learn.sparkfun.com/tutorials/terminal-basics/command-line-windows-mac-linux and I can read the serial port data from the terminal. Yet, the yarp serial device is failing to start.

Capture

On windows COM23 is not properly managed by ACE. You need to rename the port using _windows device manager_ and use a smaller number (not sure about the maximum number but

Not directly answering your question @Yeshasvitvs, but given @randaz81 answer the issue is due to ACE, an alternative option is to implement a new YARP serial device driver using another cross platform library for accessing serial devices (such as https://github.com/wjwwood/serial), it should not be too complex and it should provide us more options, such as handling more parity bytes and bytesizes (https://github.com/wjwwood/serial/blob/master/include/serial/serial.h#L56) that I think is something with which @HosameldinMohamed also had problems in the past.
It probably would make sense to develop it in some other repo, and if it turns to be useful, it could make sense to move it into yarp.

As @randaz81 pointed out, changing the device comport to COM2 through device manager in windows solved the problem. Now I can start the yarp serial device by running

yarpdevice.exe --device serialport --from serial.ini

with the following serial.ini configuration file

/// An initialization file with all possible parameter for configuring the dserial port and adequate defaults.

verbose 1
comport COM2 //Windows
//comport /dev/ttyACM0 //Linux
baudrate 115200
xonlim 0
xofflim 0
readmincharacters 1
readtimeoutmsec 100
paritymode none
ctsenb 0
rtsenb 0
xinenb 0
xoutenb 0
modem 0
rcvenb 0
dsrenb 0
dtrdisable 0
databits 8
stopbits 1
line_terminator_char1 10
line_terminator_char2 13

[plugin serialport]
type device
name serialport
library yarp_serialport
wrapper serial

However, we noticed that a call to receive() is made always and the debug message prints the serial port data on the terminal.

In any case @randaz81 @traversaro can we close this issue ?

@randaz81

  • Is the "< COM9" requirement documented somewhere? If not perhaps it would be useful to write it down in the device documentation.
  • It shouldn't be too difficult to add a check on the serial port name
  • Is there a relative bug report/issue on ACE? If not we should open one.

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

Was this page helpful?
0 / 5 - 0 ratings