mqboard get always times out
Closed this issue · 2 comments
Verifying "ls" that the directory contains files works ok. Trying "get" always times out, tried increasing --timeout 240 also
$ ../mqboard/mqboard --server mqtt.xxxxxx.com --verbose --port 8883 --tls --prefix aiotcomqtt ls
Connecting to mqtt.xxxxxx.com:8883
Subscribing to aiotcomqtt/mqb/reply/out/XZu7DGgW and aiotcomqtt/mqb/reply/err/XZu7DGgW
Pub aiotcomqtt/mqb/cmd/eval/XZu7DGgW #0 last=True len=123
Received reply on topic 'aiotcomqtt/mqb/reply/out/XZu7DGgW' with QoS 1
0.253kB in 0.580s -> 0.436kB/s
2700 board_config.py
2621 boot.py
0 lib/
3644 main.py
0 safemode/
0 src/
$ ../mqboard/mqboard --server mqtt.xxxxxx.com --verbose --timeout 240 --port 8883 --tls --prefix aiotcomqtt get main.py main.py
Connecting to mqtt.xxxxxx.com:8883
Subscribing to aiotcomqtt/mqb/reply/out/0iwzLkt5 and aiotcomqtt/mqb/reply/err/0iwzLkt5
Error: Timeout!
I can reproduce the problem... I guess I really need CI set-up with basic tests for all this...
In general, it really helps if you have a log from the board as well. I'll try to fix today if I can put together the time.
Here is something that I see occasionally. The command executes successfully, immediately run the command again and it fails, then try again, then success.
$ ../mqboard/mqboard --server mqtt.xxxxxx.com --verbose --timeout 60 --port 8883 --tls --prefix aiotcomqtt ls
Connecting to mqtt.xxxxxx.com:8883
Subscribing to aiotcomqtt/mqb/reply/out/cn7YTpyZ and aiotcomqtt/mqb/reply/err/cn7YTpyZ
Pub aiotcomqtt/mqb/cmd/eval/cn7YTpyZ #0 last=True len=123
Received reply on topic 'aiotcomqtt/mqb/reply/out/cn7YTpyZ' with QoS 1
0.271kB in 0.568s -> 0.476kB/s
2700 board_config.py
2621 boot.py
0 lib/
3644 main.py
0 safemode/
0 sd/
0 src/
$ ../mqboard/mqboard --server mqtt.xxxxxx.com --verbose --timeout 60 --port 8883 --tls --prefix aiotcomqtt ls safemode
Connecting to mqtt.xxxxxx.com:8883
Traceback (most recent call last):
File "../mqboard/mqboard", line 133, in
cli(obj={})
File "/home/fredrick/Development/micropython/mqboard/venv/lib/python3.6/site-packages/click/core.py", line 829, in call
return self.main(*args, **kwargs)
File "/home/fredrick/Development/micropython/mqboard/venv/lib/python3.6/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/home/fredrick/Development/micropython/mqboard/venv/lib/python3.6/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/fredrick/Development/micropython/mqboard/venv/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/fredrick/Development/micropython/mqboard/venv/lib/python3.6/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/home/fredrick/Development/micropython/mqboard/venv/lib/python3.6/site-packages/click/decorators.py", line 21, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/fredrick/Development/micropython/mqboard/mqboard/dirops.py", line 51, in ls
click.echo(do_ls(engine, directory, recursive, sha))
File "/home/fredrick/Development/micropython/mqboard/mqboard/dirops.py", line 92, in do_ls
return engine.perform("cmd/eval", cmd)
File "/home/fredrick/Development/micropython/mqboard/mqboard/engine.py", line 136, in perform
self.connect()
File "/home/fredrick/Development/micropython/mqboard/mqboard/engine.py", line 57, in connect
self._mqclient.connect(self._server, self._port)
File "/home/fredrick/Development/micropython/mqboard/venv/lib/python3.6/site-packages/paho/mqtt/client.py", line 937, in connect
return self.reconnect()
File "/home/fredrick/Development/micropython/mqboard/venv/lib/python3.6/site-packages/paho/mqtt/client.py", line 1071, in reconnect
sock = self._create_socket_connection()
File "/home/fredrick/Development/micropython/mqboard/venv/lib/python3.6/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.6/socket.py", line 724, in create_connection
raise err
File "/usr/lib/python3.6/socket.py", line 713, in create_connection
sock.connect(sa)
socket.timeout: timed out
$ ../mqboard/mqboard --server mqtt.xxxxxx.com --verbose --timeout 60 --port 8883 --tls --prefix aiotcomqtt ls safemode
Connecting to mqtt.xxxxxx.com:8883
Subscribing to aiotcomqtt/mqb/reply/out/7q96YS_k and aiotcomqtt/mqb/reply/err/7q96YS_k
Pub aiotcomqtt/mqb/cmd/eval/7q96YS_k #0 last=True len=130
Received reply on topic 'aiotcomqtt/mqb/reply/out/7q96YS_k' with QoS 1
0.344kB in 0.744s -> 0.462kB/s
3992 board.py
2700 board_config.py
7488 logging.py
3644 main.py
13961 mqrepl.py
3556 mqtt.py
35638 mqtt_async.py
7273 sntp.py
3022 watchdog.py
(venv) fredrick@fredrick-Studio-XPS-435MT:~/Development/micropython/mqboard/blinky$