Reputation: 1584
i am following this module lab: https://docs.aws.amazon.com/greengrass/latest/developerguide/module5.html
All previous ones run fine. Greengrass is on my RPi in the same network as my PC. RPi has 192.168.1.101 and i can ping it. Also I have "manually manage connection information" set with 1 only IP. When i start the Python script through: python lightController.py --endpoint ....
I get always this error:
2019-03-10 16:50:20,805 - AWSIoTPythonSDK.core.protocol.mqtt_core - INFO - Keep-alive:+ +600.000000 sec
Traceback (most recent call last):
File "lightController.py", line 203, in <module>
myAWSIoTMQTTShadowClient.connect()
.....
ConnectionRefusedError: WinError 10061 No connection could be made because the target machine actively refused it
I have no firewall or proxy between PC and RPi. Why is that error?
thanks lot
Upvotes: 0
Views: 391
Reputation: 43
I was facing the exact same issue. Turns out it was due to an incorrect root certificate. When you add the root certificate to the common folder (that includes the trafficlight.py file and the other shadow device certs and pems) and run the code, it creates a groupCA folder. I think, beyond a span of time between adding the root certificate to this folder and running the command, the token probably expires? In any case, I deleted the folder and ran the command again, and that fixed the issue.
Hope this helps someone out there.
Edit: Just went through the 'Note' in the Greengrass guide, and it mentions this line clearly:
The lightController.py and trafficLight.py scripts store connection information in the groupCA folder, which is created in the same folder as the scripts. If you receive connection errors, make sure that the IP address in the ggc-host file matches the single IP address endpoint that you configured for your core in this step.
Upvotes: 1