{"id":16884770,"url":"https://github.com/bradfitz/remserial-mirror","last_synced_at":"2025-10-29T18:04:12.716Z","repository":{"id":66404500,"uuid":"144911036","full_name":"bradfitz/remserial-mirror","owner":"bradfitz","description":"git mirror of remserial","archived":false,"fork":false,"pushed_at":"2018-08-15T22:57:53.000Z","size":8,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-25T08:51:17.345Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://lpccomp.bc.ca/remserial/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bradfitz.png","metadata":{"files":{"readme":"README.txt","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-15T22:53:50.000Z","updated_at":"2022-05-13T15:29:35.000Z","dependencies_parsed_at":"2023-04-03T21:33:44.806Z","dependency_job_id":null,"html_url":"https://github.com/bradfitz/remserial-mirror","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradfitz%2Fremserial-mirror","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradfitz%2Fremserial-mirror/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradfitz%2Fremserial-mirror/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradfitz%2Fremserial-mirror/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradfitz","download_url":"https://codeload.github.com/bradfitz/remserial-mirror/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248402259,"owners_count":21097328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T16:30:33.594Z","updated_at":"2025-10-29T18:04:07.692Z","avatar_url":"https://github.com/bradfitz.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Remserial\r\n---------\r\n\r\nThe remserial program acts as a communications bridge between a TCP/IP\r\nnetwork port and a Linux device such as a serial port.  Any character-oriented\r\nLinux /dev device will work.\r\n\r\nThe program can also use pseudo-ttys as the device.  A pseudo-tty is like\r\na serial port in that it has a /dev entry that can be opened by a program\r\nthat expects a serial port device, except that instead of belonging to\r\na physical serial device, the data can be intercepted by another program.\r\nThe remserial program uses this to connect a network port to the\r\n\"master\" (programming) side of the pseudo-tty allowing the device driver\r\n(slave) side to be used by some program expecting a serial port.  See example\r\n3 below for details.\r\n\r\nThe program can operate as a server accepting network connections from\r\nother machines, or as a client, connecting to remote machine that\r\nis running the remserial program or some other program that accepts\r\na raw network connection.  The network connection passes data as-is,\r\nthere is no control protocol over the network socket.\r\n\r\nMultiple copies of the program can run on the same computer at the same\r\ntime assuming each is using a different network port and device.\r\n\r\nSome examples:\r\n\r\n1) Give access to a RS232 device over a network.\r\n\r\nThe computer with the serial port connected to the device (such as a\r\ndata aquisition device) runs the remserial program:\r\n\r\n\tremserial -d -p 23000 -s \"9600 raw\" /dev/ttyS0 \u0026\r\n\r\nThis starts the program in daemon mode so that it runs in the background,\r\nit waits for connections on port 23000 and sets up the serial port\r\n/dev/ttyS0 at 9600 baud.  Network connections to port 23000 from any\r\nmachine can then read and write to the device attached to the serial port.\r\n\r\nThis can be started from /etc/rc.local or as an entry in /etc/inittab\r\nor set up as a system service with a file in /etc/rc.init/.\r\n\r\n2) Connect an RS232 device to a specified server.\r\n\r\nThe computer with the serial port connected to the device (such as a\r\ndata aquisition device) runs the remserial program:\r\n\r\n\tremserial -d -r server-name -p 23000 -s \"9600 raw\" /dev/ttyS0 \u0026\r\n\r\nThis would be used with case number 1 above creating an end-to-end serial\r\nport connection.  What goes in the serial port on one machine would come\r\nout the serial port of the other machine.  The ports could be running at\r\ndifferent baud rates or other serial port settings.\r\n\r\n3) Connect a Linux program that needs a serial port to a remote serial port.\r\n\r\nSome programs are written to communicate directly with a serial port such\r\nas some data aquisition programs.  The remserial program can use\r\npseudo-ttys to fool the program into thinking that it is talking to a\r\nreal serial port on the local machine:\r\n\r\n\tremserial -d -r server-name -p 23000 -l /dev/remserial1 /dev/ptmx \u0026\r\n\r\nThis creates a file called /dev/remserial1 which can be used by the\r\ndata aquisition application as its serial port.  Any data sent or received\r\nis passed to the remote server-name on port 23000 where a computer configured\r\nin case number 1 above passes it to a real serial port.\r\n\r\nThe remserial program uses the special pseudo-tty master device /dev/ptmx\r\n(see man ptmx) which creates a slave device that looks like a normal\r\nserial port named /dev/pts/something.  Unfortunately, the actual device\r\nname created isn't consistent, so the remserial program creates a symbol\r\nlink from the device name specified with the -l option to the /dev/pts/\r\nname that was created allowing the other application to be configured\r\nwith a consistent device name.\r\n\r\n4) Server farm console control.\r\n\r\nAssuming multiple Linux servers (such as web servers) are set up to have a\r\nserial port as their console instead of a monitor/keyboard, their serial\r\nports could be connected to a control server using a multi-port serial board.\r\nOn the control server, a copy of remserial is run for each server:\r\n\r\n\tremserial -d -p 23000 -s \"115200 raw\" /dev/ttyS0 \u0026\r\n\tremserial -d -p 23001 -s \"115200 raw\" /dev/ttyS1 \u0026\r\n\tremserial -d -p 23002 -s \"115200 raw\" /dev/ttyS2 \u0026\r\n\tremserial -d -p 23003 -s \"115200 raw\" /dev/ttyS3 \u0026\r\n\tetc.\r\n\r\nFrom any computer on the local network, use a telnet program to connect\r\nto the control server on the appropriate port:\r\n\r\n\ttelnet control-server-name 23002\r\n\r\nThis would connect through the associated serial port to the desired server's\r\nconsole.  This example would then give the user console access to the 3rd\r\nserver.\r\n\r\nCareful scripting such as using the Linux \"expect\" program could allow\r\nbatches of commands to be run on each server.\r\n\r\nOther Linux program useful with remserial\r\n-----------------------------------------\r\n\r\n- nc - The netcat program is similar to remserial except that it creates\r\n  connections between network ports and command line standard input and\r\n  output.\r\n\r\n  For example, with case number 1 above, the following command run on\r\n  another computer will send the contents of the named file out the\r\n  serial port used by the remserial program:\r\n\r\n  nc server-name 23000 \u003cfile-name\r\n\r\n  Similarily, the following command will store incoming serial data in a file\r\n  until the program is manually interrupted:\r\n\r\n  nc server-name 23000 \u003efile-name\r\n\r\n- telnet - The telnet program is normally used to log into a remote computer,\r\n  but when used with network ports other than number 23, it operates in a\r\n  raw data mode.\r\n\r\n  For example, with case number 1 above, the following command will allow\r\n  the user of the telnet program to see incoming serial port data and\r\n  type data on the keyboard to send to the serial port:\r\n\r\n  telnet server-name 23000\r\n\r\n  This is ideal for controlling the device connected to the serial port \r\n  if it has some sort of command line interface usable over the serial port.\r\n\r\n\r\nremserial Usage:\r\n---------------\r\n\r\nremserial [-r machinename] [-p netport] [-s \"stty params\"] device\r\n\r\n-r machinename\t\tThe remote machine name to connect to.  If not\r\n\t\t\tspecified, then this is the server side.\r\n-p netport\t\tSpecifiy IP port# (default 23000)\r\n-s \"stty params\"\tIf serial port, specify stty parameters, see man stty\r\n-d\t\t\tRun as daemon programs\r\n-x debuglevel\t\tSet debug level, 0 is default, 1,2 give more info\r\n-l linkname\t\tIf the device is /dev/ptmx, creates a symbolic link\r\n                        to the corresponding slave pseudo-tty so that another\r\n\t\t\tapplication has a static device name to use.\r\n-m max-connections\tMaximum number of simultaneous client connections to allow\r\ndevice\t\t\tCharacter oriented device node such as /dev/ttyS0.\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradfitz%2Fremserial-mirror","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradfitz%2Fremserial-mirror","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradfitz%2Fremserial-mirror/lists"}