The program can read from files, pipes, devices, sockets, and a few other items. The socat program is like a magic adapter cable that simply pipes everything from one place to another and also handles the reverse traffic. Some programs won’t even recognize your fake serial port. However, if the program you are trying to fake tries to set a baud rate, for example, it is probably going to throw up its hands. You can use a utility called socat (like cat for a socket) to set it up. That might work in some very simple cases. So, in theory, you should be able to create a network socket, connect one end to a serial port and the other end to a program, and be done with it. Worse, some programs “know” too much about files and insist on certain naming conventions. Even though a serial port is just a file under Linux, it has some special attributes that let you set, for example, baud rates. Programs didn’t care if a file was local, on the network, from a tape drive, or arriving over a named pipe.īut things started to change. Everything is a File, Until it Isn’tĪt some point in the past, Unix - the progenitor of Linux - treated virtually everything as a file, and all files were created more or less equal. It isn’t perfect, and it won’t work for every case, but when it works it works well. Sure, you can buy a terminal server that converts a serial port to an Ethernet port, but what fun is that? In this article, I’m going to show you how to stream serial ports over the network using some available Linux tools. The problem is that today, the world runs on the network. In a way, they still are since many things that appear to plug in as a USB device actually look like a serial port.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |