Skip to content

Commit 5746ba6

Browse files
committed
Switch to JSON IoT Agent
1 parent 7d69eb2 commit 5746ba6

3 files changed

Lines changed: 15 additions & 15 deletions

File tree

README.ja.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,28 +78,28 @@ IoT Agent は、デバイスのグループが独自のネイティブ・プロ
7878
すべての IoT Agent は単一のペイロード形式に対して定義されていますが、
7979
そのペイロードに対して複数の異なるトランスポートを使用できます。。
8080

81-
Ultralight IoT Agent にすでに紹介しました。これは、キーと値のペアの単純なバー
81+
JSON IoT Agent にすでに紹介しました。これは、キーと値のペアの単純なバー
8282
(`|`) で区切られたリストを使用して通信します。このペイロードは単純で
8383
簡潔ですが、比較的あいまいな通信メカニズムです。インターネットで使用される最も
8484
一般的なメッセージング・ペイロードは、JavaScript 開発者に馴染みのある、いわゆる
8585
JavaScript Object Notation または JSON です。
8686

87-
JSON は Ultralight よりも若干冗長ですが、より大きなメッセージを送信するコスト
87+
JSON は JSON よりも若干冗長ですが、より大きなメッセージを送信するコスト
8888
は、構文の親しみやすさによって相殺されます。多くの一般的なデバイスは JSON 形式で
8989
メッセージを送信するようにプログラムでき、データを解析するためのソフトウェア・
9090
ライブラリが多数存在するため、個別の
9191
[IoT Agent for JSON](https://fiware-iotagent-json.readthedocs.io/en/latest/usermanual/index.html#user-programmers-manual)
9292
はこの形式で送信されるメッセージに対処するために特別に作成されました。
9393

94-
JSON ペイロードを使用した通信と Ultralight プレーン・テキスト・ペイロードを
94+
JSON ペイロードを使用した通信と JSON プレーン・テキスト・ペイロードを
9595
使用した通信の間に実際的な違いはありません。その通信の基礎、言い換えれば、
9696
コンポーネント間でメッセージが渡される方法を定義する基本的なプロトコルは
9797
同じままです。明らかに、IoT Agent 内の JSON ペイロードの解析、つまり、JSON から
9898
NGSI へのメッセージの変換、またはその逆変換は、JSON IoT Agent に固有です。
9999

100100
2つの IoT Agent の直接比較を以下に示します:
101101

102-
| IoT Agent for Ultralight | IoT Agent for JSON | 関連するプロトコル領域 |
102+
| IoT Agent for JSON | IoT Agent for JSON | 関連するプロトコル領域 |
103103
| -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------- |
104104
| サンプル測定値 `c\|1` | サンプル測定値 `{"count": "1"}` | メッセージ・ペイロード |
105105
| サンプル・コマンド `Robot1@turn\|left` | サンプル・コマンド `{"Robot1": {"turn": "left"}}` | メッセージ・ペイロード |
@@ -621,7 +621,7 @@ POST リクエストを以下に送信することを意味します。
621621
http://iot-agent:7896/iot/json?i=<device_id>&k=4jggokgpepnvsb2uv4s40d59ov
622622
```
623623
624-
これは、Ultralight IoT Agent と非常によく似た構文です - パスのみが
624+
これは、JSON IoT Agent と非常によく似た構文です - パスのみが
625625
変更されています。これにより、複数の IoT Agent が異なる場所でリッスン
626626
できます。
627627
@@ -722,7 +722,7 @@ curl -iX POST \
722722
```
723723

724724
ペイロードと `Content-Type` の両方が更新されました。ダミー・デバイスは、
725-
ドアのロックが解除されたときに、以前のチュートリアルで同様の Ultralight
725+
ドアのロックが解除されたときに、以前のチュートリアルで同様の JSON
726726
リクエストを行いました。各モーション・センサの状態が変化し、ノースバウンド・
727727
リクエストがデバイス・モニタに記録されます。
728728

@@ -899,7 +899,7 @@ curl -X GET \
899899

900900
### Smart Door のプロビジョニング
901901

902-
基盤となる Ultralight プロトコルと JSON プロトコルは非常に類似しているため、
902+
基盤となる JSON プロトコルと JSON プロトコルは非常に類似しているため、
903903
アクチュエータとデバイスは、IoT Agent がデバイスと通信するために必要なデータと
904904
同じ属性を使用してプロビジョニングされ、NGSI を JSON に解析するペイロードは
905905
IoT Agent 自体に委任されます。コマンドと測定値の両方を提供するデバイスの

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,25 +81,25 @@ As defined previously, an IoT Agent is a component that lets a group of devices
8181
Context Broker using their own native protocols. Every IoT Agent is defined for a single payload format, although they
8282
may be able to use multiple disparate transports for that payload.
8383

84-
We have already encountered the Ultralight IoT Agent, which communicates using a simple bar (`|`) separated list of
84+
We have already encountered the JSON IoT Agent, which communicates using a simple bar (`|`) separated list of
8585
key-value pairs. This payload is a simple, terse but relatively obscure communication mechanism - by far the commonest
8686
messaging payload used on the Internet is the so-called JavaScript Object Notation or JSON which will be familar to any
8787
software developer.
8888

89-
JSON is slightly more verbose than Ultralight, but the cost of sending larger messages is offset by the familiarity of
89+
JSON is slightly more verbose than JSON, but the cost of sending larger messages is offset by the familiarity of
9090
the syntax. A separate
9191
[IoT Agent for JSON](https://fiware-iotagent-json.readthedocs.io/en/latest/usermanual/index.html#user-programmers-manual)
9292
has been created specifically to cope with messages sent in this format, since a large number of common devices are able
9393
to be programmed to send messages in JSON and many software libraries exist to parse the data.
9494

95-
There is no practical difference between communicating using a JSON payload and communicating using the Ultralight plain
95+
There is no practical difference between communicating using a JSON payload and communicating using the JSON plain
9696
text payload - provided that the basis of that communication - in other words the fundamental protocol defining how the
9797
messages are passed between the components remains the same. Obviously the parsing of JSON payloads within the IoT
9898
Agent - the conversion of messages from JSON to NGSI and vice-versa will be unique to the JSON IoT Agent.
9999

100100
A direct comparison of the two IoT Agents can be seen below:
101101

102-
| IoT Agent for Ultralight | IoT Agent for JSON | Protocol's Area of Concern |
102+
| IoT Agent for JSON | IoT Agent for JSON | Protocol's Area of Concern |
103103
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | -------------------------- |
104104
| Sample Measure `c\|1` | Sample Measure `{"count": "1"}` | Message Payload |
105105
| Sample Command `Robot1@turn\|left` | Sample Command `{"Robot1": {"turn": "left"}}` | Message Payload |
@@ -531,7 +531,7 @@ GET or POST requests to:
531531
http://iot-agent:7896/iot/json?i=<device_id>&k=4jggokgpepnvsb2uv4s40d59ov
532532
```
533533

534-
Which is very similar syntax to the Ultralight IoT Agent - only the path has changed. This allows multiple IoT Agents to
534+
Which is very similar syntax to the JSON IoT Agent - only the path has changed. This allows multiple IoT Agents to
535535
listen at different locations.
536536

537537
When a measurement from an IoT device is received on the resource URL it needs to be interpreted and passed to the
@@ -625,7 +625,7 @@ curl -iX POST \
625625
-d '{"c": "1"}'
626626
```
627627

628-
Both the payload and the `Content-Type` have been updated. The dummy devices made a similar Ultralight request in the
628+
Both the payload and the `Content-Type` have been updated. The dummy devices made a similar JSON request in the
629629
previous tutorials when the door was unlocked, you will have seen the state of each motion sensor changing and a
630630
Northbound request will be logged in the device monitor.
631631

@@ -789,7 +789,7 @@ command can be seen in the value of the `ring_info` attribute.
789789

790790
### Provisioning a Smart Door
791791

792-
Because the underlying Ultralight and JSON protocols are so similar, actuators and devices are provisioned using the
792+
Because the underlying JSON and JSON protocols are so similar, actuators and devices are provisioned using the
793793
same attributes as the data the IoT Agent needs to know to communicate with the device reamins the same, and the payload
794794
parsing NGSI to JSON is delegated to the IoT Agent itself. Provisioning a device which offers both commands and
795795
measurements is merely a matter of making an HTTP POST request with both `attributes` and `command` attributes in the

services

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ case "${command}" in
120120
stoppingContainers
121121
echo -e "Starting containers: \033[1;34mOrion\033[0m, \033[1;36mIoT-Agent\033[0m, \033[1;30mTutorial\033[0m and a \033[1;30mMongoDB\033[0m database."
122122
echo -e "- \033[1;34mOrion\033[0m is the context broker"
123-
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the UltraLight Protocol"
123+
echo -e "- \033[1;36mIoT-Agent\033[0m is configured for the JSON Protocol"
124124
echo -e "- \033[1;30mTutorial\033[0m acts as a series of dummy IoT Sensors over HTTP"
125125
echo ""
126126
${dockerCmd} up -d --remove-orphans

0 commit comments

Comments
 (0)