{"id":28494850,"url":"https://github.com/aptpod/intdash-relay-example","last_synced_at":"2025-07-01T18:32:59.034Z","repository":{"id":296935432,"uuid":"991802887","full_name":"aptpod/intdash-relay-example","owner":"aptpod","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-03T00:00:28.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-03T12:51:45.973Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aptpod.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}},"created_at":"2025-05-28T07:09:44.000Z","updated_at":"2025-06-03T00:00:32.000Z","dependencies_parsed_at":"2025-06-08T01:34:03.726Z","dependency_job_id":null,"html_url":"https://github.com/aptpod/intdash-relay-example","commit_stats":null,"previous_names":["aptpod/intdash-relay-example"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aptpod/intdash-relay-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptpod%2Fintdash-relay-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptpod%2Fintdash-relay-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptpod%2Fintdash-relay-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptpod%2Fintdash-relay-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aptpod","download_url":"https://codeload.github.com/aptpod/intdash-relay-example/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aptpod%2Fintdash-relay-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263017649,"owners_count":23400548,"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":"2025-06-08T10:30:29.860Z","updated_at":"2025-07-01T18:32:59.023Z","avatar_url":"https://github.com/aptpod.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# intdash-relay-example\n\nintdash-relay と MQTT を使用してセンサーデータを intdash へ送信するサンプルアプリケーションです。\n\n# Installation\n\n## ローカル環境でのセットアップ\n\nローカル環境では、MQTTブローカーと `relayd` を Docker で実行します。\n\n### 前提条件\n\n* Docker Engine\n* Docker Compose\n\n### セットアップ手順\n\n1. **リポジトリをクローンします。**\n\n    ```bash\n    git clone \u003cリポジトリのURL\u003e\n    cd intdash-relay-example\n    ```\n\n1. **設定ファイルを準備します。**\n\n    `relayd.conf.sample` を `relayd.conf` にコピーし、ご自身の環境に合わせて内容を編集してください。\n    特に以下の項目を修正する必要があります。\n    * `[intdash]` セクションの `url`\n    * `[[edge_settings]]` セクションの `edge_uuid`, `edge_secret`, `project_uuid`\n\n    ここで設定する `edge_uuid` や `edge_secret` は、intdashにおける「エッジ」の情報を指します。\n    エッジとは、IoT (Internet of Things) における「モノ」に該当し、通常はデータを送信するデバイス（このサンプルではRaspberry Pi）がこれにあたります。\n    エッジの作成や管理方法の詳細については、ご契約時やトライアルの際に提供されるintdashのドキュメントを参照してください。\n\n\n    ```bash\n    cp relayd.conf.sample relayd.conf\n    # relayd.conf を編集\n    ```\n\n1. **`relayd` バイナリを配置します。**\n\n    `relayd` バイナリをプロジェクトルートディレクトリに配置してください。\n    `relayd` バイナリの入手方法については、別途お問い合わせください。\n\n1. **MQTTブローカーと relayd を起動します。**\n\n    ```bash\n    docker-compose up -d\n    ```\n\n## Raspberry Pi 環境でのセットアップ\n\nRaspberry Pi では、Sense HAT からデータを取得し MQTT で送信するスクリプトを実行します。\n\n### 前提条件\n\n* Sense HAT が動作する Raspberry Pi\n* Python\n\n### セットアップ手順\n\n1. **リポジトリをクローンします。**\n\n    ```bash\n    git clone \u003cリポジトリのURL\u003e\n    cd intdash-relay-example\n    ```\n\n1. **Python の依存関係をインストールします。**\n\n    ```bash\n    sudo apt-get update\n    sudo apt-get install sense-hat\n    sudo reboot\n\n    pip install paho-mqtt\n\n1. **`main.py` の MQTTブローカーアドレスを編集します。**\n\n    Raspberry Pi からデータを送信する先の MQTTブローカーのアドレスを `main.py` 内の `MQTT_BROKER` 定数に設定します。\n    ローカル環境の Docker で MQTT ブローカーを起動している場合は、Raspberry Pi からアクセス可能なローカルネットワーク上のPCのIPアドレスなどに変更してください。\n\n    例: `MQTT_BROKER = '192.168.1.10'`\n\n# Usage\n\n1. **ローカル環境で MQTTブローカーと `relayd` が起動していることを確認します。**\n\n1. **Raspberry Pi 上でセンサーデータ送信スクリプトを実行します。**\n    Raspberry Pi 上でターミナルを開き、クローンしたリポジトリのディレクトリに移動して、以下のコマンドを実行して `main.py` を起動します。\n\n    ```bash\n    python main.py\n    ```\n\n    スクリプトは Sense HAT から加速度データを取得し、ローカル環境で動作している MQTTブローカーに送信します。\n    ローカル環境の `relayd` は MQTTブローカーからデータを受信し、intdash へ転送します。\n\n1. **動作確認**\n    * Raspberry Pi の `main.py` のコンソールに、エラーなくデータ送信が継続されることを確認します。\n    * intdashの可視化ツールVM2MやEdge Finderなどで、データが正常に受信されていることを確認します。\n\n# Build\n\n`relay` サービスの Docker イメージは、以下のコマンドでビルドできます。\n(通常は `docker-compose up` 時に自動的にビルドされます。)\n\n```bash\ndocker-compose build relay\n```\n\n# More Info\n\n* **intdash:** [https://www.aptpod.co.jp/products/software/intdash/](https://www.aptpod.co.jp/products/software/intdash/)\n* **Paho MQTT Python Client:** [https://pypi.org/project/paho-mqtt/](https://pypi.org/project/paho-mqtt/)\n* **Sense HAT:** [https://www.raspberrypi.com/products/sense-hat/](https://www.raspberrypi.com/products/sense-hat/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faptpod%2Fintdash-relay-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faptpod%2Fintdash-relay-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faptpod%2Fintdash-relay-example/lists"}