{"id":18950837,"url":"https://github.com/whywaita/iothub","last_synced_at":"2025-10-07T11:03:48.153Z","repository":{"id":74409347,"uuid":"142748672","full_name":"whywaita/iothub","owner":"whywaita","description":"Azure iothub SDK for golang plus CLI tools","archived":false,"fork":false,"pushed_at":"2018-08-01T17:23:48.000Z","size":470,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-07T11:03:44.676Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"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/whywaita.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":"2018-07-29T09:44:24.000Z","updated_at":"2018-09-10T14:26:20.000Z","dependencies_parsed_at":"2023-06-15T07:45:32.854Z","dependency_job_id":null,"html_url":"https://github.com/whywaita/iothub","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/whywaita/iothub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fiothub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fiothub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fiothub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fiothub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whywaita","download_url":"https://codeload.github.com/whywaita/iothub/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whywaita%2Fiothub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278762930,"owners_count":26041447,"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","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"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":"2024-11-08T13:24:51.374Z","updated_at":"2025-10-07T11:03:48.121Z","avatar_url":"https://github.com/whywaita.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iothub\n\nThis repository provides Azure IoT Hub SDK for golang and command line tools for device-to-cloud (`iotdevice`) and cloud-to-device (`iotservice`) functionality.\n\nThis project in the active development state and if you decided to use it anyway, please vendor the source code.\n\nOnly MQTT is available for device-to-cloud communication for because it has many advantages over AMQP and REST: it's stable, widespread, compact and provide many out-of-box features like auto-reconnects.\n\nSee [TODO](https://github.com/goautomotive/iothub#todo) list to learn what is missing.\n\n## Examples\n\nSend a message from an IoT device:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/goautomotive/iothub/iotdevice\"\n\t\"github.com/goautomotive/iothub/iotdevice/transport/mqtt\"\n)\n\nfunc main() {\n\tc, err := iotdevice.NewClient(\n\t\tiotdevice.WithTransport(mqtt.New()),\n\t\tiotdevice.WithConnectionString(os.Getenv(\"DEVICE_CONNECTION_STRING\")),\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// connect to the iothub\n\tif err = c.Connect(context.Background()); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// send a device-to-cloud message\n\tif err = c.SendEvent(context.Background(), []byte(`hello`),\n\t\tiotdevice.WithSendProperty(\"foo\", \"bar\"),\n\t); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\nReceive and print messages from IoT devices in a backend application:\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/goautomotive/iothub/common\"\n\t\"github.com/goautomotive/iothub/iotservice\"\n)\n\nfunc main() {\n\tc, err := iotservice.NewClient(\n\t\tiotservice.WithConnectionString(os.Getenv(\"SERVICE_CONNECTION_STRING\")),\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Fatal(c.SubscribeEvents(context.Background(), func(msg *common.Message) {\n\t\tfmt.Printf(\"%q sends %q\", msg.ConnectionDeviceID, msg.Payload)\n\t}))\n}\n```\n\n## CLI\n\nThe project provides two command line utilities: `iothub-device` and `iothub-sevice`. First is for using it on IoT devices and the second manages and interacts with them. \n\nYou can perform operations like publishing, subscribing to events and feedback, registering and invoking direct method, etc. straight from the command line.\n\n`iothub-service` is a [iothub-explorer](https://github.com/Azure/iothub-explorer) replacement that can be distributed as a single binary opposed to typical nodejs app.\n\nSee `-help` for more details.\n\n## Testing\n\nTo enable end-to-end testing in the `tests` directory you need to provide `TEST_SERVICE_CONNECTION_STRING` which is a shared access policy connection string.\n\n## TODO\n\n1. Stabilize API.\n1. HTTP transport (files uploading).\n1. AMQP transport (batch sending, WS).\n1. Grammar check plus better documentation.\n1. Rework debugging logs.\n1. Rework Subscribe* functions.\n\n## Contributing\n\nAll contributions are welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhywaita%2Fiothub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhywaita%2Fiothub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhywaita%2Fiothub/lists"}