Browse through the questions and answers listed below or filter and sort to narrow down your results.
1
answers
0
votes
21
views
asked 21 days ago
GreenGrass V2 with ECC Keys in a Secure Element
How close is AWS in supporting pkcs11 ECC Keys in GreenGrass ?
We are using ATECC608B's from microchip with AWS-IoT and that is already supported if we use our own mosquitto broker on the device, But for GreenGrass V2 this won't work currently.
I see some pull requests for pkcs11 keys (and an announcement [here](https://repost.aws/questions/QUbB6kk6KVTIOvpWwBYp9-Vw/announcement-aws-io-t-greengrass-v-2-now-supports-the-use-of-hardware-security-modules-hsm)) and some for ECC so I assume it is on the Roadmap ? Is this a correct assumption ? And if so, is there a timeline that we can get ?
Accepted AnswerAWS IoT Greengrass
1
answers
0
votes
28
views
asked 22 days ago
How to use MQTT retained messages in custom Greengrass components?
Hello everyone,
I'd like to use MQTT retained messages in the Greengrass component. Is it possible?
The next [tutorial](https://docs.aws.amazon.com/iot/latest/developerguide/mqtt.html#mqtt-retain-using) says about retained messages. But there is nothing on how to set the retained flag in the documentation about IPC communication.
Accepted AnswerAWS IoT Greengrass
1
answers
0
votes
45
views
asked a month ago
greengrass logfile upload on demand
I have no need to upload all logfiles, of all Core Devices in a deployment group, all the time.
I would just like to ask for logs of a specific Device if things go wrong.
The documentation of [logmanager](https://docs.aws.amazon.com/greengrass/v2/developerguide/log-manager-component.html?icmpid=docs_gg_console) indicates that this is more of a permanent continuous logfile upload.
Is there an existing way to 'trigger' a single upload of all/selected greengrass logs ?
(using GG v2)
Accepted AnswerAWS IoT Greengrass
1
answers
0
votes
45
views
asked a month ago
Swap space being eaten up by greengrass
I see the following process on my GreenGrass device:
`java -Dlog.store=FILE -Dlog.store=FILE -Droot=/greengrass/v2 -jar /greengrass/v2/alts/current/distro/lib/Greengrass.jar --setup-system-service false`
is this the main greengrass service ?
I'm asking because it seems to use a lot of memory and seems to be growing all the time causing the swap memory to grow.
```
jeteye@jeteye:/data/rt$ sudo smem --sort=swap -r
PID User Command Swap USS PSS RSS
4525 root java -Dlog.store=FILE -Dlog 514860 353064 353386 354676
7067 ggc_user java -jar /greengrass/v2/pa 75560 2720 2986 3392
7957 root /usr/sbin/streamcontroller 57640 60192 61500 63172
6029 root /usr/bin/dockerd -H fd:// - 33704 21848 21848 21856
```
and eventually ( over 2.5+ hours) the swap process (kswapd0) is starting to take so much processor time that other processes (that need to handle live video) don't get enough time and restart (this is a guess..still collecting more information).
Is there a way to limit the amount of memory that GreenGrass uses over time ?
Accepted AnswerAWS IoT Greengrass
2
answers
0
votes
31
views
asked a month ago
Greengrass Python Lambda using awsiotsdk: No module named '_awscrt'
I'm trying to create a Greengrass Lambda function that publishes to an IPC topic using the the IoT SDK. My Lambda code includes:
```
from awsiot import greengrasscoreipc # type: ignore
from awsiot.greengrasscoreipc.model import ( # type: ignore
JsonMessage,
PublishMessage,
PublishToTopicRequest,
)
ipc_client = greengrasscoreipc.connect()
```
This leads to the following import error:
```
FATAL: lambda_runtime.py:426,Failed to initialize Lambda runtime due to exception: No module named '_awscrt'.
```
I can see that the Lambda artifact includes both `awscrt` and `awsiot` in `/greengrass/v2/packages/artifacts-unarchived/componentName/version/lambda-artifact/`, so I'm not sure why the import is failing.
I'm using a non-pinned Python 3.8 Lambda in NoContainer mode with LambdaManager v2.2.3, LambdaLauncher v2.0.10, and LambdaRuntimes v2.0.8
I have been able to use `awsiot` to publish to IPC topics in a non-Lambda component. That component runs a `pip install -r requirements.txt` command to install `awsiotsdk` to the site-packages for `ggc_user` during the install lifecycle, whereas the Lambda component is delivered to the device with its package dependencies included. Any ideas what I need to do differently? I haven't seen this problem yet with other Lambdas that have different dependencies.
Accepted AnswerAWS IoT Greengrass
1
answers
0
votes
32
views
asked 2 months ago
1
answers
0
votes
20
views
asked 2 months ago
Run a CLI inside a GreenGrass docker image
I have a few greengrass (docker) components that listen to IPC local topics.
I now want to test to see if they are actually responding to messages on the local topics so i've written a `greengrass_pub` application (similar to `mosquitto_pub`) so i can call:
`greengrass_pub --topic "local/topic" --payload "{ \"do_some\" : \"stuff\" } " `
to check if the other components pick this up.
I have also installed this greengrass_pub application in the docker image, so i should be able to start up another docker image.
Can i startup a docker image to run under the greengrass credentials so I have access to IPC in an interactive way **AND** have a command prompt where I can try different calls ?
How could I start this up ? ( like a docker interactive (-it) session ? )
note: this is only for development as a tool to check.(i have the greengrass cli installed)
Accepted AnswerAWS IoT Greengrass
2
answers
0
votes
13
views
asked 2 months ago
Greengrass Lambda with Compressed Binary Payload
I'm trying to configure a Greengrass Lambda to accept a binary encoding with the goal of sending a compressed JSON payload. My Lambda configuration looks something like:
```
"componentLambdaParameters": {
"inputPayloadEncodingType": "binary",
"eventSources": [
{
"topic": "my/topic",
"type": "IOT_CORE"
}
],
"linuxProcessParams": {
"isolationMode": "NoContainer"
},
"pinned": false
}
```
I'm using Python/Boto3 to send the messages, and the topic publish looks something like:
```
client = boto3.client("iot-data")
payload = gzip.compress(json.dumps({"large": "message"}).encode())
client.publish(topic="my/topic", qos=1, retain=True, payload=payload)
```
I get the following error from the Greengrass Lambda:
```
lambda_runtime.py:183,Cannot parse given invoke payload as JSON: b'my contents'
```
I can send the same message without compressing it (e.g. `payload = json.dumps({"large": "message"}).encode()`), and the Lambda succeeds. That suggests to me that `"inputPayloadEncodingType": "binary"` setting only works if the payload is encoded JSON, but that seems to defeat the purpose of using the binary payload option to send something other than JSON.
I'm using the Python 3.8 Lambda runtime with following component versions:
```
"aws.greengrass.LambdaLauncher": {
"componentVersion": "2.0.10"
},
"aws.greengrass.LambdaManager": {
"componentVersion": "2.2.2"
},
"aws.greengrass.LambdaRuntimes": {
"componentVersion": "2.0.8"
},
"aws.greengrass.Nucleus": {
"componentVersion": "2.5.5",
},
```
Is there something I might be doing wrong here or any other guidance on accepting a compressed payload? Thanks!
Accepted AnswerAWS IoT Greengrass
1
answers
0
votes
15
views
asked 2 months ago
How to write meta data in S3ExportTaskDefinition
Hi there,
I am trying to write meta data to a file and upload it to s3
here is what i have. I am not sure what is the correct format for the user_metadata
```
class MediaMeta(BaseModel):
data:str
s3_export_task_definition = S3ExportTaskDefinition(input_url=self.src_file_path,
bucket=self.bucket_name,
key=self.key_to_file,
user_metadata=meta_data.dict())
```
thanks for your help
Accepted AnswerAWS IoT Greengrass
1
answers
0
votes
7
views
asked 3 months ago
How to set environment variable for ggv2 components
Hi there,
I have tried
```
RecipeFormatVersion: '2020-01-25'
ComponentName: "{COMPONENT_NAME}"
ComponentVersion: "{COMPONENT_VERSION}"
ComponentDescription: ''
ComponentPublisher: "{COMPONENT_AUTHOR}"
ComponentConfiguration:
DefaultConfiguration:
secretArn: 'no_secret'
Manifests:
- Platform:
os: linux
Artifacts:
- URI: s3://BUCKET_NAME/COMPONENT_NAME/COMPONENT_VERSION/secret_loader.zip
Unarchive: ZIP
Lifecycle:
Setenv: SECRET_ARN={configuration:/secretArn}
Install: python3 -m pip install --user -r {artifacts:decompressedPath}/secret_loader/requirements.txt
Run: |
export SECRET_ARN={configuration:/secretArn}
python3 -u {artifacts:decompressedPath}/secret_loader/main.py
```
but still the component cant get the variable: `SECRET_ARN=os.getenv('SECRET_ARN')`
Accepted AnswerAWS IoT Greengrass
1
answers
0
votes
10
views
asked 3 months ago
AWS IOT GreenGrass Device Shadow versioning
Hi AWS community:
I'm using AWS GreenGrass device shadow service to store some data, I'm interested in version history of device shadow so I could inspect data change over time, does device shadow service support such thing out of box?
An alternative I'm exploring is finding out if device shadow supports any triggers so I can call lambda to record current device shadow document. (however I haven't found any documentations about this).
Any advices are appreciated.
Thank you
Accepted AnswerAWS IoT Greengrass
1
answers
0
votes
12
views
asked 3 months ago
How to import/share a lib/class between component in ggv2
Hi there,
I am just wondering is there a way that I can reuse my code between the component, kind of like lambda layer
eg:
```
foo
-- src
---- send_mqtt
foo2
-- src
---- send_mqtt
```
So how can i use request the send_mqtt ?
Thanks for your help
Accepted AnswerAWS IoT Greengrass
1
answers
0
votes
12
views
asked 3 months ago
Unable to deploy ggv2 component locally
Hi there,
I try to test my component locally, I have this AWS_ERROR_SUCCESS, what is this error btw ?
```
sudo /greengrass/v2/bin/greengrass-cli deployment create --recipeDir ~/Desktop/ms5/greengrass-build/recipes --artifactDir ~/Desktop/ms5/greengrass-build/artifacts --merge ms5=1.0.0
Mar 30, 2022 4:41:56 PM software.amazon.awssdk.eventstreamrpc.EventStreamRPCConnection$1 onConnectionSetup
INFO: Socket connection /greengrass/v2/ipc.socket:8033 to server result [AWS_ERROR_SUCCESS]
Mar 30, 2022 4:41:56 PM software.amazon.awssdk.eventstreamrpc.EventStreamRPCConnection$1 onProtocolMessage
INFO: Connection established with event stream RPC server
Local deployment submitted! Deployment Id: 7a45ceaf-8a5b-4c80-9c7e-cf74f4a35344
```
```
sudo /greengrass/v2/bin/greengrass-cli deployment status -i 7a45ceaf-8a5b-4c80-9c7e-cf74f4a35344
Mar 30, 2022 4:42:48 PM software.amazon.awssdk.eventstreamrpc.EventStreamRPCConnection$1 onConnectionSetup
INFO: Socket connection /greengrass/v2/ipc.socket:8033 to server result [AWS_ERROR_SUCCESS]
Mar 30, 2022 4:42:48 PM software.amazon.awssdk.eventstreamrpc.EventStreamRPCConnection$1 onProtocolMessage
INFO: Connection established with event stream RPC server
7a45ceaf-8a5b-4c80-9c7e-cf74f4a35344: FAILED
```
Accepted AnswerAWS IoT Greengrass
1
answers
0
votes
25
views
asked 3 months ago
Failure to monitor connection status of local client devices from IoT Core
I'm considering to monitor the connection status of all Greengrass core and client devices from the Fleet Hub.
When interacting with local client devices, Fleet indexing never updates the connection state of the client device.
I ran the sample Greengrass discovery application from the "Connect and test client devices" tutorial (https://docs.aws.amazon.com/greengrass/v2/developerguide/client-devices-tutorial.html). I was able to subscribe messages from client device by using MQTT test client, but connection status has been never updated.
The connection state was updated when publishing directly to an IoT Core service endpoint from the client device.
Can MQTT bridge component relay lifecycle events?
Accepted AnswerAWS IoT Greengrass
1
answers
0
votes
37
views
asked 3 months ago
Invalid Input: Encountered following errors in Artifacts: {s3://greengrass-tutorial/com.example.HelloWorld/1.1.0/helloWorld.zip = Specified artifact resource cannot be accessed}
I'm following these Youtube tutorials:
1. https://www.youtube.com/watch?v=hAZ-nlAaSvw&ab_channel=Michael
2. https://www.youtube.com/watch?v=hAZ-nlAaSvw&ab_channel=Michael
I was able to successfully deploy a component that printed "hello world!" based on the first YouTube tutorial. I had no problems reading from the s3 bucket.
I'm now deploying a new component version in the second tutorial. I have the following recipe:
```
---
RecipeFormatVersion: '2020-01-25'
ComponentName: com.example.HelloWorld
ComponentVersion: '1.1.0'
ComponentDescription: My first AWS IoT Greengrass component.
ComponentPublisher: Me
ComponentConfiguration:
DefaultConfiguration: {}
Manifests:
- Platform:
os: linux
Lifecycle:
Run:
PYTHONPATH="{artifacts:decompressedPath)/helloWorld/dependencies" python3 -u {artifacts:decompressedPath}/helloWorld/hello_world.py
Artifacts:
- URI: s3://greengrass-tutorial/com.example.HelloWorld/1.1.0/helloWorld.zip
Unarchive: ZIP
```
I have uploaded my helloWorld.zip to the greengrass-tutorial s3 bucket using the aws cli:
```
aws s3 cp ./helloWorld.zip s3://greengrass-tutorial/com.example.HelloWorld/1.1.0/helloWorld.zip
```
the helloWorld.zip contains hello_world.py and a dependencies folder.
When I click "Create version" I get the following error message: Invalid Input: Encountered following errors in Artifacts: {s3://greengrass-tutorial/com.example.HelloWorld/1.1.0/helloWorld.zip = Specified artifact resource cannot be accessed}
Would anyone be able to help me?
Accepted AnswerAWS IoT Greengrass
1
answers
0
votes
15
views
asked 3 months ago