{"id":23359819,"url":"https://github.com/firehed/esp8266-ghsw8181","last_synced_at":"2025-04-07T20:46:20.911Z","repository":{"id":138434951,"uuid":"115882217","full_name":"Firehed/ESP8266-GHSW8181","owner":"Firehed","description":"Control an IOGEAR GHSW8148/GHSW8181 over wifi with an ESP8266","archived":false,"fork":false,"pushed_at":"2018-01-07T02:34:01.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-13T22:27:02.136Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Arduino","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/Firehed.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":"2017-12-31T19:42:24.000Z","updated_at":"2021-11-16T02:17:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"aac04883-483e-44b8-8418-4e6735a42df4","html_url":"https://github.com/Firehed/ESP8266-GHSW8181","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2FESP8266-GHSW8181","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2FESP8266-GHSW8181/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2FESP8266-GHSW8181/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2FESP8266-GHSW8181/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Firehed","download_url":"https://codeload.github.com/Firehed/ESP8266-GHSW8181/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247729476,"owners_count":20986392,"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":[],"created_at":"2024-12-21T11:12:04.021Z","updated_at":"2025-04-07T20:46:20.712Z","avatar_url":"https://github.com/Firehed.png","language":"Arduino","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP8266-GHSW8181\nControl an IOGEAR GHSW8141/GHSW8181 over wifi with an ESP8266\n\n## Goals\n\nExpose basic RS-232 control commands for the above HDMI switches over HTTP, with the intent to finagle this into a Homekit device.\nThe latter will likely be done begrudingly via Homebridge and 8 switch-type accessories (probably lumped into a Platform).\n\n## Configuration\n\n* Copy `wifi.example.h` to `wifi.h`\n* Fill in the values to connect to your wifi network\n\n## Usage\n\n### `GET /`\n\nParameters: none\n\nResponse: `text/plain`\n\nExample:\n\n`curl ghsw8181.local`\n\n```\nread Command OK\nInput: port4\nOutput: ON\nMode: Next\nGoto: OFF\nF/W: V1.0.067\n```\n\nEmits the raw HDMI switch output from a `read` command.\n\n### `POST /select`\n\nParameters:\n\n* `port`: int (1-8)\n\nResponse: `text/plain`\n\nExample:\n\n`curl -d port=2 ghsw8181.local/select`\n\n```\nsw i02 Command OK\n```\n\nEmits the raw switch output from a `sw i0X` command.\n\n## Wiring\n\nThis was built and tested using an ESP-12e dev board and a [MAX3232 UART-to-RS232 adapter](https://www.amazon.com/gp/product/B00OPU2QJ4).\nThis adapter (or an equivalent) is NOT OPTIONAL, much to my dismay.\nConnect as follows:\n\n| Adapter | ESP8266 |\n|---------|---------|\n| GND     | G       |\n| OUT     | RX      |\n| IN      | TX      |\n| VCC     | 3v      |\n\nNote that OUT refers to the arrow pointing *away* from the chip, and IN refers to the arrow pointing *towards* it.\nThe four bottom-most pins on the right side (top view) on the dev board should be the ones you want.\n\nWhen using a USB-to-serial adapter to debug this, I needed to use a null modem cable (technically, some very shaky jumper wires).\nThis was not required when actually plugged into the HDMI switch.\n\n## Notes\nIn the Arduino IDE, I have selected a NodeMCU ESP-12e board, 115200 baud connection.\nIt would always error out during uploading unless the wiring was disconnected.\nNo idea if that's normal or something specific to serial output, but disconnecting the wires fixed it.\nPressing the flash button before/during programming was not necessary with the wiring disconnected, and only worked about 2% of the time with it connected.\nFollow [this guide](https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide) to set up Arduino IDE to speak to the ESP8266 boards (but select NodeMCU instead of the Adafruit board).\n\n\nUpon setup, it will attempt to broadcast itself at `ghsw8181.local`.\nDepending on your network and DNS configuration, this may not resolve.\nTo find the device's IP, the easiest approach is to probably just check your router's DHCP leases.\nIt should print to the serial console as well, but that will be inaccessible when connected to the switch (so make note of it when programming via the Arduino IDE).\n\nThere is a lot of room for improvement, which is welcome.\n\nThere is ABSOLUTELY NO SECURITY here - any plaintext HTTP client that can talk to this can change your inputs or read the current settings.\nOnly basic validation to ensure you can't run arbitrary serial commands exists.\nSo generally speaking, make sure this isn't exposed to the internet directly unless you want strangers changing your HDMI switch's input.\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirehed%2Fesp8266-ghsw8181","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirehed%2Fesp8266-ghsw8181","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirehed%2Fesp8266-ghsw8181/lists"}