09.03.2020, 08:49
Here is a step by step guide to make LogicMachine act as MQTT broker.
1. Install these packages:
Power CPU:
https://dl.openrb.com/pkg/libmosquitto_1.6.2-1_imx6.ipk
https://dl.openrb.com/pkg/mosquitto_1.6.8-2_imx6.ipk
Old CPU:
https://dl.openrb.com/pkg/libmosquitto_1.6.8-1_mxs.ipk
https://dl.openrb.com/pkg/mosquitto_1.6.8-2_mxs.ipk
2. Server will start automatically. Keep in mind that there's no protection by default - no encryption and username/password auth.
3. If you need to get the data on LogicMachine in grp addresses, you can use MQTT client example and connect to localhost:
https://forum.logicmachine.net/showthrea...6#pid10926
4. If you are connecting to broker running on the same device you can set broker IP to 127.0.0.1. This way you can reuse script on other devices without having to specify the new IP.
5. SSL is not used, default port is 1883
6. Remove username/password variables as broker does not have any kind of authentication enabled by default.
7. As for topic/message payload - there's no specific format here. You can choose anything you like but it's a good practice to use one topic for one value instead of publishing complex data structures (JSON or similar) to a single topic.
1. Install these packages:
Power CPU:
https://dl.openrb.com/pkg/libmosquitto_1.6.2-1_imx6.ipk
https://dl.openrb.com/pkg/mosquitto_1.6.8-2_imx6.ipk
Old CPU:
https://dl.openrb.com/pkg/libmosquitto_1.6.8-1_mxs.ipk
https://dl.openrb.com/pkg/mosquitto_1.6.8-2_mxs.ipk
2. Server will start automatically. Keep in mind that there's no protection by default - no encryption and username/password auth.
3. If you need to get the data on LogicMachine in grp addresses, you can use MQTT client example and connect to localhost:
https://forum.logicmachine.net/showthrea...6#pid10926
4. If you are connecting to broker running on the same device you can set broker IP to 127.0.0.1. This way you can reuse script on other devices without having to specify the new IP.
5. SSL is not used, default port is 1883
6. Remove username/password variables as broker does not have any kind of authentication enabled by default.
7. As for topic/message payload - there's no specific format here. You can choose anything you like but it's a good practice to use one topic for one value instead of publishing complex data structures (JSON or similar) to a single topic.