bt-mqtt-gateway icon indicating copy to clipboard operation
bt-mqtt-gateway copied to clipboard

Error Gateway with Virtualenv

Open martellucci opened this issue 5 years ago • 3 comments

Hi, I’ve got a RPI 3B+ with Rasbian 10. I follow your instruction to install the gateway with virtualenv to use it with miflora. The installation seams good, no error, I installed the miflora library, but the gateway doeasn’t start with this error:

(.venv) pi@Pi:~/bt-mqtt-gateway $ sudo ./gateway.py -d Traceback (most recent call last): File "./gateway.py", line 11, in import logger File "/home/pi/bt-mqtt-gateway/logger.py", line 3, in import yaml ModuleNotFoundError: No module named 'yaml'

Can you help me?

Ciao

Stefano

martellucci avatar Mar 25 '20 14:03 martellucci

try without sudo

Abbadon89 avatar Mar 28 '20 16:03 Abbadon89

another error:

(.venv) pi@Pi:~/bt-mqtt-gateway $ ./gateway.py 20:58:47 Starting WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. WARNING: pip is being invoked by an old script wrapper. This will fail in a future version of pip. Please see https://github.com/pypa/pip/issues/5599 for advice on fixing the underlying issue. To avoid this problem you can invoke Python with '-m pip' instead of running pip directly. 20:58:50 Adding 1 miflora devices Traceback (most recent call last): File "./gateway.py", line 83, in manager.start(mqtt) File "/home/pi/bt-mqtt-gateway/workers_manager.py", line 157, in start mqtt.callbacks_subscription(self._mqtt_callbacks) File "/home/pi/bt-mqtt-gateway/mqtt.py", line 112, in callbacks_subscription self.mqttc.connect(self.hostname, port=self.port) File "/home/pi/bt-mqtt-gateway/.venv/lib/python3.7/site-packages/paho/mqtt/client.py", line 937, in connect return self.reconnect() File "/home/pi/bt-mqtt-gateway/.venv/lib/python3.7/site-packages/paho/mqtt/client.py", line 1071, in reconnect sock = self._create_socket_connection() File "/home/pi/bt-mqtt-gateway/.venv/lib/python3.7/site-packages/paho/mqtt/client.py", line 3522, in _create_socket_connection return socket.create_connection(addr, source_address=source, timeout=self._keepalive) File "/usr/lib/python3.7/socket.py", line 727, in create_connection raise err File "/usr/lib/python3.7/socket.py", line 716, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

martellucci avatar Mar 28 '20 21:03 martellucci

Looks like you cannot connect to specified mqtt server. Double check ip and if its reachable form rpi

zewelor avatar Mar 29 '20 06:03 zewelor