plcnext / mqttclient Goto Github PK
View Code? Open in Web Editor NEWMqtt Client for PLCnext Control
License: MIT License
Mqtt Client for PLCnext Control
License: MIT License
The Paho MQTT Client class has a "timeout" value that currently is not set by the RSC Service.
This parameter is described by the author of the Paho CPP library (in issue #152) as follows:
"The C++ client object is synchronous and will block until an operation completes - any operation, including connect, disconnect, publish a message, etc. The client::set_timeout() sets the upper bound for all of those operations so that the application doesn't block and hang forever if one operation fails to complete. This is a user parameter since the value should be different depending on the underlying type of network and connection. (Higher for a satellite phone, lower for a LAN, perhaps).
The value is a wait timeout in the C++ wrapper library. If it fails, the operation could still silently complete some time later, So it is best to set this at a higher value and use it as a last resort."
The Paho MQTT Client library provides a "sensible" set of default values for any Connect Options that are not explicitly set by the user.
However, the elements of the PLCnext ConnectOptions struct are currently initialised using different values (zero for numeric elements and false for booleans).
The PLCnext ConnectOptions struct should initialise its elements to the same values as Paho.
Can you give me some hints how to integrate paho c lib and paho c++ lib during manual compilation?
The provided installation instructions are not sufficient for me.
I am using a Ubuntu system and have installed the paho-wqtt libs both for c and c++ (probably with the wrong version).
I stop at this step:
cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE=/opt/pxc/2019.3/toolchain.cmake -DBUILD_TESTING=OFF -DUSE_ARP_DEVICE=ON -DCMAKE_STAGING_PREFIX=/home/tcs-user/Documents/projects/MqttClient/bin/axcf2152 -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DARP_TOOLCHAIN_ROOT=/opt/pxc/2019.3 -DARP_DEVICE=AXCF2152 "-DARP_DEVICE_VERSION=2019.3 (19.3.0.18509 )" -S . -B ./build/axcf2152-2019.3
-- Boost version: 1.63.0
-- Found the following Boost libraries:
-- regex
CMake Error at CMakeLists.txt:12 (_find_package):
Could not find a configuration file for package "PahoMqttCpp" that is
compatible with requested version "".
The following configuration files were considered but not accepted:
/usr/local/lib/cmake/PahoMqttCpp/PahoMqttCppConfig.cmake, version: 1.0.1 (64bit)
Call Stack (most recent call first):
libs/MqttClientService/CMakeLists.txt:50 (find_package)
The installation instructions does not use the default installation path of the SDK which is /opt/pxc/2019.3
'
Some of the CMake-Variables are not used at all. So you can leave them out (as CMake als suggests). These are for example: USE_ARP_DEVICE
When installing the lib, it was not clear to me that both libPxceTcs.Mqtt.Client.so
and libs/MqttClientService/intermediate/config/MqttClient.acf.config
can be found on the source directory and not the build directory
Originally posted by @markusgraube in #6 (comment)
Running the second build command from the readme: https://github.com/PLCnext/MqttClient#building-from-source
results in two errors, the second being fatal:
../../libs/MqttClientService/src/MqttClientManager.cpp:161:11: error: reference to ‘byte’ is ambiguous
const byte * mqtt_payload = payload.GetDataAddress();
../../libs/MqttClientService/src/MqttClientManager.cpp:165:74: error: ‘mqtt_payload’ was not declared in this scope; did you mean ‘setpayload’?
165 | this->client->Publish((Client::client_id_t)clientId, mqtt_topic, mqtt_payload, length, qos, retained);
Building locally with the shell scripts written for Linux on a windows system might be troublesome.
Hello, I had a problem with building components. I followed the Youtube video https://www.youtube.com/watch?v=gTlisz_Bq8U line by line (only changing path-s), and got this error. The previous builds worked fine, just this one had a problem.
I'm new to PLCnext, so I accept all advice.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.