Problem on server start
jas8472 opened this issue · 21 comments
Sorry very new to this, don't really know what this means.
Thanks
pi@pi:~/AlexaControlledSamsungTV $ python3 alexasmartcli.py start
Traceback (most recent call last):
File "alexasmartcli.py", line 181, in
mqtt_server.startServer(options.mute)
File "/home/pi/AlexaControlledSamsungTV/helpers/mqtt_server.py", line 204, in startServer
tv_json = json.load(json_data)
File "/usr/lib/python3.5/json/init.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.5/json/init.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 55 column 1 (char 1927)
it means your lineup.json file is in an invalid format. Did you run setup_cable command to generate it or did you make it yourself? also can you post the contents of your lineup.json file here
ok. if you post it here i will be able to fix it for you pretty easily if you dont want to do that.
Hi, It's not finished yet but this is what I have.
I added the .txt to make it upload.
oh i see. You have a trailing comma you need to delete on this last line:
["nkjr2", "nick junior two", "620", ""],
the very last one?
yea it should be
["nkjr2", "nick junior two", "620", ""]
Thanks I'll try it and let you know how I get on.
Still getting this.
pi@pi:~/AlexaControlledSamsungTV $ python3 alexasmartcli.py start -m
Traceback (most recent call last):
File "alexasmartcli.py", line 181, in
mqtt_server.startServer(options.mute)
File "/home/pi/AlexaControlledSamsungTV/helpers/mqtt_server.py", line 204, in startServer
tv_json = json.load(json_data)
File "/usr/lib/python3.5/json/init.py", line 268, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/usr/lib/python3.5/json/init.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.5/json/decoder.py", line 355, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 3 column 2 (char 38)
lineup.json.txt
oh i see. i think you miss understood. you need commas on every channel listing except the last one. like a 3 channel thing would look like:
[
["home", "home", "196", ""],
["life+1", "life time plus one", "197", ""],
["ptv", "property tv", "198", ""]
]
doh!
Well good news and bad news.
pi@pi:~/AlexaControlledSamsungTV $ python3 alexasmartcli.py start -m
starting server...
Traceback (most recent call last):
File "alexasmartcli.py", line 181, in
mqtt_server.startServer(options.mute)
File "/home/pi/AlexaControlledSamsungTV/helpers/mqtt_server.py", line 235, in startServer
myMQTTClient.connect()
File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/MQTTLib.py", line 408, in connect
return self._mqtt_core.connect(keepAliveIntervalSecond)
File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 168, in connect
self.connect_async(keep_alive_sec, self._create_blocking_ack_callback(event))
File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/mqtt_core.py", line 179, in connect_async
rc = self._internal_async_client.connect(keep_alive_sec, ack_callback)
File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/internal/clients.py", line 113, in connect
rc = self._paho_client.connect(host, port, keep_alive_sec)
File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 654, in connect
return self.reconnect()
File "/home/pi/.local/lib/python3.5/site-packages/AWSIoTPythonSDK/core/protocol/paho/client.py", line 776, in reconnect
sock = socket.create_connection((self._host, self._port), source_address=(self._bind_address, 0))
File "/usr/lib/python3.5/socket.py", line 694, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/lib/python3.5/socket.py", line 733, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution
Hmm umm not sure. that looks like a networking issue on your end. try restarting it?. you can also try running
python3 alexasmartcli.py reset
and then relogging in and and registering the device
looks like it might be a DNS issue on your device/network
Thanks for your help, I can't do any more tonight. I'll have to try again another time.
i looked more into it and im pretty sure that error means your pi is not connected to the internet when you start the server
it may be a networking issue with the AWS library.
see
aws/aws-iot-device-sdk-python#101
i would try first updating the package because the one in my requirements is 2 behind
so try
pip install AWSIoTPythonSDK --upgrade
and see the comment in the github issue
I have gotten confirmation that changing the DNS on your pi to 8.8.8.8 and 8.8.4.4 fixes this issue. Closing for now. If this issue comes up again and this doesn't fix it i will re open