{"id":15293375,"url":"https://github.com/kiblitz/wifi-comms-handler","last_synced_at":"2026-04-29T08:06:05.666Z","repository":{"id":120630478,"uuid":"294187115","full_name":"kiblitz/wifi-comms-handler","owner":"kiblitz","description":"map messages sent over LAN to terminal commands on host","archived":false,"fork":false,"pushed_at":"2022-12-18T00:50:57.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T15:09:16.360Z","etag":null,"topics":["cli","exec","golang","json","lan","server","tcp"],"latest_commit_sha":null,"homepage":"","language":"Go","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/kiblitz.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}},"created_at":"2020-09-09T17:49:07.000Z","updated_at":"2022-12-18T00:45:12.000Z","dependencies_parsed_at":"2024-04-06T06:03:26.385Z","dependency_job_id":"7e411dcb-6d99-47e4-aa3e-326abf66d32b","html_url":"https://github.com/kiblitz/wifi-comms-handler","commit_stats":null,"previous_names":["thisistrivial/wifi-comms-handler"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kiblitz/wifi-comms-handler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiblitz%2Fwifi-comms-handler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiblitz%2Fwifi-comms-handler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiblitz%2Fwifi-comms-handler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiblitz%2Fwifi-comms-handler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiblitz","download_url":"https://codeload.github.com/kiblitz/wifi-comms-handler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiblitz%2Fwifi-comms-handler/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32416162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"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":["cli","exec","golang","json","lan","server","tcp"],"created_at":"2024-09-30T16:47:12.218Z","updated_at":"2026-04-29T08:06:05.648Z","avatar_url":"https://github.com/kiblitz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wifi-comms-handler\n## About\nHandler for commands sent over LAN via TCP\n\n## Use\n- Clone the repo\n- Edit `src/comms/comms.json` to include an array of json objects with attributes `in` (wifi command) and `out` (local command)\n- Run the program and specify the PORT\n```\ngo run src/handler.go PORT\n```\n### Server commands\n- `quit` - exit the program\n\n## Examples\n### Scanner\n#### json\n```\n[\n  {\n    \"in\": \"scan\",\n    \"out\": \"/home/gelos/.scripts/scanner.sh %s\"\n  }\n]\n```\n\n`scan` command maps to running a bash script `scanner.sh` carrying over 1 string arg `%s`\n\n#### bash script\n```\n#!/bin/bash\n\nif [ \"$#\" -eq 1 ]\nthen\n  scanimage --device escl:http://10.0.0.249:80 --format=png \u003e ~/Downloads/$1.png\nelse\n  echo \"wrong number of arguments supplied\"\nfi\n```\n\nbash script runs scanner and outputs to file in `~/Documents` with arg name\n\n#### client source\n```\nimport socket\nimport sys\n# Create a TCP/IP socket\nsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n\nserver_address = ('localhost', 2222)\nprint(sys.stderr, 'connecting to %s port %s' % server_address)\nsocket.connect(server_address)\n\nsocket.sendall(b'scan output-file\\n')\n\nwhile True:\n  print(sock.recv(128))\n```\n\nclient source code run after server start with name `output-file` (line 11)\n\n#### results\n```\n$ go run handler.go 2222\ncreating connection with  [127.0.0.1:54468]\n[127.0.0.1:54468] /home/gelos/.scripts/scanner.sh [output-file]\n```\n```\n$ ls | grep output-file\noutput-file.png\n```\n\nscanned image saved to `~/Downloads` folder\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiblitz%2Fwifi-comms-handler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiblitz%2Fwifi-comms-handler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiblitz%2Fwifi-comms-handler/lists"}