Questions tagged with Internet of Things (IoT)
Content language: English
Sort by most recent
Hello, Nik here, I want to upload and update my normal python files to raspberry pi remotely (through OTA) using Greengrass core. Can anyone tell me, How can I do this with Greengrass, or is it possible to do by using AWS Greengrass?
Thank you
HI.
I am using IoT Core's LoRaWAN.
I want to limit the gateways and devices available to each user.
When logging into the console with that user, I want the management list view to show only the gateways and devices available to each user.
I have tried in the policy settings, but I can only set whether all gateways or devices are displayed or not.
When I ask ChatGPT they say it is possible, but the example provided does not work correctly.:-)
How can I make sure that only the gateways and devices that are visible for each user are listed?
thank you.
Hi,
I've been having issues getting the stream manager in my AWS Green Grass core device to relay the messages I send to my kinesis stream.
The core device is a raspberry pi zero, the green grass software is running and the stream manager is deployed and its status is running.
Here's the result of `sudo /greengrass/v2/bin/greengrass-cli component list`:
```
Jan 27, 2023 3:54:56 PM software.amazon.awssdk.eventstreamrpc.EventStreamRPCConnection$1 onConnectionSetup
INFO: Socket connection /greengrass/v2/ipc.socket:8033 to server result [AWS_ERROR_SUCCESS]
Jan 27, 2023 3:54:57 PM software.amazon.awssdk.eventstreamrpc.EventStreamRPCConnection$1 onProtocolMessage
INFO: Connection established with event stream RPC server
Components currently running in Greengrass:
Component Name: aws.greengrass.TokenExchangeService
Version: 2.0.3
State: RUNNING
Configuration: {"activePort":38663.0,"port":0.0}
Component Name: aws.greengrass.Nucleus
Version: 2.9.2
State: FINISHED
Configuration: {"awsRegion":"eu-west-2","componentStoreMaxSizeBytes":"10000000000","deploymentPollingFrequencySeconds":"15","envStage":"prod","fleetStatus":{"periodicStatusPublishIntervalSeconds":86400.0},"greengrassDataPlaneEndpoint":"","greengrassDataPlanePort":"8443","httpClient":{},"interpolateComponentConfiguration":false,"iotCredEndpoint":"c2bx7e6j9b2iiq.credentials.iot.eu-west-2.amazonaws.com","iotDataEndpoint":"aplnkvk1jetfv-ats.iot.eu-west-2.amazonaws.com","iotRoleAlias":"GreengrassCoreTokenExchangeRoleAlias","jvmOptions":"-Dlog.store=FILE","logging":{},"mqtt":{"spooler":{}},"networkProxy":{"proxy":{}},"platformOverride":{},"runWithDefault":{"posixShell":"sh","posixUser":"ggc_user:ggc_group"},"telemetry":{}}
Component Name: UpdateSystemPolicyService
Version: 0.0.0
State: RUNNING
Configuration: null
Component Name: aws.greengrass.Cli
Version: 2.9.2
State: RUNNING
Configuration: {"AuthorizedPosixGroups":null,"AuthorizedWindowsGroups":null}
Component Name: FleetStatusService
Version: 0.0.0
State: RUNNING
Configuration: null
Component Name: TelemetryAgent
Version: 0.0.0
State: RUNNING
Configuration: null
Component Name: DeploymentService
Version: 0.0.0
State: RUNNING
Configuration: null
Component Name: aws.greengrass.StreamManager
Version: 2.1.2
State: RUNNING
Configuration: {"JVM_ARGS":"","LOG_LEVEL":"INFO","port":"8088","STREAM_MANAGER_AUTHENTICATE_CLIENT":"false","STREAM_MANAGER_ENABLE_LOCK_ON_METADATA_STORE":"false","STREAM_MANAGER_EXPORTER_MAX_BANDWIDTH":"2147483647","STREAM_MANAGER_EXPORTER_S3_DESTINATION_MULTIPART_UPLOAD_MIN_PART_SIZE_BYTES":"5242880","STREAM_MANAGER_EXPORTER_THREAD_POOL_SIZE":"5","STREAM_MANAGER_SERVER_PORT":"8088","STREAM_MANAGER_STORE_ROOT_DIR":"."}
```
I've tested with the exact sample found here https://github.com/aws-greengrass/aws-greengrass-stream-manager-sdk-python/blob/main/samples/stream_manager_kinesis.py (substituting my own kinesis stream name). There are no errors reported and the code claims that data is successfully being placed in the stream.
The logs of stream manager don't really report anything though:
```
2023-01-27T13:40:51.752Z [INFO] (Copier) aws.greengrass.StreamManager: stdout. 2023 Jan 27 15:40:51,749 [INFO] (pool-4-thread-1) com.amazonaws.iot.greengrass.streammanager.server.GreengrassCoreV2SDKWrapper: Stream Manager emitting the V2 telemetry metric. {scriptName=services.aws.greengrass.StreamManager.lifecycle.startup.script, serviceName=aws.greengrass.StreamManager, currentState=RUNNING}
2023-01-27T13:42:51.785Z [INFO] (Copier) aws.greengrass.StreamManager: stdout. 2023 Jan 27 15:42:51,782 [INFO] (pool-4-thread-1) com.amazonaws.iot.greengrass.streammanager.server.GreengrassCoreV2SDKWrapper: Stream Manager emitting the V2 telemetry metric. {scriptName=services.aws.greengrass.StreamManager.lifecycle.startup.script, serviceName=aws.greengrass.StreamManager, currentState=RUNNING}
2023-01-27T13:44:51.818Z [INFO] (Copier) aws.greengrass.StreamManager: stdout. 2023 Jan 27 15:44:51,814 [INFO] (pool-4-thread-1) com.amazonaws.iot.greengrass.streammanager.server.GreengrassCoreV2SDKWrapper: Stream Manager emitting the V2 telemetry metric. {scriptName=services.aws.greengrass.StreamManager.lifecycle.startup.script, serviceName=aws.greengrass.StreamManager, currentState=RUNNING}
2023-01-27T13:46:51.862Z [INFO] (Copier) aws.greengrass.StreamManager: stdout. 2023 Jan 27 15:46:51,852 [INFO] (pool-4-thread-1) com.amazonaws.iot.greengrass.streammanager.server.GreengrassCoreV2SDKWrapper: Stream Manager emitting the V2 telemetry metric. {scriptName=services.aws.greengrass.StreamManager.lifecycle.startup.script, serviceName=aws.greengrass.StreamManager, currentState=RUNNING}
2023-01-27T13:48:51.899Z [INFO] (Copier) aws.greengrass.StreamManager: stdout. 2023 Jan 27 15:48:51,896 [INFO] (pool-4-thread-1) com.amazonaws.iot.greengrass.streammanager.server.GreengrassCoreV2SDKWrapper: Stream Manager emitting the V2 telemetry metric. {scriptName=services.aws.greengrass.StreamManager.lifecycle.startup.script, serviceName=aws.greengrass.StreamManager, currentState=RUNNING}
2023-01-27T13:50:51.924Z [INFO] (Copier) aws.greengrass.StreamManager: stdout. 2023 Jan 27 15:50:51,922 [INFO] (pool-4-thread-1) com.amazonaws.iot.greengrass.streammanager.server.GreengrassCoreV2SDKWrapper: Stream Manager emitting the V2 telemetry metric. {scriptName=services.aws.greengrass.StreamManager.lifecycle.startup.script, serviceName=aws.greengrass.StreamManager, currentState=RUNNING}
2023-01-27T13:52:51.949Z [INFO] (Copier) aws.greengrass.StreamManager: stdout. 2023 Jan 27 15:52:51,946 [INFO] (pool-4-thread-1) com.amazonaws.iot.greengrass.streammanager.server.GreengrassCoreV2SDKWrapper: Stream Manager emitting the V2 telemetry metric. {scriptName=services.aws.greengrass.StreamManager.lifecycle.startup.script, serviceName=aws.greengrass.StreamManager, currentState=RUNNING}
2023-01-27T13:54:51.991Z [INFO] (Copier) aws.greengrass.StreamManager: stdout. 2023 Jan 27 15:54:51,989 [INFO] (pool-4-thread-1) com.amazonaws.iot.greengrass.streammanager.server.GreengrassCoreV2SDKWrapper: Stream Manager emitting the V2 telemetry metric. {scriptName=services.aws.greengrass.StreamManager.lifecycle.startup.script, serviceName=aws.greengrass.StreamManager, currentState=RUNNING}
2023-01-27T13:56:52.038Z [INFO] (Copier) aws.greengrass.StreamManager: stdout. 2023 Jan 27 15:56:52,035 [INFO] (pool-4-thread-1) com.amazonaws.iot.greengrass.streammanager.server.GreengrassCoreV2SDKWrapper: Stream Manager emitting the V2 telemetry metric. {scriptName=services.aws.greengrass.StreamManager.lifecycle.startup.script, serviceName=aws.greengrass.StreamManager, currentState=RUNNING}
2023-01-27T13:58:52.065Z [INFO] (Copier) aws.greengrass.StreamManager: stdout. 2023 Jan 27 15:58:52,062 [INFO] (pool-4-thread-1) com.amazonaws.iot.greengrass.streammanager.server.GreengrassCoreV2SDKWrapper: Stream Manager emitting the V2 telemetry metric. {scriptName=services.aws.greengrass.StreamManager.lifecycle.startup.script, serviceName=aws.greengrass.StreamManager, currentState=RUNNING}
```
I've been thinking that it may be a permission issues (I've added full kinesis access to the roles I think are relevant), but I'm not seeing any evidence to confirm this. I read this issues on the stream manager client for python that suggested that https://github.com/aws-greengrass/aws-greengrass-stream-manager-sdk-python/issues/10.
Could anyone please provide suggestions on what they think I should try?
Hi,
I followed [this example](https://github.com/aws/amazon-sagemaker-examples/blob/main/sagemaker_neo_compilation_jobs/tensorflow_distributed_mnist/tensorflow_distributed_mnist_neo.ipynb) up to the point of training (`mnist_estimator.fit(inputs)`), then continued on the Console to compile the model for rasp4b, then package it as a Greengrass V2 component.
After deploying the component to a Raspberry Pi 4B, along with the SageMaker Edge Manager component, on asking the Edge Manager to load the model, there is an error. This is in the Edge Manager logs:
```log
2023-01-20T21:03:56.651Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:56.650][I] Validating SM Edge Cloud model. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:56.651Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:56.650][I] root certs folder /greengrass/v2/work/aws.greengrass.SageMakerEdgeManager/certs. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:56.653Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:56.653][I] Certificate chain is valid. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:56.653Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:56.653][I] Certificate chain is validated with root cert: /greengrass/v2/work/aws.greengrass.SageMakerEdgeManager/certs/eu-west-1.pem. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:56.653Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:56.653][I] Validating SM Edge Cloud model signature against the provided certificate chain. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:56.653Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:56.653][I] Extract Public key from certificate successfully. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:56.654Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:56.653][I] Extract model signature successfully. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:56.654Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:56.653][I] Verify init successfully..... {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:56.654Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:56.654][I] Digest verify succeed. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:56.654Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:56.654][I] Validating SM Edge Cloud model signature successfully. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:56.654Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:56.654][I] Blake2s256 hash /greengrass/v2/work/mnist-test//manifest successfuly.. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.603Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.603][I] Blake2s256 hash /greengrass/v2/work/mnist-test//code.ro successfuly.. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.604Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.603][I] Blake2s256 hash /greengrass/v2/work/mnist-test//compiled.meta successfuly.. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.611Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.610][I] Blake2s256 hash /greengrass/v2/work/mnist-test//compiled.so successfuly.. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.612Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.612][I] Blake2s256 hash /greengrass/v2/work/mnist-test//dlr.h successfuly.. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.857Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.857][I] Blake2s256 hash /greengrass/v2/work/mnist-test//libdlr.so successfuly.. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.858Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.858][I] Creating model object from /greengrass/v2/work/mnist-test/. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.858Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.858][I] executing LoadDLR. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.858Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.858][I] attempting to open dlr from /greengrass/v2/work/mnist-test//libdlr.so. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.859Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.858][I] Model will run on CPU. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.907Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.907][I] Created model object from /greengrass/v2/work/mnist-test/. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.908Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.907][I] backend name is relayvm. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.908Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.907][I] DLR backend = kRELAYVM. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.909Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.907][I] Finished populating metadata. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.909Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.907][I] Dynamic Ouput Tensor, querying for shape with backend. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.909Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.907][E] Output Shape of dynamic model not available, call after predict(). {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.909Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.907][E] failed to access output shape. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
2023-01-20T21:03:57.909Z [INFO] (Copier) aws.greengrass.SageMakerEdgeManager: stdout. {"version":"1.20220822.836f3023"}[2023-01-20T21:03:57.907][E] Failed to construct model meta, LoadModel request failed. {scriptName=services.aws.greengrass.SageMakerEdgeManager.lifecycle.run.script, serviceName=aws.greengrass.SageMakerEdgeManager, currentState=RUNNING}
```
The `compiled.meta` file, on the device, looks like this:
```json
{
"Requirements": {
"TargetDevice": "RASP4B",
"TargetDeviceType": "cpu"
},
"Compilation": {
"CreatedTime": 1674235990.142639
},
"Model": {
"Inputs": [
{
"name": "Placeholder",
"dtype": "float32",
"shape": [
null,
784
]
}
],
"Outputs": [
{
"name": "softmax_tensor:0",
"dtype": "float32",
"shape": [
-1,
10
]
}
]
}
}
```
I am unfamiliar with TensorFlow, and I don't know whether this error is something to do with the model itself, its Neo compilation, or Edge Manager.
Thank you for taking the time to read my problem, I'll be thankful for any help you can give.
I need to check in a lambda function if a thing (named X) is actually configured.
I was thinking on a function like listIotThings and check if X is contained in there.
The use case is to register a device in a mobile app, but should only be allowed if the thing is actually configured. So I go from the mobile app -> API Gateway -> lambda verification.
Any suggestion welcome.
We have devices already sending status information ( firmware version, wifi connection status, etc) on custom topic. At this point, We do not want to change our device firmware to directly send updates to device shadow but still want to utilize Fleet Hub for monitoring. In this case, Can we use rule engine and lambda function to receive status info from custom topic Convert into shadow document and republish it to device shadow topic ?
I have a custom device running FreeRTOS and Mbed-TLS. The device connects fine to the production IoT core endpoint and I can pub/sub to my hearts content; however, when I try to connect to the endpoint provided by the device advisor with a MQTT Connect testcase, it wont complete the TLS handshake. The log has two entries in it, the client hello and then a close-notify alert from the server. I tried using a little C# test application I wrote to connect to the same end point and that seems to work. I use the same method for both, the only difference is the device. I did decode the client hello my device is sending and I do not see anything obviously wrong.
At the point of pulling my hair out, any tips?
```
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 16 03 03 00 a4 01 00 00 a0 03 03 80 e3 df 37 83 |..............7.|
|00000010| 02 08 84 9d b0 6f e8 86 e9 e0 12 5e 77 f9 97 c6 |.....o.....^w...|
|00000020| af 62 cf 43 c6 40 63 c0 77 3a 82 00 00 04 c0 2b |.b.C.@c.w:.....+|
|00000030| 00 ff 01 00 00 73 00 00 00 47 00 45 00 00 42 74 |.....s...G.E..Bt|
|00000040| 34 31 31 62 39 36 32 35 37 74 33 6e 78 35 69 7a |411b96257t3nx5iz|
|00000050| 39 76 37 73 69 6a 73 2e 64 65 76 69 63 65 61 64 |9v7sijs.devicead|
|00000060| 76 69 73 6f 72 2e 69 6f 74 2e 75 73 2d 65 61 73 |visor.iot.us-eas|
|00000070| 74 2d 31 2e 61 6d 61 7a 6f 6e 61 77 73 2e 63 6f |t-1.amazonaws.co|
|00000080| 6d 00 0d 00 06 00 04 04 03 04 01 00 0a 00 0a 00 |m...............|
|00000090| 08 00 1d 00 17 00 18 00 19 00 0b 00 02 01 00 00 |................|
|000000a0| 10 00 06 00 04 03 90 03 9b |......... |
+--------+-------------------------------------------------+----------------+
```
```
TLS Record Sender SERVER ContentType ALERT Length 7 Timestamp 2022-12-19T18:08:58Z
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 15 03 03 00 02 01 00 |....... |
+--------+-------------------------------------------------+----------------+
```
```
16 03 03 00 a4
Record Header
16 - type is 0x16 (handshake record)
03 03 - protocol version is 3.3 (also known as TLS 1.2)
00 a4 - 0xA4 (164) bytes of handshake message follows
01 00 00 a0
01 - handshake message type 0x01 (client hello)
00 00 a0 - 0xA1 (160) bytes of client hello follows
03 03
The protocol version of "3,3" (meaning TLS 1.2) is given.
80 e3 df 37 83 02 08 84 9d b0 6f e8 86 e9 e0 12 5e 77 f9 97 c6 af 62 cf 43 c6 40 63 c0 77 3a 82
The client provides 32 bytes of random data.
00
Session id
00 - length of zero (no session id is provided)
00 04
Cipher Suites - 4 bytes of cipher suits follow
c0 2b
TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
00 ff
TLS_EMPTY_RENEGOTIATION_INFO_SCSV
01 00
01 - 0x1 (1) bytes of compression methods follows
00 - assigned value for no compression
00 73
00 73 - the extensions will take 0x73 (115) bytes of data
00 00
Server Name Extension
00 47
71 Bytes Follow
00 45
69 Bytes of list entry
00
List entry type is 0x00 "DNS Hostname"
00 42
66 Bytes of host name follow
74 34 31 31 62 39 36 32 35 37 74 33 6e 78 35 69 7a 39 76 37 73 69 6a 73 2e 64 65 76 69 63 6561 64 76 69 73 6f 72 2e 69 6f 74 2e 75 73 2d 65 61 73 74 2d 31 2e 61 6d 61 7a 6f 6e 61 77 73 2e 63 6f 6d
Hostname - "t411b96257t3nx5iz9v7sijs.deviceadvisor.iot.us-east-1.amazonaws.com"
00 0d
Signature Algorithms
00 06
6 Bytes follow
00 04
4 Bytes follow
04 03
ECDSA/SECP256r1/SHA256
04 01
RSA/PKCS1/SHA256
00 0a
Supported Groups
00 0a
10 bytes of "supported groups" extension data follows
00 08
8 Bytes of data are in the curves list
00 1d
x25519
00 17
secp256r1
00 18
secp384r1
00 19
secp521r1
00 0b
EC Point Formats
00 02
2 bytes of EC points format data follows
01
1 bytes of data are in the list
00
Assigned value for uncompressed format
```
* I have tried adding the ALPN and trying both ports 8883 and 443 - No Change
* I have tried a different test application which seems to work but there is nothing in the log the point as to what the difference between my device and the test device
* My device connects fine to the normal endpoint and functions as expected
* I would expect the device to connect to the Device Advisor endpoint.
I'm testing an example to subscribe to topic using Greengrass V2 and when I deploy lambda function works for a seconds and then I get this error:
**In greengrass.log:**
```
2022-12-10T01:58:15.724Z [DEBUG] (pool-7-thread-1) io.moquette.interception.BrokerInterceptor: Notifying MQTT PUBLISH message to interceptor. CId=ClienteDemoLab1, messageId=-1, topic=BlueMQTT/ClienteDemoLab1/0x00158d00054dc762, interceptorId=ClientDeviceConnectionTerminationListener. {}
2022-12-10T01:58:16.878Z [ERROR] (pool-1-thread-1) com.aws.greengrass.lambdamanager.WorkManager: work-item-timeout. lambda work item timed out. {workItem=c2f5ac43-c0a9-45ca-a54d-2ede26a45a40, arn=arn:aws:lambda:eu-west-1:812817525665:function:SubscribeToTopic:15}
2022-12-10T01:58:16.878Z [ERROR] (pool-1-thread-1) com.aws.greengrass.lambdamanager.UserLambdaService: service-errored. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=RUNNING}
com.aws.greengrass.lambdamanager.WorkItemTimeoutException: The work item with invocation id c2f5ac43-c0a9-45ca-a54d-2ede26a45a40 has timed out, worker lambda arn: arn:aws:lambda:eu-west-1:812817525665:function:SubscribeToTopic:15
at com.aws.greengrass.lambdamanager.WorkManager.lambda$getNextWork$12(WorkManager.java:332)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:829)
2022-12-10T01:58:16.879Z [DEBUG] (pool-1-thread-1) com.aws.greengrass.lambdamanager.UserLambdaService: service-report-state. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=RUNNING, newState=ERRORED}
2022-12-10T01:58:16.879Z [DEBUG] (pool-1-thread-1) com.aws.greengrass.lambdamanager.WorkManager: work-item-timeout. {InvocationType=Event, workItem=c2f5ac43-c0a9-45ca-a54d-2ede26a45a40, arn=arn:aws:lambda:eu-west-1:812817525665:function:SubscribeToTopic:15}
2022-12-10T01:58:16.879Z [INFO] (SubscribeToTopic-lifecycle) com.aws.greengrass.lambdamanager.UserLambdaService: service-set-state. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=RUNNING, newState=BROKEN}
```
**In lambda function error:**
```
2022-12-10T11:30:20.631Z [INFO] (pool-2-thread-454) SubscribeToTopic: shell-runner-start. {scriptName=services.SubscribeToTopic.lifecycle.shutdown.script, serviceInstance=0, serviceName=SubscribeToTopic, currentState=BROKEN, command=["/greengrass/v2/packages/artifacts/aws.greengrass.LambdaLauncher/2.0.10/lambda-..."]}
2022-12-10T11:30:20.633Z [DEBUG] (pool-2-thread-454) SubscribeToTopic: Created process with pid 20339. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=BROKEN}
2022-12-10T11:30:20.678Z [DEBUG] (pool-2-thread-455) SubscribeToTopic: Destroy process. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=BROKEN}
2022-12-10T11:30:20.679Z [DEBUG] (pool-2-thread-455) SubscribeToTopic: Process is running. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=BROKEN}
2022-12-10T11:30:20.679Z [DEBUG] (pool-2-thread-455) SubscribeToTopic: signal process {"pid": 20331, "signal": "terminated"}. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=BROKEN}
2022-12-10T11:30:20.684Z [INFO] (pool-2-thread-458) SubscribeToTopic: lambda_runtime.py:370,Caught signal 15. Stopping runtime.. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=BROKEN}
2022-12-10T11:30:20.894Z [DEBUG] (pool-2-thread-455) SubscribeToTopic: Process does not exist {"pid": 20331}. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=BROKEN}
2022-12-10T11:30:20.894Z [DEBUG] (pool-2-thread-455) SubscribeToTopic: Destroy container. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=BROKEN}
2022-12-10T11:30:20.894Z [DEBUG] (pool-2-thread-455) SubscribeToTopic: Run PostStop hooks. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=BROKEN}
2022-12-10T11:30:21.045Z [DEBUG] (pool-2-thread-455) SubscribeToTopic: Unmounting with arguments {"dest": "/greengrass/v2/work/SubscribeToTopic/work/dns", "flags": 0}. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=BROKEN}
2022-12-10T11:30:21.055Z [DEBUG] (pool-2-thread-455) SubscribeToTopic: Unmounting with arguments {"dest": "/greengrass/v2/work/SubscribeToTopic/work/worker/w7idbgAuneQwQlZic8eKzIPDyP2j2Jr-PP3AY4L2v7M/overlays", "flags": 0}. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=BROKEN}
2022-12-10T11:30:21.056Z [INFO] (pool-2-thread-458) SubscribeToTopic: Tearing down overlay tmpfs mounts. {serviceInstance=0, serviceName=SubscribeToTopic, currentState=BROKEN}
```
I tried to assing until 512MB of memory, and I checked it out of containers with the same response.
My function code is too simple, like samples:
```
import sys
import time
import traceback
import logging
from awsiot.greengrasscoreipc.clientv2 import GreengrassCoreIPCClientV2
from awsiot.greengrasscoreipc.model import (
SubscriptionResponseMessage,
UnauthorizedError
)
logger = logging.getLogger(__name__)
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG)
def lambda_handler(event, context):
print('Successfully BEGIN');
logger.info("SubscribeToTopic Lambda is ONLINE")
topic = "BlueMQTT/#"
try:
ipc_client = GreengrassCoreIPCClientV2()
# Subscription operations return a tuple with the response and the operation.
_, operation = ipc_client.subscribe_to_topic(topic=topic, on_stream_event=on_stream_event)
print('Successfully subscribed to topic: ' + topic)
# Keep the main thread alive, or the process will exit.
try:
while True:
time.sleep(10)
except InterruptedError:
print('Subscribe interrupted.')
# To stop subscribing, close the stream.
operation.close()
logger.info("SubscribeToTopic Lambda is END")
except UnauthorizedError:
print('Unauthorized error while subscribing to topic: ' +
topic, file=sys.stderr)
traceback.print_exc()
exit(1)
except Exception:
print('Exception occurred', file=sys.stderr)
traceback.print_exc()
exit(1)
return true;
def on_stream_event(event: SubscriptionResponseMessage) -> None:
try:
message = str(event.binary_message.message, 'utf-8')
topic = event.binary_message.context.topic
print('Received new message on topic %s: %s' % (topic, message))
except:
traceback.print_exc()
def on_stream_error(error: Exception) -> bool:
print('Received a stream error.', file=sys.stderr)
traceback.print_exc()
return False # Return True to close stream, False to keep stream open.
def on_stream_closed() -> None:
print('Subscribe to topic stream closed.')
```
Thanks
Need help with following use case. I am working on use case where I need tenant bifurcation on device. For e.g I have Tenant1 and Tenant 2. In Tenant 1 I have sell 3 devices and in Tenant 2 sold 5 devices.
To manager tenant I need to create logical group which I can achive through Thing Group.
**Tenant_Thing_Group1**
- Thing_1
- Thing_2
- Thing_3
**Tenant_Thing_Group2**
- Thing_4
- Thing_5
- Thing_6
- Thing_7
- Thing_8
Now I am going to use **AWS greengrass v2** for components deployment and all. I have taken greengrass setup in my yocto OS setup recipe. But as per my experience whenever we trigger greengraa v2 command to create deployment. It would create
individual deployment for each device. Instead of that I want to use the single deployment per tenant so I can deploy changes in single go to all the devices.
Could please guide me of provide some steps to address this requirement ??
Hi,
In Twinmaker we can define a link for a tag.
On the Grafana plugin, if we click on the tag then it redirects to the link in a new tab of the browser.
Is possible to configure the link to redirect directly in the same page (not in a new tab) of the brower?
Thank you
Hi,
In the configuration of the TwinMaker plugin in Grafana, we can define the scene which will be display into the dashboard.
Is possible the use a variable of the dashboard, to be able to select the scene dynamically?
Thank you
I have an existing application for video analysis. It can already run on localhost (e.g. localhost:3000). Now I'm trying to deploy it on AWS IoT Greengrass, and let this application run on a port of Greengrass (e.g. www.greengrass.com:3000).
Is it possible to do so? If yes, can anyone tell me the procedure and what program I need to install?
Thank you very much!!
P.S. I can only deploy it on Linux.