MQTT

Installation

Windows

Liens_WEB:
  1. Download mosquitto https://mosquitto.org/download/ prendre la version light 32 bits

  2. Download openssl http://slproweb.com/products/Win32Ope prendre la version 32 bits

  3. Download de la DLL “ssleay32.dll” http://www.telecharger-dll.fr/dll-ssleay32.dll.html

  4. Download de la DLL “libeay32.dll” http://www.telecharger-dll.fr/dll-libeay32.dll.html

  5. Copier les 2 DLL dans le dossier “bin” d’openssl

  6. Copy openssl32bin folder to mosquitto C:opensslbin — C:Program Files(x86)mosquitto

  7. Copy required dll files C:openssllibeay32.dll — C:Program Files(x86)mosquitto

  8. Copy required dll files C:opensslssleay32.dll — C:Program Files(x86)mosquitto

  9. Download pthreadVC2.dll ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/dll/x86/

  10. Copy pthreadVC2.dll file C:DownloadspthreadVC2.dll — C:Program Files(x86)mosquitto

  11. Test subscriber / server mosquitto_sub -v -t “home/light”

  12. Test publisher / client mosquitto_pub -t “home/light” -m “Turn ON”

  13. Test2 publisher / client mosquitto_pub -t “home/light” -m “Turn OFF”


MQTT sous Python

  1. Création de l’environnement virtuel

    mkdir MQTT_env
    cd MQTT_env
    python -m venv .
    
  2. Installation des dépendances

    script\activate.bat
    
    pip install paho-mqtt==1.3.1