Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PC to PC USB communication

How can I communicate between two PC's via USB? I want a program to send numbers trough the USB port to another PC on which another program would show these numbers. I have the feeling that this is impossible because PC's are meant to be hosts and not devices, but is USB truly this limited? I actually hate that USB is not like a COM port which just has an input buffer and an output buffer. You send and receive with ease. I looked at libusb and I could use it, but I can't find a way to make one PC a device. So is it even possible?

like image 450
user1214513 Avatar asked Feb 16 '12 19:02

user1214513


2 Answers

If you like serial ports so much, you should just get a USB-to-serial adapter for each computer and then wire them together. These devices create a virtual COM port on your computer and you can use it the same way you would use a normal COM port.

like image 103
David Grayson Avatar answered Nov 25 '22 15:11

David Grayson


I can't find a way to make one PC a device. So is it even possible?

No, this is not possible on a PC. USB communicates always Host->Device, and PC is always Host. You can buy a special USB2USB cable, this has a chip in the middle that communicates as device on both ends.

But I would just use a LAN cable. Every PC I know comes with Ethernet these days. TCP/IP is not too hard to use.

like image 26
Turbo J Avatar answered Nov 25 '22 17:11

Turbo J