I am trying to store some sensor data to S3 from RPi using AWS Greengrass and Lambda running on the edge device.My code is very basic now with the objective of checking the S3 write. Though I am getting an exception for my lambda when I try to run my code in Greengrass(Though it works when I run the Lambda from console).
I am not able to understand why this is happening while the Lambda only runs in Greengrass environment but it does not give me the same issue while running the Lambda standalone.Any help will be very much appreciated.
I tried to reinstall Greengrass in the Raspberry Pi with no luck and also checked the Lambda permission but all seems correct to me.
import greengrasssdk
import platform
from threading import Timer
from botocore.exceptions import ClientError
import time
import boto3,logging
some_binary_data = b'Here we have some more data from BB'
s3 = boto3.resource('s3')
object = s3.Object('XXXXXX','Testing')
object.put(Body=some_binary_data)
Error Message:
The code abends while executing object.put(Body=some_binary_data)
[2019-07-19T11:13:19.749+02:00]
[FATAL]-lambda_runtime.py:353,Failed to initialize Lambda runtime due to
exception: An HTTP Client raised and unhandled exception:
'module' object has no attribute 'wait_for_read'.