Skip to content

Commit 98ae252

Browse files
made external docs for mqtt
1 parent 337541e commit 98ae252

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

source/external-interface-design/external-interface-design.rst

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Integration patterns
2020
Internal systems
2121
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2222

23-
Internally, OS2iot consists of four components shown in this figure.
23+
Internally, OS2iot consists of five components shown in this figure.
2424

2525
|image2|
2626

@@ -50,11 +50,13 @@ IoT devices
5050

5151
Figure 3 - IoT device integration overview
5252

53-
All IoT device integrations except LoRaWAN use callbacks to send data to
53+
All IoT device integrations except LoRaWAN and MQTT use callbacks to send data to
5454
OS2iot using HTTPS in a request-response manner. Device management for
5555
Sigfox (i.e. adding and modifying IoT devices) is done by
5656
sending requests to Sigfox's Cloud backend.
5757

58+
MQTT devices uses the MQTT protocol to communicate with the broker.
59+
5860
Data from Chirpstack devices are sent to OS2iot through Chirpstack using
5961
MQTT, where Chirpstack is the publisher and OS2iot is the subscriber.
6062
Device management is done from OS2iot by sending gRPC requests to
@@ -311,10 +313,20 @@ over the network by a device.
311313
MQTT
312314
^^^^
313315

314-
There are two kinds of MQTT devices available. MQTT-publisher and MQTT-subscriber.
316+
There are two kinds of MQTT devices available. MQTT-publisher and MQTT-subscriber. These two devices works in different matters which will be described below.
315317

316318
MQTT-publisher
317319
~~~~~~~~~~~~~~
320+
The MQTT-publisher device will make it possible for a physical device to communicate with the internal OS2IoT mosquitto broker.
321+
The MQTT-publisher is created in the OS2IoT backend and is created with the credentials that the device needs for communicating with the internal broker.
322+
323+
The MQTT-publisher device can either be created with username/password or credentials. If the publisher is created with username/password it will use port 8885, and if created with certificate it will use port 8884.
324+
325+
When a physical MQTT device will publish some data, then OS2IoT will check for the specific topic that the device is publishing to in the database, and if the topic is set in the database, it will process the data.
326+
If a MQTT-publisher device with the specific topic isn't created then the broker won't be able to find it in the database and therefore it will reject the data.
327+
328+
The specific topic for the created device will be :code:`device/organizationID/applicationID/deviceID`.
329+
318330

319331

320332

@@ -324,6 +336,13 @@ MQTT-subscriber
324336
The MQTT-subscriber uses the MQTT protocol to subscribe to a topic on an external MQTT broker. A client is created in the OS2IoT backend.
325337
This client will connect to the external MQTT broker using the provided URL, port and authentication, and then subscribe to data on the provided topic.
326338

339+
OS2IoT doesn't have any knowlegde of the external broker so it's totally up to the user to provide the different inputs.
340+
If the input isn't valid and a connection can't be made to the external broker, a flag will be set in the database which tells OS2IoT that the connection can't be made and then OS2IoT will stop trying to connect to the external broker.
341+
342+
If the inputs from the user IS valid, then a connection will be made and the device will listen to any updates from the broker.
343+
344+
The MQTT-subscriber device has the possibility to use either certificate or username/password to a external broker if needed.
345+
327346

328347
Sigfox
329348
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -531,7 +550,7 @@ See `the seperate page for KOMBIT adgangsstyring <../kombit-adgangsstyring/kombi
531550

532551
.. |image1| image:: media/image5.png
533552
.. |image2| image:: media/image6.png
534-
.. |image3| image:: media/image7.png
553+
.. |image3| image:: media/image5.png
535554
.. |image4| image:: media/image8.png
536555
.. |image5| image:: media/image9.png
537556
.. |image6| image:: media/image10.png
-30.5 KB
Binary file not shown.

source/installation-guide/installation-guide.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ To get the mosquitto broker working, you have to create some certificates and up
302302
303303
11. Update the :code:`MQTT_BROKER_HOSTNAME` with the ip/hostname that you used for step 4 and 6, and :code:`CA_KEY_PASSWORD` with the password that you entered in step 3 in the docker-compose.yml file placed in OS2IoT-docker.
304304
305-
If you want to use kubernetes then you need some futher steps. First you have to install kubectl.
305+
If you want to use kubernetes to host mosquitto then you need some futher steps. First you have to install kubectl.
306306
307307
1. Open a command prompt in administrator mode.
308308

source/iot-data-handling/iot-data-handling.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ MQTT
6464

6565
OS2IoT supports two kinds of MQTT devices. An MQTT-publisher and an MQTT-subscriber.
6666

67-
OS2IoT also supports two kinds of authorization for MQTT-publishers: Username/password and certificate.
67+
OS2IoT supports two kinds of authorization for MQTT devices: Username/password and certificate.
6868

6969
MQTT-publisher
7070
~~~~~~~~~~~~~~
@@ -80,7 +80,7 @@ MQTT-subscriber
8080
~~~~~~~~~~~~~~~
8181

8282
When an MQTT-subscriber is created a connection to the external broker is made using the entered credentials.
83-
When a message is received by the external broker, on the topic configured. OS2IoT will also receive the message and further process it.
83+
When a message is received by the external broker on the topic configured, OS2IoT will also receive the message and further process it.
8484

8585

8686
Payload transformation and storage

0 commit comments

Comments
 (0)