Coder Social home page Coder Social logo

mqttclient's People

Contributors

g-breder avatar martinboers avatar mluhmann avatar owarneke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mqttclient's Issues

Implement MQTT Client "timeout" setting

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."

Use Paho's default values for MQTT Connect Options

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.

Headstart for including Paho during compiling

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)

Some of the CMake-Variables are not used at all

'

  1. 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

  2. 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)

Cannot build: mqtt_payload not declared in scope

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);

Add instructions how to build on windows OS

Building locally with the shell scripts written for Linux on a windows system might be troublesome.

  1. you will need git to clone the dependencies
  2. You need a bash to execute the scripts
  3. You need symlink support.
  4. you need the plcncli. (PLCnCLI_Win64_2019.0) phoenixcontact.com -> AXCF2152 -> Downloads -> Software
  5. you need the SDK (SDK_WIN64_2019.3) phoenixcontact.com -> AXCF2152 -> Downloads -> Software

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.