Mycroft-cli-client gets stuck on a connection refused error

I’m trying to get Picroft (raspbian-stretch_Picroft_2018-09-12) running on a new
Raspberry Pi 3 B+. The setup process goes fine until just after I set up my microphone when the setup script crashes with errors. Anytime I try to complete the setup by running mycroft-cli-client the script errors out within seconds. From reading the errors the script throws out it looks as if its trying to make a websocket connection and getting stuck on that step. Here is the output. Its the same error every time it try to run mycroft-cli-client :

**07:31:24.924 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/pi/mycroft-core/mycroft/configuration/mycroft.conf loaded**

** 07:31:25.066 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /home/pi/mycroft-core/mycroft/configuration/mycroft.conf loaded**
** 07:31:25.205 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /etc/mycroft/mycroft.conf loaded**
** 07:31:25.344 - mycroft.configuration.config:load_local:129 - DEBUG - Configuration ‘/home/pi/.mycroft/mycroft.conf’ not found**
** 07:31:25.356 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443**
** 07:31:26.139 - urllib3.connectionpool - DEBUG - https//api.mycroft.ai:443 “GET /v1/device/ HTTP/1.1” 301 106**
** 07:31:26.157 - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): api.mycroft.ai:80**
** 07:31:26.431 - urllib3.connectionpool - DEBUG - http//api.mycroft.ai:80 “GET /v1/device HTTP/1.1” 302 0**
** 07:31:26.454 - urllib3.connectionpool - DEBUG - Resetting dropped connection: api.mycroft.ai**
** 07:31:27.076 - urllib3.connectionpool - DEBUG - https//api.mycroft.ai:443 “GET /v1/device HTTP/1.1” 401 38**
** 07:31:27.090 - urllib3.connectionpool - DEBUG - Starting new HTTPS connection (1): api.mycroft.ai:443**
** 07:31:28.056 - urllib3.connectionpool - DEBUG - https://api.mycroft.ai:443 “GET /v1/auth/token HTTP/1.1” 401 38**
** 07:31:28.274 - mycroft.configuration.config:load_local:129 - DEBUG - Configuration ‘/var/tmp/mycroft_web_cache.json’ not found**
** 07:31:28.413 - mycroft.configuration.config:load_local:124 - DEBUG - Configuration /etc/mycroft/mycroft.conf loaded**
** 07:31:28.551 - mycroft.configuration.config:load_local:129 - DEBUG - Configuration ‘/home/pi/.mycroft/mycroft.conf’ not found**
** ^[=07:31:28.579 - mycroft.messagebus.client.ws:on_error:76 - ERROR - === ConnectionRefusedError(111, ‘Connection refused’) ===**
** Traceback (most recent call last):**
** File “/home/pi/mycroft-core/.venv/lib/python3.5/site-packages/websocket/_app.py”, line 168, in run_forever**
** host=host, origin=origin)**
** File “/home/pi/mycroft-core/.venv/lib/python3.5/site-packages/websocket/_core.py”, line 266, in connect**
** self.sock, addrs = connect(url, self.sock_opt, proxy_info(options))
** File “/home/pi/mycroft-core/.venv/lib/python3.5/site-packages/websocket/_http.py”, line 63, in connect**
** sock = _open_socket(addrinfo_list, options.sockopt, options.timeout)**
** File “/home/pi/mycroft-core/.venv/lib/python3.5/site-packages/websocket/_http.py”, line 116, in _open_socket**
** raise err**
** File “/home/pi/mycroft-core/.venv/lib/python3.5/site-packages/websocket/_http.py”, line 105, in _open_socket**
** sock.connect(address)**
** ConnectionRefusedError: [Errno 111] Connection refused**

Can anyone advise me how to fix this?

have you run start-mycroft.sh all before trying the cli?

Thank you. I tried running start-mycroft.sh before starting the cli interface, but it did not make a difference. Weirdly enough, the next day (and after several reboots) it apparently spontaneously connected to api.mycroft.ai. I was able to pair my Pi 3b+ and start using Mycroft.

Why it works now is still a mystery. Was api.mycroft.ai getting too many connection requests yesterday?