virtual-serial-port

Socat virtual serial port not recognized

孤街浪徒 提交于 2019-12-06 06:36:33
问题 I'm using socat to create a couple virtual serial ports. One I connect to with a simple C program (using termios), and the other I'd like to connect to using a program called Ardupilot Mega Planner (for RC stuff). However, the Planner does not recognize the virtual port (listed under /dev/pts), only the tty devices and /dev/serial devices. Do I need to do some sort of special mount for this to work? Or is there a workaround I could try? I tried "linking" an existing serial port (ttyS0, for

Change COM port via registry, command line or software?

时光总嘲笑我的痴心妄想 提交于 2019-11-30 19:28:12
Does anybody know how to change the COM port number that Windows maps to a USB virtual COM port? You can change this via the Device Manager and clicking on the Advanced button.. but how can you do this via an API, registry change or command line operation? Any ideas please? Will Dean You might find this answer useful: How do I get the friendly name of a COM port in Windows? It's about finding the friendly name, but I think you'll find it points you towards the right area of the registry, using the 'official' mechanism for locating the right key. However, if you change the port assignment, you

Change COM port via registry, command line or software?

元气小坏坏 提交于 2019-11-30 03:38:23
问题 Does anybody know how to change the COM port number that Windows maps to a USB virtual COM port? You can change this via the Device Manager and clicking on the Advanced button.. but how can you do this via an API, registry change or command line operation? Any ideas please? 回答1: You might find this answer useful: How do I get the friendly name of a COM port in Windows? It's about finding the friendly name, but I think you'll find it points you towards the right area of the registry, using the

C# SerialPort#Open() method throws ArgumentException because of port name?

a 夏天 提交于 2019-11-29 17:41:07
On my local machine, Windows XP Ports (COM & LPT) COM3 RIM Virtual Serial Port v2 (COM4) RIM Virtual Serial Port v2 (COM5) the following code, using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.IO.Ports; using System.Threading; namespace OpenSerialPortTest { class Test { static void Main(string[] args) { foreach (String serialPortName in SerialPort.GetPortNames()) { SerialPort serialPort = new SerialPort(serialPortName); try { serialPort.Open(); // Line 19 Console.WriteLine(serialPort.PortName); } catch (Exception ex1) { Console.WriteLine(ex1);

Specifying non-standard baud rate for FTDI virtual serial port under Linux

荒凉一梦 提交于 2019-11-29 08:07:13
I have a USB device I'm trying to communicate with over a virtual serial port provided by the ftdi_sio kernel module. However, I'm having some trouble setting the baud rate of the port to 14400: termios.h doesn't specify a constant for 14400, so I can't use cfsetispeed and cfsetospeed . In the source for the ftdi_sio kernel module, baud base is set to 24000000 and there doesn't seem to be a way to change it. This means I can't use a custom divisor with the TIOCSSERIAL ioctl and get a 14400 baud rate that way. The module source has a comment making it sound like setting the alt_speed member of

Virtual Serial Device in Python?

北慕城南 提交于 2019-11-28 16:12:32
I know that I can use e.g. pySerial to talk to serial devices, but what if I don't have a device right now but still need to write a client for it? How can I write a "virtual serial device" in Python and have pySerial talk to it, like I would, say, run a local web server? Maybe I'm just not searching well, but I've been unable to find any information on this topic. this is something I did and worked out for me so far: import os, pty, serial master, slave = pty.openpty() s_name = os.ttyname(slave) ser = serial.Serial(s_name) # To Write to the device ser.write('Your text') # To read from the

Specifying non-standard baud rate for FTDI virtual serial port under Linux

馋奶兔 提交于 2019-11-28 01:46:03
问题 I have a USB device I'm trying to communicate with over a virtual serial port provided by the ftdi_sio kernel module. However, I'm having some trouble setting the baud rate of the port to 14400: termios.h doesn't specify a constant for 14400, so I can't use cfsetispeed and cfsetospeed . In the source for the ftdi_sio kernel module, baud base is set to 24000000 and there doesn't seem to be a way to change it. This means I can't use a custom divisor with the TIOCSSERIAL ioctl and get a 14400

Virtual Serial Device in Python?

六眼飞鱼酱① 提交于 2019-11-27 09:36:35
问题 I know that I can use e.g. pySerial to talk to serial devices, but what if I don't have a device right now but still need to write a client for it? How can I write a "virtual serial device" in Python and have pySerial talk to it, like I would, say, run a local web server? Maybe I'm just not searching well, but I've been unable to find any information on this topic. 回答1: this is something I did and worked out for me so far: import os, pty, serial master, slave = pty.openpty() s_name = os

Detecting USB Insertion / Removal Events in Windows using C++

感情迁移 提交于 2019-11-27 07:27:48
I am writing an extension for an existing application that needs to handle USB insertion/removal events. I know the VID/PID of the device of interest. However, I don't have access to the window handle, so I don't know if RegisterDeviceNotification will be of much use, unless there is a way to obtain the handle via the WINAPI . What would be the best way to detect USB insertion/removal events with C++? This sample code on the Microsoft website shows how to receive event notifications via WMI: How could it be modified to receive USB insertion/removal events? Or, is there another way I should be

Faking an RS232 Serial Port

两盒软妹~` 提交于 2019-11-26 19:26:43
I'm developing a project that has a number of hardware sensors connecting to the deployment machine through RS232 serial ports. But ... I'm developing on a machine without an physical RS232 serial ports, but I would like to make fake serial ports that I can connect to and output data from with the aim of faking input from hardware sensors. Does anyone know of a way to create a fake serial port and control it on Windows XP? If you are developing for Windows, the com0com project might be, what you are looking for. It provides pairs of virtual COM ports that are linked via a nullmodem connetion.