Pizzaface/Alexa-Chromecast-Skill-2.0

./start.sh not working

Opened this issue · 3 comments

When i run ./start.sh I get

2021-12-17 12:29:59,518 - root - INFO - Starting Alexa Chromecast listener...
2021-12-17 12:29:59,519 - local.ChromecastSkill - INFO - Finding Chromecasts...
2021-12-17 12:30:04,521 - pychromecast - INFO - Querying device status
2021-12-17 12:30:04,537 - local.ChromecastSkill - INFO - Found Dining Room TV
Traceback (most recent call last):
File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
exec(code, run_globals)
File "/home/tzvi/Documents/Alexa-Chromecast-Skill-2.0/src/local/main.py", line 40, in
chromecast_skill = Skill()
File "/home/tzvi/Documents/Alexa-Chromecast-Skill-2.0/src/local/ChromecastSkill.py", line 133, in init
self.chromecast_controller = ChromecastState()
File "/home/tzvi/Documents/Alexa-Chromecast-Skill-2.0/src/local/ChromecastSkill.py", line 113, in init
self.__set_chromecasts()
File "/home/tzvi/Documents/Alexa-Chromecast-Skill-2.0/src/local/ChromecastSkill.py", line 98, in __set_chromecasts
cc.wait()
File "/usr/local/lib/python3.9/dist-packages/pychromecast/init.py", line 446, in wait
if not self.socket_client.isAlive():
AttributeError: 'SocketClient' object has no attribute 'isAlive'

When i ran
aws-setup.sh
I wasn't asked for credentials, and I thought it was because my computer has it configured from before, is that the issue?

although I doubt it because when I ran that command I got

./aws-setup.sh
Creating AmazonAlexaSkill role.
Creating AlexaChromecastSkillCommands topic.
Creating alexa-user-persistence-tschams.
Creating AlexaChromecastSkill lambda function.
Building Lambda bundle.
Copying files to lambda-build ...
Running pip install ...
Collecting ask-sdk-s3-persistence-adapter==1.0.0
Using cached ask_sdk_s3_persistence_adapter-1.0.0-py2.py3-none-any.whl (6.6 kB)
Collecting boto3==1.14.8
Using cached boto3-1.14.8-py2.py3-none-any.whl (128 kB)
Collecting ask-sdk-core==1.13.0
Using cached ask_sdk_core-1.13.0-py2.py3-none-any.whl (45 kB)
Collecting botocore==1.17.8
Using cached botocore-1.17.8-py2.py3-none-any.whl (6.3 MB)
Collecting requests==2.24.0
Using cached requests-2.24.0-py2.py3-none-any.whl (61 kB)
Collecting ask-sdk-runtime>=1.1.0
Using cached ask_sdk_runtime-1.16.1-py2.py3-none-any.whl (25 kB)
Collecting ask-sdk-model>=1.0.0
Using cached ask_sdk_model-1.33.0-py2.py3-none-any.whl (937 kB)
Collecting python-dateutil
Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
Collecting s3transfer<0.4.0,>=0.3.0
Using cached s3transfer-0.3.7-py2.py3-none-any.whl (73 kB)
Collecting jmespath<1.0.0,>=0.7.1
Using cached jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Collecting urllib3<1.26,>=1.20
Using cached urllib3-1.25.11-py2.py3-none-any.whl (127 kB)
Collecting docutils<0.16,>=0.10
Using cached docutils-0.15.2-py3-none-any.whl (547 kB)
Collecting chardet<4,>=3.0.2
Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting idna<3,>=2.5
Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting certifi>=2017.4.17
Using cached certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
Collecting six>=1.10
Using cached six-1.16.0-py2.py3-none-any.whl (11 kB)
Installing collected packages: six, urllib3, python-dateutil, jmespath, docutils, idna, chardet, certifi, botocore, s3transfer, requests, ask-sdk-runtime, ask-sdk-model, boto3, ask-sdk-core, ask-sdk-s3-persistence-adapter
Successfully installed ask-sdk-core-1.13.0 ask-sdk-model-1.33.0 ask-sdk-runtime-1.16.1 ask-sdk-s3-persistence-adapter-1.0.0 boto3-1.14.8 botocore-1.17.8 certifi-2021.10.8 chardet-3.0.4 docutils-0.15.2 idna-2.10 jmespath-0.10.0 python-dateutil-2.8.2 requests-2.24.0 s3transfer-0.3.7 six-1.16.0 urllib3-1.25.11
Zipping files ...
Cleaning up ...
{
"FunctionName": "AlexaChromecastSkill",
"FunctionArn": "arn:aws:lambda:us-east-2:307277980090:function:AlexaChromecastSkill",
"Runtime": "python3.7",
"Role": "arn:aws:iam::307277980090:role/AmazonAlexaSkill",
"Handler": "lambda_function.main.lambda_handler",
"CodeSize": 11824675,
"Description": "",
"Timeout": 3,
"MemorySize": 128,
"LastModified": "2021-12-17T20:37:14.000+0000",
"CodeSha256": "KLysRVqtu5mYCC5gUEwqkgw9H4vUOHBEJn2Q+jZoNJ8=",
"Version": "$LATEST",
"Environment": {
"Variables": {
"AWS_S3_BUCKET": "alexa-user-persistence-tschams",
"AWS_SNS_ARN": "arn:aws:sns:us-east-2:307277980090:AlexaChromecastSkillCommands"
}
},
"TracingConfig": {
"Mode": "PassThrough"
},
"RevisionId": "31459a68-3c32-458d-bb36-bb6697813f3e",
"State": "Active",
"LastUpdateStatus": "InProgress",
"LastUpdateStatusReason": "The function is being created.",
"LastUpdateStatusReasonCode": "Creating",
"Architectures": [
"x86_64"
]
}
{
"Statement": "{"Sid":"1","Effect":"Allow","Principal":{"Service":"alexa-appkit.amazon.com"},"Action":"lambda:invokeFunction","Resource":"arn:aws:lambda:us-east-2:307277980090:function:AlexaChromecastSkill"}"
}
Done!

Next, go to https://developer.amazon.com/edw/home.html#/skills/list and create an Alexa Skill.
Lambda function ARN: arn:aws:lambda:us-east-2:307277980090:function:AlexaChromecastSkill

Then run the local handler.
SNS Topic ARN: arn:aws:sns:us-east-2:307277980090:AlexaChromecastSkillCommands

pychromecast has been fixed in home-assistant-libs/pychromecast#425

Thank you @tirkarthi for responding! So I would use that repo with its instructions for python 3.9? As I now for some reason can't find the file /usr/local/lib/python3.9/dist-packages/pychromecast/init.py to change just that word to is_alive to use this repo?

I get the same error message. Unfortunately, I don't understand what I can do to resolve this issue. I tried editing the file /usr/local/lib/python3.9/dist-packages/pychromecast/init.py where I changed isAlive to is_alive but this did not work as I still get the same error message. Is there another file that I can edit to solve this problem?