mqttc | mqtt client written in c

 by   looksgood C Version: Current License: No License

kandi X-RAY | mqttc Summary

kandi X-RAY | mqttc Summary

mqttc is a C library typically used in Internet of Things (IoT) applications. mqttc has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

mqtt client written in c language.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              mqttc has a low active ecosystem.
              It has 5 star(s) with 30 fork(s). There are 4 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              mqttc has no issues reported. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of mqttc is current.

            kandi-Quality Quality

              mqttc has no bugs reported.

            kandi-Security Security

              mqttc has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              mqttc does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              mqttc releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of mqttc
            Get all kandi verified functions for this library.

            mqttc Key Features

            No Key Features are available at this moment for mqttc.

            mqttc Examples and Code Snippets

            No Code Snippets are available at this moment for mqttc.

            Community Discussions

            QUESTION

            MQTT with AWS IoT Core not sending messages when QoS 2
            Asked 2021-Apr-07 at 18:19

            I am trying to send messages from one client to another using MQTT, both are publishers and subscribers. When QoS = 1, the messages are sent but sometimes duplicated. However, when I use QoS = 2, the messages are apparently not sent. Each client sends 4 messages each round, the payload is a chunk of a biggest bytearray.

            Code for the publisher:

            ...

            ANSWER

            Answered 2021-Apr-07 at 18:18

            The problem here is that AWS IoT Core only allows QoS 0 and 1. Therefore the messages won't be sent if they have QoS=2.

            Source https://stackoverflow.com/questions/66991856

            QUESTION

            paho-mqtt won't give me the queued messages
            Asked 2020-Dec-20 at 13:27

            Using paho-mqtt and trying to have it receive queued messages. The broker I'm using is emqx 4.2.2 and this is my script:

            ...

            ANSWER

            Answered 2020-Dec-18 at 04:56

            QOS only works if the client is SUBSCRIBEd...if you want to receive messages before you are Subscribed, you need to PUBLISH messages with the Retain flag set...and then you only get the last message that was sent. If you really need to get multiple messages, then you need to use something like AMQ, and not MQTT.

            Source https://stackoverflow.com/questions/65347546

            QUESTION

            getting ssl.SSLError: [X509] no certificate or crl found (_ssl.c:4062) in python
            Asked 2020-Sep-08 at 12:51

            I am using paho.mqtt library to connect with aws iot core but i am not able to connect and i am getting following error

            ssl.SSLError: [X509] no certificate or crl found (_ssl.c:4062)

            can anyone please help me to figure it out.

            ...

            ANSWER

            Answered 2020-Sep-08 at 12:51

            caPath is certain to be incorrect. It needs to be the Amazon root ca which you can google.

            Source https://stackoverflow.com/questions/63792648

            QUESTION

            RaspberryPi is sending messages to AWS IoT - I cant test it on the aws console
            Asked 2020-Jun-26 at 10:10

            I got my RaspberryPi registered as a Thing in Aws IoT.

            Im executing this python script:

            ...

            ANSWER

            Answered 2020-Jun-26 at 10:10

            I figured out what the problem was:

            I did not know that I have to attach the thing and the policy to a certificate. That seems like it was the problem, now I am getting the messages straight to my test console.

            If someone runs into this issue, check out this Blog Entry which helped me fix it.

            Source https://stackoverflow.com/questions/62574084

            QUESTION

            strange while loop behavior with time.sleep above 90 s
            Asked 2020-Jun-18 at 20:44

            I'm struggling understanding a "weird" behavior of my simple script. Basically, it works as expected if time.sleep() is set as 60s but as soon as I put a value above 90 (90 is the limit apparently in my case), the loop doesn't work properly. I discovered this when I was trying to pause the script for 3 mins.

            Here's my script

            ...

            ANSWER

            Answered 2020-Jun-18 at 20:44

            The MQTT client uses a network thread to handle a number of different aspects of the connection to the broker.

            Firstly, it handles sending ping request to the broker in order to keep the connection alive. The default period for the keepalive period is 60 seconds. The connection will be dropped by the broker if it does not receive any messages in 1.5 times this value, which just happens to be 90 seconds.

            Secondly, the thread handles any incoming messages that the client may have subscribed to.

            Thirdly, if you try to publish a message that is bigger than the MTU of the network link, calling mqttc.publish() will only send the first packet and the loop is needed to send the rest of the payload.

            There are 2 ways to run the network tasks.

            1. As you have found, you can start a separate thread with the mqttc.loop_start()
            2. The other option is to call mqttc.loop() within your own while loop

            Source https://stackoverflow.com/questions/62457609

            QUESTION

            Read csv to a list of objects and send row by row via mqtt publisher with an interval of 30 seconds
            Asked 2020-May-28 at 14:10

            I need to read a csv file has a list of objects to then do a json.dump and send row by row in a 30 seconds interval. I've got this but it is not working well, it sends a row but it is not the first and after 30 seconds stops for some reason.

            ...

            ANSWER

            Answered 2020-May-28 at 12:46

            Your indentation is wrong, you are only adding the last record to data because data.append(d) is outside the first for-loop

            Source https://stackoverflow.com/questions/62064306

            QUESTION

            Lost connection between Python program and MySQL
            Asked 2020-May-22 at 11:27

            Why do I get this error?

            Mysql.connector.errors.DatabaseError: 2003 (HY000): Can't connect to MySQL server n '3.XX.XXX.89' (110)

            I am collecting data from MQTT broker and storing it in a MySQL database. For subscribing to the topics on MQTT broker, I am using Paho MQTT client and for connecting to the MySQL database server, I am using MySQL python connector. I run this python script in the background continuously on Amazon EC2 Ubuntu instance (Virtual Server):

            ...

            ANSWER

            Answered 2020-May-22 at 11:21

            Connections between clients (like your python program) and MySQL don't stay open forever when they're not in use. MySQL drops connections when its wait_timeout, or interactive_timeout, expires.

            It sounds like your program works all day and sleeps all night (like the lumberjack in the Monty Python schtick). When it wakes up it has no connection to the database because MySQL closed it.

            What can you do about this? In my order of preference:

            1. Right before your program handles each queued item, perform a no-op operation like SELECT 1;. If that operation throws an exception, reopen the database connection. This is a good solution because it makes your application more resilient if the MySQL database server must be restarted. Sometimes cloud providers (AWS, Azure, Digital Ocean, others) have to take host machines out of service. When they do that they bounce customer virtual machines so they can start on new host machines. If you're lucky they warn you first.

            2. Update your program so it closes its database connection when its queue of work becomes empty, and reopens it when it has work to do.

            3. Once every so often (a minute?) do a no-op SELECT 1; as a keepalive so MySQL won't close the connection.

            4. Change the wait_timeout value to something long enough. This sets it to one week.

            Source https://stackoverflow.com/questions/61951269

            QUESTION

            msg.payload.split fails for mqtt in python. How to fix?
            Asked 2020-Feb-14 at 14:29

            I have created an MQTT class. It does connect fine and publishes the "Online" message upon connection. However something is wrong with the on_message method, as it starts but gets stuck on splitting the payload

            ...

            ANSWER

            Answered 2020-Feb-14 at 14:29

            The issue lies with understanding the msg.payload format.

            While print(msg.payload) returns a legible text, msg.payload is not a string but ASCII code. After converting msg.payload from ASCII to a string, the .split function can be used. Here is the working conversion for the mqtt payload.

            Source https://stackoverflow.com/questions/60225627

            QUESTION

            Use paho-mqtt with PyQt
            Asked 2020-Jan-28 at 15:00

            How I can use callback function from QThread?

            Callback function on_message does not print any data. In run() I connect to mqtt-broker and subscribe on topic. on_message must work when I get new message.

            Example simple QT app. Change value event connected with simple QLCD. Subscription topic took from dashboard

            ...

            ANSWER

            Answered 2020-Jan-28 at 15:00

            It is not necessary to use threads, just follow the logic of Qt: let's use signals. In the following code I show an advance of the library of an MQTT client that I am implementing that at least up to now implements what you want, in next days I will add more functionalities.

            Source https://stackoverflow.com/questions/52623799

            QUESTION

            Setting up Mosquitto on home server
            Asked 2019-Dec-07 at 14:27

            I'm struggling with exposing Mosquitto that I setup on my Centos7 homeserver to the outside internet through my router.

            Mosquitto runs fine on my localhost and post 1883 on the homeserver. I am able to pub/sub, and it is listening on the port as 127.0.0.1:1883 (tcp)

            My home router has a dynamic IP (for now), say 76.43.150.206. On the router I port forwarded 1883 as both internal/external ports to my home server, say 192.168.1.100.

            In the mosquitto.conf file, I have one simply line "listener 1883 76.43.150.206".

            When I then attempt to pub/sub using a python client on an external computer as mqttc.connect("76.43.150.206", 1883), it says connection refused.

            Any hints on what I'm doing wrong or how to get it working? BTW, my understanding of this setup is very basic and I've pretty much been going off blogs.

            ...

            ANSWER

            Answered 2017-Jul-22 at 23:48

            You should not put the external address into the mosquitto config file.

            You should probably not even have a listen line at all as mosquitto will bind to all available IP addresses on the machine it's running with the default port (1883).

            If you really must use the listen directive (e.g. in order to set up SSL) then it should be configured with the internal IP address of the machine running the broker, in this case 192.168.1.100 and with a different port number so it does not clash with the default

            Source https://stackoverflow.com/questions/45260068

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install mqttc

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/looksgood/mqttc.git

          • CLI

            gh repo clone looksgood/mqttc

          • sshUrl

            git@github.com:looksgood/mqttc.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular C Libraries

            linux

            by torvalds

            scrcpy

            by Genymobile

            netdata

            by netdata

            redis

            by redis

            git

            by git

            Try Top Libraries by looksgood

            mongodbAppender

            by looksgoodJavaScript

            cmns

            by looksgoodJavaScript

            amon-client

            by looksgoodJavaScript

            zerolog

            by looksgoodJavaScript

            apps

            by looksgoodHTML