Skip to content

Commit 561e4ce

Browse files
Merge pull request #293069 from dominicbetts/media-capture-mqtt-image
AIO: Media connector show how to capture image file.
2 parents f58c9cd + b38c5f2 commit 561e4ce

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

articles/iot-operations/discover-manage-assets/howto-use-media-connector.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,10 +200,16 @@ To verify that snapshots are publishing to the MQTT broker, use the **mosquitto_
200200
1. At the Bash shell in the **mqtt-client** pod, run the following command to connect to the MQTT broker using the **mosquitto_sub** tool subscribed to the `azure-iot-operations/data` topic:
201201

202202
```bash
203-
mosquitto_sub --host aio-broker --port 18883 --topic "azure-iot-operations/data/#" -V 5 -F '%t %l' --cafile /var/run/certs/ca.crt -D CONNECT authentication-method 'K8S-SAT' -D CONNECT authentication-data $(cat /var/run/secrets/tokens/broker-sat)
203+
mosquitto_sub --host aio-broker --port 18883 --topic "azure-iot-operations/data/#" -V 5 -F '%p' -C 1 --cafile /var/run/certs/ca.crt -D CONNECT authentication-method 'K8S-SAT' -D CONNECT authentication-data $(cat /var/run/secrets/tokens/broker-sat) > image.jpeg
204204
```
205205

206-
This command continues to run and displays messages as they arrive on the `azure-iot-operations/data` topic until you press **Ctrl+C** to stop it. The output shows the topic the message was published to and its size. To exit the shell environment, type `exit`.
206+
This command captures the raw payload from a single message and saves it to a file called **image.jpeg** in the pod's filing system. To exit the pod's shell environment, type `exit`.
207+
208+
1. To copy the image file from the pod to your local machine, run the following command:
209+
210+
```console
211+
kubectl cp azure-iot-operations/mqtt-client:image.jpeg image.jpeg
212+
```
207213

208214
When you finish testing the asset, you can delete it by running the following command:
209215

0 commit comments

Comments
 (0)