{"id":50719027,"url":"https://github.com/pcs-electronics/re-match","last_synced_at":"2026-06-09T22:01:08.936Z","repository":{"id":350081351,"uuid":"1205206856","full_name":"pcs-electronics/re-match","owner":"pcs-electronics","description":"RigExpert Match - an antenna analyzer you can chat with","archived":false,"fork":false,"pushed_at":"2026-04-08T19:11:31.000Z","size":160,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-08T21:12:46.417Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/pcs-electronics.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-08T18:33:51.000Z","updated_at":"2026-04-08T19:11:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pcs-electronics/re-match","commit_stats":null,"previous_names":["pcs-electronics/re-match"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pcs-electronics/re-match","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcs-electronics%2Fre-match","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcs-electronics%2Fre-match/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcs-electronics%2Fre-match/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcs-electronics%2Fre-match/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pcs-electronics","download_url":"https://codeload.github.com/pcs-electronics/re-match/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcs-electronics%2Fre-match/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34127345,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-06-09T22:01:07.916Z","updated_at":"2026-06-09T22:01:08.931Z","avatar_url":"https://github.com/pcs-electronics.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RigExpert Match CLI and TT-Plot, with AI Agent Integration\n\nVideo where RigExpert Match is controlled remotely via Telegram channel:\n\n[![RigExpert Match CLI demo](https://img.youtube.com/vi/ghPHNbW07E8/hqdefault.jpg)](https://youtube.com/shorts/ghPHNbW07E8)\n\nA set of Python scripts for controlling the RigExpert Match Antenna Analyzer and plotting Touchstone data, with AI agent integration in mind.\n\n## Scripts\n\n### 1. match-cli.py\n\nA command-line interface for controlling the RigExpert Match Antenna Analyzer.\n\n#### Features\n\n- **Read Data**: Read R and X values from the analyzer and output in Touchstone format.\n- **Status Check**: Check the connection status of the analyzer.\n- **Trace Mode**: Enable trace mode to output raw data from the analyzer for debugging.\n- **Frequency Input**: Support for frequency input in kHz or MHz with appropriate suffixes.\n- **Timestamp**: Include timestamp in the Touchstone file header.\n\n#### Installation\n\n##### Prerequisites\n\n- Python 3.x\n- `hid` library for HID device communication\n- `matplotlib` for plotting\n- `numpy` for numerical operations\n- `skrf` for Smith chart plotting\n\n##### Install Dependencies\n\n```bash\npip install hidapi matplotlib numpy scikit-rf\n```\n\n#### Usage\n\n##### Display Help\n\n```bash\npython3 match-cli.py -h\n```\n\n##### Check Status\n\n```bash\npython3 match-cli.py status\n```\n\n##### Read Data\n\n```bash\npython3 match-cli.py read --center 100MHz --range 200MHz --points 100\n```\n\nBy default, Touchstone data is written to stdout unless `--output` is provided.\n\n##### Read Data to a File\n\n```bash\npython3 match-cli.py read --center 100MHz --range 200MHz --points 100 --output data.s1p\n```\n\n##### Read Data with Trace\n\n```bash\npython3 match-cli.py read --center 100MHz --range 200MHz --points 100 --trace\n```\n\n#### Examples\n\n##### Example Output\n\n```\n! Touchstone file generated by match-cli.py on 2023-11-15 14:30:45\n# MHz Z RI R 50\n100.0 49.99 0.04\n100.0 50.03 0.07\n100.0 50.03 0.03\n...\n```\n\n##### Trace Mode Output\n\n```\nCommand sent: FQ100000000\nCommand sent: SW200000000\nCommand sent: FRX10\n! Touchstone file generated by match-cli.py on 2023-11-15 14:30:45\n# MHz Z RI R 50\nRaw data: OK\nRaw data: OK\nRaw data: 0.000000,49.99, 0.04\n100.0 49.99 0.04\nRaw data: 20.000000,50.03, 0.07\n100.0 50.03 0.07\n...\n```\n\n### 2. tt-plot.py\n\nA script for plotting Touchstone data from stdin or a file.\n\n#### Features\n\n- **Input Handling**: Parse Touchstone data from stdin or a file with `.s1p` extension.\n- **Format Detection**: Automatically detect the Touchstone format (S,RI, S,MA, S,DB, or Z,RI).\n- **Plot Generation**: Generate plots based on the specified type (SWR to 10, SWR to 2, S11, RX to 1000, RX to 100, Smith chart).\n- **Output**: Save the resulting plot to a file specified by the user.\n- **Help Display**: Display help when run without parameters or with `-h` or `--help`.\n\n#### Installation\n\n##### Prerequisites\n\n- Python 3.x\n- `matplotlib` for plotting\n- `numpy` for numerical operations\n- `skrf` for Smith chart plotting\n\n##### Install Dependencies\n\n```bash\npip install matplotlib numpy scikit-rf\n```\n\n#### Usage\n\n##### Display Help\n\n```bash\npython3 tt-plot.py -h\n```\n\n##### Plot SWR to 10\n\n```bash\npython3 tt-plot.py --type swr10 --output plot.png \u003c data.s1p\n```\n\n##### Plot Smith Chart\n\n```bash\npython3 tt-plot.py --type smith --output smith_chart.png data.s1p\n```\n\n##### Plot RX to 100\n\n```bash\npython3 tt-plot.py --type rx100 --output rx_plot.png data.s1p\n```\n\n#### Examples\n\n##### Example Output\n\n```\nPlot saved to plot.png\n```\n\n##### Example Charts\n\n###### SWR to 10\n\n\u003cimg src=\"images/example-swr10.png\" alt=\"SWR to 10\" width=\"700\"\u003e\n\n###### S11\n\n\u003cimg src=\"images/example-s11.png\" alt=\"S11\" width=\"700\"\u003e\n\n###### RX to 1000\n\n\u003cimg src=\"images/example-rx1000.png\" alt=\"RX to 1000\" width=\"700\"\u003e\n\n###### Smith Chart\n\n\u003cimg src=\"images/example-smith.png\" alt=\"Smith Chart\" width=\"700\"\u003e\n\n##### Supported Formats\n\n- **S,RI**: Real and imaginary parts of the S-parameter.\n- **S,MA**: Magnitude and angle of the S-parameter.\n- **S,DB**: Magnitude in decibels (dB) of the S-parameter.\n- **Z,RI**: Real and imaginary parts of the impedance (Z).\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\nThis code was generated with the help of an AI model, Mistral Vibe.\n\n## Testing\n\nThe scripts have been tested on Raspberry Pi 4 and with OpenClaw AI agent.\n\n## AI Agent Integration\n\nThis CLI is structured to be easy to call from an external AI agent. A typical agent flow is: detect the analyzer, run a scan with `match-cli.py read`, then hand the resulting `.s1p` data to `tt-plot.py` for visualization, and finally present the plots or computed metrics back to the user.\n\nTo integrate with an AI agent:\n- Install the Python dependencies listed above on the agent host.\n- Copy `match-cli.py` and `tt-plot.py` into the agent’s workspace/tools directory.\n- Copy the '/skills/re-match/' folder to the '/skills' folder of you AI agent. \n- Ensure the agent’s runtime has access to the USB HID device (udev rules below).\n- Call the scripts as subprocesses and pass the resulting `.s1p` data to downstream reasoning or visualization steps.\n\n## Udev Rules\n\nOn some systems (notably Volumio/RPI), `match-cli.py` can see the device only after permissions are granted on the USB device node. The rule below sets group access on the USB device so non-root users can open it.\n\n1. Create `/etc/udev/rules.d/99-rigexpert-usb.rules` with the following content:\n\n```\nSUBSYSTEM==\"usb\", DEVTYPE==\"usb_device\", ATTR{idVendor}==\"0483\", ATTR{idProduct}==\"a1de\", RUN+=\"/bin/chgrp plugdev /dev/bus/usb/%E{BUSNUM}/%E{DEVNUM}\", RUN+=\"/bin/chmod 0660 /dev/bus/usb/%E{BUSNUM}/%E{DEVNUM}\"\n```\n\n2. Ensure the group exists and add your user:\n\n```bash\nsudo groupadd -f plugdev\nsudo usermod -aG plugdev $USER\n```\n\n3. Reload the rules and replug the device:\n\n```bash\nsudo udevadm control --reload-rules\nsudo udevadm trigger --subsystem-match=usb --action=add\n```\n\n4. Re-login (or run `newgrp plugdev`) and verify:\n\n```bash\nls -l /dev/bus/usb/*/*\npython3 match-cli.py status\n```\n\nNotes:\n- If you still see `open failed`, check the permissions on `/dev/bus/usb/\u003cbus\u003e/\u003cdev\u003e` and ensure it is `root:plugdev` with `0660`.\n- A `hidraw` rule alone may not be sufficient on all distros; the USB node permissions are the reliable fix.\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request for any improvements or bug fixes.\n\n## Support\n\nFor support, please contact the project maintainers or open an issue on the project repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcs-electronics%2Fre-match","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpcs-electronics%2Fre-match","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcs-electronics%2Fre-match/lists"}