{"id":14978198,"url":"https://github.com/teddy1565/remote-serialport-server","last_synced_at":"2025-11-29T16:03:05.285Z","repository":{"id":229329687,"uuid":"776454294","full_name":"teddy1565/remote-serialport-server","owner":"teddy1565","description":"A small and simple remote-serialport repo","archived":false,"fork":false,"pushed_at":"2024-04-08T01:22:47.000Z","size":120,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-14T10:06:00.018Z","etag":null,"topics":["buffer","modbus","serialport","socket-io"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teddy1565.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-03-23T14:57:20.000Z","updated_at":"2024-04-06T18:59:30.000Z","dependencies_parsed_at":"2024-03-23T16:26:23.810Z","dependency_job_id":"1df9eb95-2f37-468d-935a-9f9199d0764d","html_url":"https://github.com/teddy1565/remote-serialport-server","commit_stats":{"total_commits":53,"total_committers":3,"mean_commits":"17.666666666666668","dds":"0.037735849056603765","last_synced_commit":"a2db0d6311184d79fb9f77794addbf55368631c0"},"previous_names":["teddy1565/remote-serialport-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teddy1565%2Fremote-serialport-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teddy1565%2Fremote-serialport-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teddy1565%2Fremote-serialport-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teddy1565%2Fremote-serialport-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teddy1565","download_url":"https://codeload.github.com/teddy1565/remote-serialport-server/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241605738,"owners_count":19989608,"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":["buffer","modbus","serialport","socket-io"],"created_at":"2024-09-24T13:57:02.364Z","updated_at":"2025-11-29T16:03:05.219Z","avatar_url":"https://github.com/teddy1565.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Remote-Serialport\n\n## Intro\n\nThis is a repository for remote proxying of serial ports.\n\nIt is a simple server-client architecture where the server is connected to the serial port and the client connects to the server to read and write to the serial port.\n\nAnd then, when the client connects to the server, the server will create a virtual serial port on the client side, and the client can read and write to the virtual serial port.\n\nthe operation will sync to the server and the server will read and write to the physical serial port.\n\nThis Project is divided into two parts:\n\n1. [Remote-Serialport-Server](https://www.npmjs.com/package/node-serialport-server)\n   - Control Host Physical Serial Port, and virtualize it to the network or IPC.\n     - Milestone\n       - [ ] Web Socket\n       - [ ] Nodejs IPC\n       - [ ] Electron utility IPC\n2. [Remote-Serialport-Client](https://www.npmjs.com/package/node-serialport-client)\n   - Connect to the server and read and write to the serial port.\n     - Milestone\n       - [ ] Web Socket\n       - [ ] Nodejs IPC\n       - [ ] Electron utility IPC\n\n### Why Remote-Serialport\n\nYou can also make one yourself\nBut some people have done it, why not just use the kit?\n\n### A little bit of history\n\nIn the future, maybe we will merge client and server repo into one repo.\n\n## Features\n\n- [ ] Remote Serial Port Protocol ▶\n  - [x] Web Socket  ▶\n    - [x] Connect To Socket Server\n    - [x] Socket NameSpace Parser for Serial Port\n  - [ ] Inter Process Communication (In planning)\n- [x] Read from serial port ▶\n- [ ] Write to serial port\n  - [ ] Web Socket\n    - [ ] Write to Serial Port\n  - [ ] Inter Process Communication\n    - [ ] Write to Serial Port\n- [ ] Others\n  - [ ] Security\n    - [ ] Web Socket Security\n      - [ ] Connect to server with authentication\n      - [ ] Connect to server with encryption\n    - [ ] Inter Process Communication Security\n      - [ ] Message Encryption\n      - [ ] Memory Protection\n      - [ ] Message Authentication\n    - [ ] Architecture\n      - [ ] Copy-On-Write Architecture\n      - [ ] Multi-Access Architecture\n  \n## Usage\n\n### Server\n\n```javascript\n\nconst { RemoteSerialportServer } = require(\"node-serialport-server\");\n\nconst server_options = {\n    cors: {\n        allowedHeaders: [\"*\"],\n        origin: \"*\",\n        methods: [\"GET\", \"POST\", \"PUT\", \"DELETE\"]\n    }\n};\n\nconst server = new RemoteSerialportServer(server_options, 17991);\nserver.listen();\n\nserver.of().on(\"connection\", (socket) =\u003e {\n    socket.port.on(\"data\", (data) =\u003e {\n        // You can transfer before sending the data\n        socket.emit(\"serialport_packet\", data); // Send the data to the client\n    });\n});\n\n\n```\n\n---\n\n### Client\n\n#### Usual Usage\n\n```javascript\nconst { RemoteSerialportClient } = require(\"node-serialport-client\");\nconst { ByteLengthParser } = require(\"serialport\");\n\nconst RSC = new RemoteSerialportClient(\"ws://localhost:17991\"); // Initialize the client with the server address\n\n// In windows\nconst client = RSC.connect(\"/COM5\", { baudRate: 115200 }); // Connect to the server and get the port\n\n// In linux\nconst client_linux = RSC.connect(\"/dev/ttyUSB0\", { baudRate: 115200 }); // Connect to the server and get the port\n\n// Mapping remote port COM5 to local port COM17\nconst serialport = client.create_port(\"COM17\").get_port({\n    baudRate: 115200,\n    autoOpen: true\n});\n\nconst parser = serialport.pipe(new ByteLengthParser({ length: 30 }));\n\nparser.on(\"data\", (data) =\u003e {\n    console.log(data);\n});\n```\n\n#### With Modbus-Serial\n\n```javascript\nconst { RemoteSerialportClient } = require(\"node-serialport-client\");;\nconst ModbusRTU = require(\"modbus-serial\");\n\nconst RSC = new RemoteSerialportClient(\"ws://localhost:17991\"); // Initialize the client with the server address\n\n// In windows\nconst client = RSC.connect(\"/COM5\", { baudRate: 115200 }); // Connect to the server and get the port\n\n// In linux\nconst client_linux = RSC.connect(\"/dev/ttyUSB0\", { baudRate: 115200 }); // Connect to the server and get the port\n\n// Mapping remote port COM5 to local port COM17\nconst port = client.create_port(\"COM17\");\n\n// There has two ways to create a modbus client\n\n// first way\n// create an empty modbus client\nconst client = new ModbusRTU();\n// open connection to a serial port\nclient.connectRTUBuffered(\"/dev/ttyUSB0\", { baudRate: 9600 });\n\n\n// or you can use the second way\n\n// the second way\nconst client = new ModbusMaster(port.get_port({ baudRate: 9600 }));\n\nclient.setID(1)\nclient.readHoldingRegisters(3, 2).then((data) =\u003e {\n    console.log(data)\n}).catch((error) =\u003e {\n    console.log(error)\n})\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteddy1565%2Fremote-serialport-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteddy1565%2Fremote-serialport-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteddy1565%2Fremote-serialport-server/lists"}