Hi, I am very much intreseted in greengrass, I came across below defined problem.
I am trying to update a greengrass group device from a lambda function online. I have attached the greengrasssdk along with my python program and uploaded it as .zip for setting up the lambda function. The python program is as below which i found on another thread here.
import greengrasssdk
import json
iot_client = greengrasssdk.client('iot-data')
def handler(event, context):
print event
thing_name = 'Raspberry_lights',
update_state = {
"state": {
"desired":{
"property":event["message"]
}
}
}
iot_client.update_thing_shadow(
thingName=thing_name,
payload=json.dumps(update_state),
)
But I get an import error as below,
Unable to import module 'updateshadows': No module named greengrass_common.function_arn_fields
updateshadows is the name of my lambda function. Also please let me know what all policies has to be attached to the role for this lambda function.
My device is 'synced to cloud'. Do i need to upload another packages along with greengrasssdk ? or should i add any additional subscriptions, i read that if you are trying to change the local device shadow from an lambda function online, you dont require any authentication and dont need to setup any subscriptions in greengrass group. Is it correct ? how should i solve this error ?
Edited by: jovel on Mar 26, 2019 8:18 AM