Two notes on dealing with the problems encountered by paho.MQTT_paho.mqtt.client_Link2Points Blog
class=”markdown_views prism-tomorrow-night”> Article directory EMQX Install Broker Python Download Code Android configuration writing and problem solving 1. Under the root directory 2. Under the app directory 3. Add AndroidManifest.xml 4. MainActivity.java EMQX Install Broker docker run -d –name emqx -p 1883:1883 -p 8081:8081 -p 8083:8083 -p 8084:8084 -p 8883:8883 -p 18083:18083 emqx/emqx:4.3.8 Modified based on the original project https://github.com/eclipse/paho.mqtt.python https://github.com/eclipse/paho.mqtt.android Written in Python Download pip install paho-mqtt If the following problems occur during the process, you need to upgrade pip Building wheels for collected packages: paho-mqtt Building wheel for paho-mqtt (setup.py) … error ERROR: Command errored out with exit status 1: command: /root/django/venv_RTCS/bin/python -u -c ‘import sys, setuptools, tokenize; sys.argv[0] = ‘”‘”‘/tmp/pip-req-build-yt56ry83/setup.py ‘”‘”‘; __file__='”‘”‘/tmp/pip-req-build-yt56ry83/setup.py'”‘”‘; f=getattr(tokenize, ‘”‘”‘open'”‘”‘ , open)(__file__);code=f.read().replace(‘”‘”‘\r\n'”‘”‘, ‘”‘”‘\n'”‘”‘);f.close( );exec(compile(code, __file__, ‘”‘”‘exec'”‘”‘))’ bdist_wheel -d /tmp/pip-wheel-0vih1nvj cwd: /tmp/pip-req-build-yt56ry83/ Complete output (6 lines): usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] …] or: setup.py –help [cmd1 cmd2 …] or: setup.py –help-commands or: setup.py cmd –help error: invalid command ‘bdist_wheel’ ERROR: Failed building wheel for paho-mqtt Running setup.py clean for paho-mqtt Failed to build paho-mqtt Upgrade pip python -m pip install –upgrade pip Code #!/usr/bin/python # coding:utf-8 import paho.mqtt.client as mqtt import json HOST = “” PORT = 1883 user = “test” pw =…