MENU
    エッジデバイスMQTTブローカーの有効化とセットアップ方法
    • 23 Jan 2025
    • 1 読む分
    • 寄稿者

    エッジデバイスMQTTブローカーの有効化とセットアップ方法


    記事の要約

    目的

    Tulip Edge Deviceで外部MQTTブローカーをセットアップする方法について説明します。

    OS 50.1以降、Tulip Edgeデバイスには、クライアントデバイスが接続できる外部MQTTブローカーがあります。

    手順

    1. エッジデバイスポータルにログインします。
    2. ネットワーク設定」セクションの下部で、「MQTTブローカー」オプションを選択します。

    {height="" width=""} をクリックします。

    1. Enable(有効化)」をクリックし、任意のユーザー名とパスワードを入力して「Save(保存)」をクリックします。

    {height="" width="350"} MQTTブローカーを使用する。

    Node-REDでMQTTブローカーを使用する

    ブローカーが利用可能であることを確認するために、Node-RED MQTT IN ノードを使用することができる。

    1. Node-RED がオフになっている場合は、オンにして Node-RED エディタにログインします。
    2. フローにMQTTノードを追加し、ノードを編集します。

    {高さ="" 幅="350"}。

    1. 鉛筆ボタンをクリックしてブローカー設定を開き、"Server "をlocalhostに設定します。

    {サーバー(Server) "をlocalhostに設定します。

    1. Security "タブをクリックし、ブローカー用に設定したユーザー名とパスワードを入力します。

    {height="" width="400"} "更新 "をクリックして設定を保存します。

    1. Update "をクリックして設定を保存する。
    2. Deploy "をクリックし、ノードがブローカーに接続できるか確認します。

    {高さ="" 幅="250"}。

    ノードREDフローの例

    以下の例はJSONファイルとして保存し、Node-REDにインポートして "hello "トピックに "world "メッセージを送信することができます。

    {高さ="" 幅="450"}。

    {
    "id":"c8829f45.d66fd",
    "type": "tab"、
    "label": "Flow 1"、
    "disabled": "false"、
    "info":"
    },
    {
    "id":"983032d6.f2f378",
    "type": "debug"、
    "z":"c8829f45.d66fd",
    "name":"、
    "active":true、
    "tsidebar":true、
    「console":false、
    "tostatus":false、
    「complete": "トピック"、
    targetType": "msg""、
    "statusVal":""、
    statusType": "auto""、
    "x":800,
    "y":180,
    「wires":[
    Plain text

    ]

    },
     {
     "id":"39d4c518.6948ba",
     "type": "inject"、
     "z":"c8829f45.d66fd",
     "name":"、
     "props":[
     {
     "p": "payload"
     },
     {
     "p": "topic"、
     "vt": "str"
     }
     ],
     "repeat":"、
     "crontab":""、
     "once":false、
     "oneDelay":0.1、
     "topic": "hello"、
     「payload": "world"、
     「payloadType": "str"、
     "x":480,
     "y":120,
     「wires":[
     [
     "33035adc.d4eae6"
     ]
     ]
     },
     {
     "id":"f7839332.ea3a98",
     "type": "mqtt in"、
     "z":"c8829f45.d66fd",
     "name": "MQTT Receive All"、
     "topic": "##"、
     "qos": "2"、
     "datatype": "auto"、
     "broker":"6f327e4f.0a172",
     "nl":false、
     "rap":true、
     "rh":0、
     "x":450,
     "y":200,
     「wire":[
     [
     "983032d6.f2f378"、
     "97df7c35.a8d228"
     ]
     ]
     },
     {
     "id":"33035adc.d4eae6",
     "type": "mqtt out"、
     "z":"c8829f45.d66fd",
     "name": "MQTT Send Hello"、
     "topic":"、
     "qos":"、
     "retain":""、
     「respTopic":""、
     「contentType":"、
     "userProps":"、
     "correl":"、
     "expiry":""、
     "broker":"6f327e4f.0a172",
     "x":830,
     "y":120,
     「ワイヤー":[
    Plain text

    ]

    },
     {
     "id":"97df7c35.a8d228",
     "type": "debug"、
     "z":"c8829f45.d66fd",
     "name":"、
     "active":true、
     "tsidebar":true、
     「console":false、
     "tostatus":false、
     「complete": "payload"、
     「targetType": "msg"、
     "statusVal":""、
     statusType": "auto""、
     "x":810,
     "y":240,
     「wires":[
    Plain text

    ]

    },
     {
     "id":"6f327e4f.0a172",
     「type": "mqtt-broker"、
     "name":"、
     「ブローカー": "localhost"、
     "port": "1883"、
     「clientid":"、
     usetls": "false"、
     「protocolVersion": "5"、
     「keepalive": "60"、
     "cleansession":true、
     「birthTopic":""、
     「birthQos": "0"、
     「birthPayload":""、
     birthMsg":"{」、「birthTopic": "true
    Plain text

    }, "closeTopic":", "closeQos": "0", "closePayload":", "closeMsg":{ }, "willTopic":", "willQos": "0", "willPayload":", "willMsg":{ }, "sessionExpiry":""

    }
    ]```
    
    
    
    
    ---
    
    お探しのものは見つかりましたか?
    
    
    [community.tulip.coに](https://community.tulip.co/?utm_source=intercom&utm_medium=article-link&utm_campaign=all)質問を投稿したり、他の人が同じような質問に直面していないか確認することもできます!
    Plain text

    この記事は役に立ちましたか?