MQTT-C | A portable MQTT C client for embedded systems and PCs
kandi X-RAY | MQTT-C Summary
kandi X-RAY | MQTT-C Summary
MQTT-C is an MQTT v3.1.1 client written in C. MQTT is a lightweight publisher-subscriber-based messaging protocol that is commonly used in IoT and networking applications where high-latency and low data-rate links are expected. The purpose of MQTT-C is to provide a portable MQTT client, written in C, for embedded systems and PC's alike. MQTT-C does this by providing a transparent Platform Abstraction Layer (PAL) which makes porting to new platforms easy. MQTT-C is completely thread-safe but can also run perfectly fine on single-threaded systems making MQTT-C well-suited for embedded systems and microcontrollers. Finally, MQTT-C is small; there are only two source files totalling less than 2000 lines.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of MQTT-C
MQTT-C Key Features
MQTT-C Examples and Code Snippets
Community Discussions
Trending Discussions on MQTT-C
QUESTION
I am very new to the mqtt on Android Development. So, I did something similar to this guide. https://www.hivemq.com/blog/mqtt-client-library-enyclopedia-paho-android-service/
I have tried to connect my android application from the Android Studio emulator to Mqtt broker. The broker is located in my Windows10 laptop (which is the same machine as the Android client). The problem I found is that my Android client cannot connect itself to the Mqtt broker ip. I've tried it in many ways but still couldn't get it work. So, I'm not sure if I'm doing it right?
Here is my build.gradle
dependencies
ANSWER
Answered 2022-Apr-11 at 12:56Following something like:
How do you connect localhost in the Android emulator?
you probably need to access the broker on:
10.0.2.2:1883
QUESTION
we are running an Apache Beam Apllication on a Flink Cluster.
Since a few days the application fails with the following error:
...ANSWER
Answered 2022-Mar-25 at 08:34So I got fixed it.
I don't know where the problem exactly was.
I load a backup of my vm when all was working. Then I updated openjdk-11 to the latest version. After this the error appears again.
So it's really an problem with the update to openjdk-11-jdk 11.0.14.
After deleting openjdk and make a clean reinstall all works fine again.
Maybe this will help someone.
QUESTION
I'm using the HiveMQ library in my Java Spring application to connect to a Mosquitto instance as I find it more user-friendly compared to the Paho client. But something is going wrong with the automatic reconnection. From time to time the connection is lost and the application doesn't succeed in reconnecting (see logs 1). This can also be triggered by restarting the Mosquitto broker itself (see logs 2).
This is my client builder code with additional logging in the disconnect to check if the credentials are still correct:
...ANSWER
Answered 2022-Mar-16 at 21:09It appears that your question is answered in this issue:
If you set the username and password on the connect call, they will not be stored and reused when the client reconnects (for security reasons).
The following code (from the issue linked above) demonstrates the approach:
QUESTION
I would like to connect a test MQTT-Client to my Node.js application as a MQTT-Broker. I am using the aedes library from moscajs
My MQTT-Client is the tool "MQTT-Explorer" and here is my Node.js application:
...ANSWER
Answered 2022-Mar-01 at 20:20MQTT Explorer is built using Node.js and the MQTT library MQTT.js. As per this issue:
Node.js requires the IP address to be in the subjectAltNames for the cert and not in the CN. Maybe MQTT.fx isn't requiring that, but it should.
and:
If your server's certificate says CN=localhost in the Subject field, connect using localhost and not 127.0.0.1 and it should work. If it says CN=127.0.0.1, you have to make a new one because Node.js won't validate the IP address unless it's in the SAN extension. There is a way to work around it in code (I think it's an option called checkServerIdentity), but I would prefer to fix my certificate if I had this problem.
A rationale for the approach taken in Node is set out in this answer which includes the following quote from RFC2818: HTTP Over TLS :
In some cases, the URI is specified as an IP address rather than a hostname. In this case, the iPAddress subjectAltName must be present in the certificate and must exactly match the IP in the URI.
As you are using MQTT over TLS (as opposed to HTTP Over TLS) you could argue that the above does not apply but, given that the main use of the TLS library is for HTTP traffic, it makes sense that it confirms to the RFC by default.
You have a few options including:
- Use a hostname (e.g.
localhost
) rather then an IP when creating the certificate/connecting. - Add the IP as a subjectAltName
- Modify the library to use a noop
checkServerIdentity
(see this answer). - Use another application for testing (not really recommended as some applications will work and others will not). The issue quoted above mentions that MQTT.fx works.
QUESTION
I am trying to use marvinroger/async-mqtt-client
that in the provided examples is used together with freertos timers that use a callback that gets invoked whenever the timer expire. The full example is here.
I wanted to create a singleton class to enclose all the connection managing part and just expose the constructor (through a getInstance) and a begin function that other than setting the callbacks, creates the timers for reconnection.
The class looks like (I simplified by removing useless parts):
...ANSWER
Answered 2022-Feb-21 at 00:28std::bind
returns a callable object, not a function pointer. It works with WiFi.onEvent
because there is an overload taking a std::function
:
QUESTION
In a Java server application, we want to use the correlationData, which is part of MQTT5, so we can use this in the reply message to link and validate it when the reply is received.
I'm using the hivemq-mqtt-client library 1.2.2 and connecting to HiveMQ Cloud.
The connection is made like this:
...ANSWER
Answered 2021-Dec-17 at 14:04This behaviour has now been fixed by HiveMQ Cloud.
QUESTION
I am trying to get a simple mqtt broker set up and access it from a web page. I have had pretty much 0 luck.
I've got mosquitto 2.0.14 downloaded and running. Here's my configuration file:
...ANSWER
Answered 2021-Nov-26 at 21:35You need to add allow_anonymous true
to allow users to connect without supplying a username/password.
This is part of the set of changes introduced in v2.0 to improve the default security posture of mosquitto out of the box.
QUESTION
I am working on a C++ web framework, oatpp
to create REST APIs. Using the oatpp-starter project where the CMakeLists.txt
looks like:
ANSWER
Answered 2021-Sep-08 at 13:18Here's what was happening:
I configured CMakeLists.txt
incorrectly to integrate with conan
. Since I had paho-mqtt-cpp
installed beforehand, the program was linking to installed libraries instead of those provided by conan.
This CMakeLists.txt
works for me:
QUESTION
I'm receiving an error when connecting to my Mosquitto server in my flutter web project. I'm using the import for mqtt_browser_client.dart
and the package mqtt_client.
My code follows the example, and I've checked, I am able to connect to my server from the same PC in MQTT Explorer. (becartpi:8080).
...ANSWER
Answered 2021-Aug-18 at 10:11Check the websocket headers API setting you may be sending the wrong headers for your broker.
Have a look at the mqtt_server_client_websocket.dart file in the examples directory, the setting you want is client.websocketProtocols, look at the API for this.
QUESTION
Sorry if the title is unclear. I have a custom image that runs a Python script on a loop. The script continues to run as expected when I call it directly with python3
ANSWER
Answered 2021-Jul-29 at 21:52remove the entrypoint from your docker-compose file, it will start by the CMD of dockerfile. You can also set the restart option to always.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install MQTT-C
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page