- Newest
- Most votes
- Most comments
Some help here would be appreciated. I reflashed my Raspberry Pi and did the tutorials again, only to find myself blocked with the same problem:
socket.error: (Errno 10061) No connection could be made because the target machine actively refused it
Additionally, I can ping my laptop machine from the Raspberry Pi and vice versa, so it looks like basic connectivity is established. And I confirmed that the Greengrass daemon is running.
Thanks in advance,
Steve
Edited by: silverage on Nov 3, 2019 4:27 PM
Hi Steve,
Do you have any firewall settings blocking the traffic on your local network and your computer?
Can you check the output of "telnet 192.168.1.125 8883"?
You could also try to run lightController.py script from the RPi, same host where the Greengras Core is running. Let me know if you see the same issue.
Thanks,
aws-hui
Hi,
Thanks for the reply. The Telnet connection looks normal so I dont think that a firewall is blocking things.
I have packaged the lightController.py script as a Lambda function, included the Lambda in my Greengrass group, created a subscription, and deployed the group. I am not clear however on how to verify that the Lambda is working as expected. My subscription is configured as follows:
Source: lightController (Lambda - long life)
Target: IoT Cloud
Topic: $aws/things/GG_TrafficLight/shadow/update
How do I then test the Lambda and confirm that it is working on the Raspberry Pi? In the lightController function code I could not find where it writes to a topic.
Thanks,
Steve
Edited by: silverage on Nov 13, 2019 5:28 PM
Hi silverage,
You can enable logs on your lambda functions and then monitor the logs to see the lambda get triggered and then publish on a topic.
https://docs.aws.amazon.com/greengrass/latest/developerguide/gg-troubleshooting.html#troubleshooting-logs
Thanks,
KR-AWS
Ok, I am seeing an error in lightController.log:
[2019-11-24T22:29:46.063Z][FATAL]-lambda_runtime.py:131,Failed to import handler function "lightController.function_handler" due to exception: No module named AWSIoTPythonSDK.MQTTLib
[2019-11-24T22:29:46.888Z][FATAL]-lambda_runtime.py:371,Failed to initialize Lambda runtime due to exception: No module named AWSIoTPythonSDK.MQTTLib
The directory structure for the Lambda function is lightController / greengrassdk / lightController.py
Also seeing the following in runtime.log:
[2019-11-24T22:43:50.26Z][INFO]-Worker Memory Usage (KB). {"workerId": "1713b1ce-c1fb-4bcd-4619-659b76bc253f", "funcArn": "arn:aws:lambda:us-west-2:468820349153:function:lightController:1", "memSize": 16384, "memUsed": 11304}
[2019-11-24T22:43:50.26Z][ERROR]-Worker is ungracefully killed. {"workerId": "1713b1ce-c1fb-4bcd-4619-659b76bc253f", "funcArn": "arn:aws:lambda:us-west-2:468820349153:function:lightController:1", "state": "exit status 1"}
Thanks,
Steve
Hi Silverage,
Make sure lightController.py is in the folder that contains greengrasssdk. See:
https://docs.aws.amazon.com/greengrass/latest/developerguide/create-lambda.html
Check the following commands:
which python2.7
Which version of python does your lambda use? This lambda requires python2.7.
Thanks,
KR-AWS
You appear to be missing the IoT SDK: https://pypi.org/project/AWSIoTPythonSDK/1.0.0/ . Go ahead and download that and include it with your lambda zip and it should start to work; or at least give a different error.
I was stuck in the same issue. Then I came upon a solution in stackoverflow I think. It asked me to delete the GroupCA folder that was created in my folder. The error was due to some certificate expiration. It worked for me
Relevant content
- Accepted Answerasked 5 months ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a year ago