{"id":20226664,"url":"https://github.com/rajkumargara/remote-serial-pico","last_synced_at":"2026-03-09T02:32:29.318Z","repository":{"id":217571672,"uuid":"744251844","full_name":"RajkumarGara/remote-serial-pico","owner":"RajkumarGara","description":"Access remote serial devices connected to Pico with Pi","archived":false,"fork":false,"pushed_at":"2025-07-23T21:40:19.000Z","size":42596,"stargazers_count":1,"open_issues_count":8,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-12T15:56:41.830Z","etag":null,"topics":["lmdi-100","mechonet","pico-w","raspberry-pi","remote-serial","serial","tcp","uart"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/RajkumarGara.png","metadata":{"files":{"readme":"README.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-16T23:10:03.000Z","updated_at":"2025-08-20T11:31:08.000Z","dependencies_parsed_at":"2024-09-06T21:46:18.547Z","dependency_job_id":"110750d4-72d2-4426-8776-47cd27e74d13","html_url":"https://github.com/RajkumarGara/remote-serial-pico","commit_stats":null,"previous_names":["rajkumargara/light_control_nodered","rajkumargara/picow-tcp-uart-bridge","rajkumargara/pico-network-serial-port","rajkumargara/remoteserialpico","rajkumargara/remote-serial-pico"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RajkumarGara/remote-serial-pico","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RajkumarGara%2Fremote-serial-pico","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RajkumarGara%2Fremote-serial-pico/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RajkumarGara%2Fremote-serial-pico/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RajkumarGara%2Fremote-serial-pico/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RajkumarGara","download_url":"https://codeload.github.com/RajkumarGara/remote-serial-pico/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RajkumarGara%2Fremote-serial-pico/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30280862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:23:26.802Z","status":"ssl_error","status_checked_at":"2026-03-09T02:22:46.175Z","response_time":61,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["lmdi-100","mechonet","pico-w","raspberry-pi","remote-serial","serial","tcp","uart"],"created_at":"2024-11-14T07:19:35.326Z","updated_at":"2026-03-09T02:32:29.297Z","avatar_url":"https://github.com/RajkumarGara.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\nEver need a serial port far away from your Raspberry Pi? Wish you could use WiFi to talk to a serial device without having to run a wire? This project is for you.\n\n## Installation\n\u003ca href=\"https://www.youtube.com/shorts/CbkAj24SPnE\" target=\"_blank\"\u003e\n    \u003cimg src=\"./img/3.jpg\" alt=\"Pico-Pi connection\" style=\"width:40%; height:50%;\" align=\"right\"/\u003e\n\u003c/a\u003e\n\n```\nsudo npm i -g remote-serial-pico\nremote-serial-pico i\n```\n\nNow a server is running on the Pi. If you plug in a Pico to the USB it will install the client code on the pico within 6 sec and make it a remote serial port.\n\n`/dev/pts/pty1`\n\nIt's that easy to setup a remote serial port. Each time you plug in a pico, it will be the next `ptyN` on the list.\n\nIf you haven't already installed npm:\n```\nsudo apt update\nsudo apt install nodejs npm\n```\n\n### Background\nDesigned to facilitate communication between a remote device (such as a Raspberry Pi) and a device connected via serial to the Pico. It leverages TCP/IP networking to bridge data exchange between the Pico's serial interface and a networked environment. Extend this project using either the [`node-red-bridge`](https://github.com/RajkumarGara/node-red-bridge) or [`homebridge-tcp-smarthome`](https://github.com/RajkumarGara/homebridge-tcp-smarthome).\n\n### Pico on-board LED status\n* LED blinks repeatedly during the WiFi connection process. Upon successful connection it turns off.\n* LED switches on again when connected to the TCP server.\n* LED blinks once upon receiving a command either from TCP server or a serially connected device.\n* LED turns off when disconnected from the TCP server.\n\n## Project Details\n* **Curious about PtyServer?**\n    * Detects Pico clients upon receiving first packet with `pico_{N}`, and creates a pseudo terminal(pty) for each Pico.\n    * Sends data available in pty to the respective Pico.\n    * Writes data received from Pico into corresponding pty.\n    * Log the commands and responses for each pico; check out the log:\n        ```\n        tail -f /tmp/smartHome.log\n        ```\n\n* **Wondering how plugging Pico into the Pi installs client code in Pico?**\n    * The udev rule ([99-pico.rules](./src/99-pico.rules)) watches Pi's USB port for Pico connection.\n    * When a Pico is connected, it triggers another script [PicoScriptDeployer.py](./src/pi/PicoScriptDeployer.py) to run on Pi.\n\n* **And what exactly does PicoScriptDeployer do?**\n    * It fetches `wifi-ssid, password, IP, Pico-Serial-ID` and updates the corresponding credentials on [config.json](./src/pico/config.json). You can also manually update it.\n    * Deploys [`main.py`](./src/pico/main.py) and [`config.json`](./src/pico/config.json) to the most recently connected pico.\n    * You can observe the deployer log:\n        ```\n        tail -f /tmp/deployer.log\n        ``` \n\n* **Now, what's the role of the main code in Pico?**\n    * Retrieves the network credentials and server details from the `config.json`.\n    * Upon TCP connection, sends its `Serial-ID` to the Pi in the first packet.\n    * Continuously checks for data in TCP and Serial; if it receives data from either, it sends that data to the other.\n    * Sends a heartbeat signal (`PING`) to the server every 10 seconds to ensure the connection is alive; expects a `PONG` response from the server.\n\n## Managing the PtyServer Service\n\nIf you need to restart the PtyServer service (for example, after updating code or configuration), use:\n\n```\nsudo systemctl restart ptyserver.service\n```\n\nTo view the live log output for the service:\n\n```\nsudo journalctl -u ptyserver.service -f\n```\n\n## Visual Overview\n* Checkout the serial diagram: ![block diagram](img/2.jpg)  \n* Checkout the network diagram: [SRC](https://docs.google.com/drawings/d/1oIbP6EGNI4thhi0qzVgtGZw0lyD-F9gRc0-1tAc7O_Q/edit)\n    ![drawing alt text](https://docs.google.com/drawings/d/1oIbP6EGNI4thhi0qzVgtGZw0lyD-F9gRc0-1tAc7O_Q/export/png)\n\n    [![Watch the video](img/4.GIF)](https://youtu.be/M36LoMouvPg)\n\n## Credits\nSpecial thanks to [Medical Informatics Engineering](https://www.mieweb.com/) for their support throughout the development of this project, especially to [Doug Horner](https://github.com/horner) for his invaluable guidance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajkumargara%2Fremote-serial-pico","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frajkumargara%2Fremote-serial-pico","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frajkumargara%2Fremote-serial-pico/lists"}