You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Brief:
MQTT openDAQ streaming client module;
Example applications;
Reworking MQTT client wrapper (PAHO wrapper);
Improving MQTT openDAQ streaming server module;
Tests for client and server MQTT modules;
Tests for MQTT client wrapper;
Description:
Implementation of MQTT openDAQ streaming client module allows to receive and parse MQTT messages which adhere to a strict message structure. It allows discovering of MQTT openDAQ devices and communication with them.
The example applications demonstrate a typical approach to working with openDAQ MQTT modules.
MQTT client wrapper reworking changed the architecture of wrapper classes, removed unused functional and duplication of code. The previous approach with separate publisher and subscriber class was redesigned into single client class.
New tests for client and server MQTT modules.
New tests for MQTT client wrapper allow to test communication with a MQTT brocker and messaging between clients.
Copy file name to clipboardExpand all lines: README.md
+4-90Lines changed: 4 additions & 90 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,102 +49,16 @@ cmake --build .
49
49
50
50
## Testing
51
51
52
-
There are several example applications in the *"examples"* folder. These examples are based on OpenDAQ SDK and allow testing of *SimpleMQTTModule* functional blocks with each other and with third-party MQTT tools.
52
+
There are several example applications in the *"examples"* folder. These examples are based on OpenDAQ SDK and allow testing of *MQTTStreamingModule* client/server sides with each other and with third-party MQTT tools.
53
53
54
54
> ***Note:****Using the applications involves using a third-party broker. It must be started before example applications. See a **External MQTT tools** section for more details*
55
55
56
56
> ***Note:****The applications depend on **MQTTStreamingModule** and [**RefDeviceModule**](https://github.com/openDAQ/openDAQ/tree/main/examples/modules/ref_device_module).*
57
57
58
58
#### ref-dev-mqtt-pub
59
59
60
-
The *ref-dev-mqtt-pub* application is a console example which publishes *ref-device Signal* samples via the *MQTTStreamingModule* server. By default it uses the following *MQTTStreamingModule* server settings:
61
-
```
62
-
StreamingDataPollingPeriod: 20
63
-
MaxPacketReadCount: 1000
64
-
BrokerAddress: "127.0.0.1"
65
-
MqttUsername: ""
66
-
MqttPassword: ""
67
-
```
68
-
69
-
### External MQTT tools
70
-
71
-
It is suggested to use [***Eclipse Mosquitto***](https://github.com/eclipse-mosquitto/mosquitto) as a third-party MQTT tool set. It includes MQTT broker and MQTT publisher/subscriber clients.
72
-
Utilities could be installed on **Ubuntu**:
73
-
74
-
```shell
75
-
sudo apt install mosquitto mosquitto-clients
76
-
```
60
+
The *ref-dev-mqtt-pub* application is a console example which publishes *ref-device Signal* samples via the *MQTTStreamingModule* server.
77
61
78
-
The MQTT broker will be run automatically after installing. For simple testing run a subscriber with the following options:
62
+
#### ref-dev-mqtt-sub
79
63
80
-
```shell
81
-
mosquitto_sub -h 127.0.0.1 -t "openDAQ/#" -v
82
-
```
83
-
The subscriber will wait for incoming data and then print it. Then run a publisher with the following options:
[tid: 29784][2025-09-15 11:17:03.265] [OpenDAQMQTT] [info] MQTT: Trying to connect to MQTT broker (127.0.0.1)
116
-
[tid: 29784][2025-09-15 11:17:03.267] [OpenDAQMQTT] [info] Adding the Signal to reader: /RefDev1/IO/AI/RefCh0/Sig/AI0;
117
-
[tid: 29784][2025-09-15 11:17:03.268] [OpenDAQMQTT] [info] Signal /RefDev1/IO/AI/RefCh0/Sig/AI0Time doesn't has domain signal assigned, skipping
118
-
[tid: 29784][2025-09-15 11:17:03.268] [OpenDAQMQTT] [info] Adding the Signal to reader: /RefDev1/IO/AI/RefCh1/Sig/AI1;
119
-
[tid: 29784][2025-09-15 11:17:03.269] [OpenDAQMQTT] [info] Signal /RefDev1/IO/AI/RefCh1/Sig/AI1Time doesn't has domain signal assigned, skipping
120
-
[tid: 29784][2025-09-15 11:17:03.269] [OpenDAQMQTT] [info] Signal /RefDev1/Sig/Time doesn't has domain signal assigned, skipping
121
-
[tid: 29784][2025-09-15 11:17:03.269] [OpenDAQMQTT] [info] Adding the Signal to reader: /RefDev1/Dev/RefDev0/IO/AI/RefCh0/Sig/AI0;
122
-
[tid: 29784][2025-09-15 11:17:03.269] [OpenDAQMQTT] [info] Signal /RefDev1/Dev/RefDev0/IO/AI/RefCh0/Sig/AI0Time doesn't has domain signal assigned, skipping
123
-
[tid: 29784][2025-09-15 11:17:03.269] [OpenDAQMQTT] [info] Adding the Signal to reader: /RefDev1/Dev/RefDev0/IO/AI/RefCh1/Sig/AI1;
124
-
[tid: 29784][2025-09-15 11:17:03.270] [OpenDAQMQTT] [info] Signal /RefDev1/Dev/RefDev0/IO/AI/RefCh1/Sig/AI1Time doesn't has domain signal assigned, skipping
125
-
[tid: 29784][2025-09-15 11:17:03.270] [OpenDAQMQTT] [info] Adding the Signal to reader: /RefDev1/Dev/RefDev0/IO/AI/ProtectedChannel/Sig/AI2;
126
-
[tid: 29784][2025-09-15 11:17:03.270] [OpenDAQMQTT] [info] Signal /RefDev1/Dev/RefDev0/IO/AI/ProtectedChannel/Sig/AI2Time doesn't has domain signal assigned, skipping
127
-
[tid: 29784][2025-09-15 11:17:03.270] [OpenDAQMQTT] [info] Signal /RefDev1/Dev/RefDev0/Sig/Time doesn't has domain signal assigned, skipping
128
-
[tid: 29812][2025-09-15 11:17:03.271] [OpenDAQMQTT] [info] Streaming-to-device read thread started
0 commit comments