{"id":19515869,"url":"https://github.com/sciguy16/pi-cmri-proxy","last_synced_at":"2026-04-28T17:32:22.897Z","repository":{"id":89652611,"uuid":"295135516","full_name":"sciguy16/pi-cmri-proxy","owner":"sciguy16","description":"Proxy between JMRI and a serial C/MRI connection","archived":false,"fork":false,"pushed_at":"2020-09-16T19:10:40.000Z","size":13,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-05T20:03:41.355Z","etag":null,"topics":["cmri","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sciguy16.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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":"2020-09-13T11:18:44.000Z","updated_at":"2020-09-23T12:11:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"34362dd7-8660-4b6d-915a-08c3e8c85d6a","html_url":"https://github.com/sciguy16/pi-cmri-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sciguy16/pi-cmri-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciguy16%2Fpi-cmri-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciguy16%2Fpi-cmri-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciguy16%2Fpi-cmri-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciguy16%2Fpi-cmri-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sciguy16","download_url":"https://codeload.github.com/sciguy16/pi-cmri-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciguy16%2Fpi-cmri-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32392292,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: 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":["cmri","raspberry-pi"],"created_at":"2024-11-10T23:43:15.229Z","updated_at":"2026-04-28T17:32:22.882Z","avatar_url":"https://github.com/sciguy16.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pi-cmri-proxy\n\n\u003c!-- ![Build](https://github.com/sciguy16/cmri/workflows/Build/badge.svg?branch=main) --\u003e\n\n# Rewrite to use the cmri library is in progress\n\nUserland service that runs on a Raspberry Pi and acts as a proxy between JMRI on TCP and a C/MRI network running over RS485. The need for this came about because half-duplex RS485 requires a control signal to toggle the transceiver between transmit and receive mode, which was proving difficult to achieve otherwise.\n\n## Usage\nStarting the program with `cargo run --release` will start a TCP listener on localhost port 4000\n\n## Installation and removal\nThere are two handy scripts - `install.sh` and `uninstall.sh`. The installation script checks that Cargo is installed and then compiles the binary and copies it to `/usr/local/bin`. It then installs `ip_to_485` as a SystemD service to run at boot and starts it off.\n\nSimilarly, `uninstall.sh` stops and deregisters the SystemD service and removes the program from `/usr/local/bin`.\n\n## Test setup\nDuring development, a Pi 4 was connected to a MAX485 (with level shift divider on the RX side) and two arduino nano clones running a simple program based on [ArduinoCMRI](https://github.com/madleech/ArduinoCMRI) that provides a single sensor and single light.\n\nThe transceiver was wired to UART4, corresponding to GPIO pins 8 and 9, with the direction toggle connected to RTS4 on GPIO 11.\n\nThe following photos show the test setup:\n\n![Raspberry Pi 4 with MAX485 transceiver](images/pi.jpg)\n\n![Two Arduinos running as CMRI nodes](images/arduino.jpg)\n\nFinally, here is a scope trace showing an incoming CMRI packet followed by the next CMRI poll. The top trace is RS485-A and the bottom is RTS:\n\n![CMRI packets over RS485](images/scope_trace.jpg)\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0\n   ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)\n * MIT license\n   ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciguy16%2Fpi-cmri-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsciguy16%2Fpi-cmri-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciguy16%2Fpi-cmri-proxy/lists"}