10월, 2020의 게시물 표시

MQTT - C/C++ Client

이미지
  This article records how to implement the client directly using c/c++ , which is linked to the Mosquito MQTT broker set-up on the Ubuntu 20.04, introduced in MQTTT - Mosquito MQT broker set-up on the Ubuntu 20.04 .   Install Paho MQTT C Client  To use MQTT on c/c++, first download the required module from the eclipse foundation. You can download files for your operating system from https://www.eclipse.org/paho/index.php?page=clients/c/index.php . <Paho MQTT C Client download page> Of course I use Linux, so I'll refer to the build contents for Linux in the middle of the document for "Building from Source." apt-get install openssl libssl-dev  cd / usr / local / src git clone https :// github . com / eclipse / paho . mqtt . c . git cd paho . mqtt . c . git make && sudo make install  Now we are ready to develop mqtt client using c/c++.   Build Example  We will proceed with the example of mqttt as described in MQTT - Mosquito MQTT broke...

MQTT - Python Client

이미지
 This article records how to implement the client directly using Python, which is linked to the Mosquito MQTT broker set-up on the Ubuntu 20.04, introduced in MQTTT - Mosquito MQT broker set-up on the Ubuntu 20.04 .  This article is a continuation of the above article. The service port of mosquitto was originally 1883. However, I changed it to 8883 while explaining how to change the service port in the above article. Therefore, in this article, the mosquitto service will be referred to as 8883. Install Paho  Paho is a Python client module provided by the EClipse Foundation with the Mosquito MQTT broker. Use the pip3 command to install the paho. pip install paho-mqtt   Simple Subscriber The following Python code works the same as the Mosquito_sub program. At the end of the previous article, we even implemented the use of ssl with the user id/password. Therefore, the same will be implemented in the Python program. import paho.mqtt.client as paho import ssl , ...