We create a new value "temperature" of type float and delete the rest.
For every message type an ID is created which will become important:
2. Then we go ahead to create a Device type temperatureSensor which uses the MessageType mqtt:
The name is free text and here we chose bi-directional communication to be able to write and read from the sensor.
3. Then we finally create a Device (Sensor a) of the type temperatureSensor:
Also this device comes with an ID:
Also we may need to add a role to your User: IoT-MMS-User
Then we proceed wit the configuration
We need at least three parameters. The url (or IP) to your server, user of the MQTT broker and the password
Our message type (mqtt) only expects a temperature in numeric format. The message type however is not "mqtt" as one would expect but is the ID that was associated with it.
The message could look like this (please use your ID's):
{"mode":"async", "messageType":"f309795097bacbefacc8","messages":[{"temperature":"22"}]}
When you press send you should see a positive response from the server.(see above)
When you go back to the device configuration (see begin of the post) you should also be able to visualize the value and to see it in a table:
You should also be able to see the values on other clients that subscribe to the same topic.
On your Raspi Server you should be able to use the mosquitto pub and sub commands as described in PART 2.
The same command as above looks like this and sends the value temperature 22 to the topic associated with the sensor:
mosquitto_pub -t 'iot/data/iotmmsd057364trial/v1/66616fcc-23e4-44f1-9a9f-d5f63d2deec8' -m '{"mode":"async", "messageType":"f309795097bacbefacc8","messages":[{"temperature":"22"}]}' -u user -P password
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
13 | |
12 | |
11 | |
9 | |
9 | |
7 | |
5 | |
5 | |
5 |