forked from AimRT/AimRT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Asynchronous connection to mqtt broker (AimRT#85)
* feat: Asynchronous connection to mqtt broker * add new option: client_key_password * add example for mqtt plugin with ssl/tls * add new info at release notes * Make minor formatting adjustments. * Improve mqtt_plugin's README documentation --------- Co-authored-by: hanjun <hanjun@agibot.com>
- Loading branch information
1 parent
e013333
commit 5b01f4e
Showing
11 changed files
with
281 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
...tt_plugin/install/linux/bin/cfg/examples_plugins_mqtt_plugin_pb_chn_pub_with_ssl_cfg.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Copyright (c) 2023, AgiBot Inc. | ||
# All rights reserved. | ||
|
||
aimrt: | ||
plugin: | ||
plugins: | ||
- name: mqtt_plugin | ||
path: ./libaimrt_mqtt_plugin.so | ||
options: | ||
broker_addr: ssl://127.0.0.1:8883 | ||
client_id: example_pb_chn_publisher | ||
max_pkg_size_k: 1024 | ||
truststore: /XX/YY/ZZ/cacert.pem # replace with your own truststore path | ||
client_cert: /XX/YY/ZZ/client-cert.pem # replace with your own client certificate path | ||
client_key: /XX/YY/ZZ/client-key.pem # replace with your own client key path | ||
log: | ||
core_lvl: INFO # Trace/Debug/Info/Warn/Error/Fatal/Off | ||
backends: | ||
- type: console | ||
executor: | ||
executors: | ||
- name: work_thread_pool | ||
type: asio_thread | ||
options: | ||
thread_num: 2 | ||
channel: | ||
backends: | ||
- type: mqtt | ||
pub_topics_options: | ||
- topic_name: "(.*)" | ||
enable_backends: [mqtt] | ||
module: | ||
pkgs: | ||
- path: ./libpb_chn_pub_pkg.so | ||
enable_modules: [NormalPublisherModule] | ||
modules: | ||
- name: NormalPublisherModule | ||
log_lvl: INFO | ||
|
||
# Module custom configuration | ||
NormalPublisherModule: | ||
topic_name: test_topic | ||
channel_frq: 0.5 |
37 changes: 37 additions & 0 deletions
37
...tt_plugin/install/linux/bin/cfg/examples_plugins_mqtt_plugin_pb_chn_sub_with_ssl_cfg.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Copyright (c) 2023, AgiBot Inc. | ||
# All rights reserved. | ||
|
||
aimrt: | ||
plugin: | ||
plugins: | ||
- name: mqtt_plugin | ||
path: ./libaimrt_mqtt_plugin.so | ||
options: | ||
broker_addr: ssl://127.0.0.1:8883 | ||
client_id: example_pb_chn_subscriber | ||
max_pkg_size_k: 1024 | ||
truststore: /XX/YY/ZZ/cacert.pem # replace with your own truststore path | ||
client_cert: /XX/YY/ZZ/client-cert.pem # replace with your own client certificate path | ||
client_key: /XX/YY/ZZ/client-key.pem # replace with your own client key path | ||
log: | ||
core_lvl: INFO # Trace/Debug/Info/Warn/Error/Fatal/Off | ||
backends: | ||
- type: console | ||
executor: | ||
channel: | ||
backends: | ||
- type: mqtt | ||
sub_topics_options: | ||
- topic_name: "(.*)" | ||
enable_backends: [mqtt] | ||
module: | ||
pkgs: | ||
- path: ./libpb_chn_sub_pkg.so | ||
enable_modules: [NormalSubscriberModule] | ||
modules: | ||
- name: NormalSubscriberModule | ||
log_lvl: INFO | ||
|
||
# Module custom configuration | ||
NormalSubscriberModule: | ||
topic_name: test_topic |
3 changes: 3 additions & 0 deletions
3
...s/mqtt_plugin/install/linux/bin/start_examples_plugins_mqtt_plugin_pb_chn_pub_with_ssl.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
./aimrt_main --cfg_file_path=./cfg/examples_plugins_mqtt_plugin_pb_chn_pub_with_ssl_cfg.yaml |
3 changes: 3 additions & 0 deletions
3
...s/mqtt_plugin/install/linux/bin/start_examples_plugins_mqtt_plugin_pb_chn_sub_with_ssl.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
./aimrt_main --cfg_file_path=./cfg/examples_plugins_mqtt_plugin_pb_chn_sub_with_ssl_cfg.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.