Questions tagged with Internet of Things (IoT)

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Hello, I currently have an Ubuntu device running AWS Greengrass Core Device with different components installed. When trying to update the version of the public component aws.greengrass.clientdevices.mqtt.Bridge and other components the deploy fails. Reviewing the log file greengrass.log I discover the next error: ``` Failed to negotiate version with cloud and no local version to fall back to. {componentName=aws.greengrass.Nucleus, versionRequirement={aws.greengrass.LogManager=>=2.1.0 <2.8.0, aws.greengrass.Cli=>=2.5.0 <2.8.0, aws.greengrass.StreamManager=>=2.0.0 <2.6.0, aws.greengrass.clientdevices.IPDetector=>=2.2.0 <2.9.0, aws.greengrass.clientdevices.Auth=>=2.6.0 <2.9.0}} ``` The surprising thing is that it requires non-existing versions, like for the component aws.greengrass.clientdevices.IPDetector (latest version is 2.1.4) or aws.greengrass.clientdevices.Auth (latest version 2.2.3) Thank you very much in advance. All the best. Alberto
1
answers
0
votes
56
views
albdom
asked 5 months ago
Hi, I am in the early stages of building a CV demo using Qualcomm chipset and Greengrass V2. My app contains the following components components. ![Enter image description here](/media/postImages/original/IMSBZMNHSET3KEC1_Oa6cxDQ) My system is unable to do any inference though it is able to send empty MQTT packages to the cloud. I am seeing the following error when I am deploying a model using the variant.DLR '''2022-10-10T20:21:22.232Z [WARN] (Copier) variant.DLR: stderr. ++ PATH=/greengrass/v2/work/variant.DLR/greengrass_ml/greengrass_ml_dlr_venv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.232Z [WARN] (Copier) variant.DLR: stderr. ++ export PATH. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.232Z [WARN] (Copier) variant.DLR: stderr. ++ '[' -n '' ']'. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.233Z [WARN] (Copier) variant.DLR: stderr. ++ '[' -z '' ']'. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.233Z [WARN] (Copier) variant.DLR: stderr. ++ _OLD_VIRTUAL_PS1=. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.233Z [WARN] (Copier) variant.DLR: stderr. ++ '[' 'x(greengrass_ml_dlr_venv) ' '!=' x ']'. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.234Z [WARN] (Copier) variant.DLR: stderr. ++ PS1='(greengrass_ml_dlr_venv) '. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.234Z [WARN] (Copier) variant.DLR: stderr. ++ export PS1. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.234Z [WARN] (Copier) variant.DLR: stderr. ++ '[' -n /bin/bash -o -n '' ']'. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.235Z [WARN] (Copier) variant.DLR: stderr. ++ hash -r. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.235Z [WARN] (Copier) variant.DLR: stderr. ++ python3 -c 'try:. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.236Z [WARN] (Copier) variant.DLR: stderr. import dlr. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.236Z [WARN] (Copier) variant.DLR: stderr. print(dlr.__version__). {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.236Z [WARN] (Copier) variant.DLR: stderr. except Exception as e:. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.237Z [WARN] (Copier) variant.DLR: stderr. print(e)'. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.647Z [WARN] (Copier) variant.DLR: stderr. + get_dlr_version=1.6.0. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.647Z [INFO] (Copier) variant.DLR: stdout. Skipping DLR installation as it already exists.. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.648Z [WARN] (Copier) variant.DLR: stderr. + [[ 1.6.0 == \1\.\6\.\0 ]]. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} 2022-10-10T20:21:22.649Z [WARN] (Copier) variant.DLR: stderr. + return 0. {scriptName=services.variant.DLR.lifecycle.install.script, serviceName=variant.DLR, currentState=NEW} ''' Any help would be appreciated. Thanks,
0
answers
0
votes
34
views
asked 5 months ago
Hi. I have recently been deleting a few unused AWS things and two Greengrass core devices but noticed one particular core device will seemingly resurrect after being deleted. From my observations, the core device seems to stay deleted for a handful of hours and then will reappear in the AWS console and report its status as Healthy. When I navigate to the core device details, it specifically mentions: "This core device can't connect to AWS IoT Greengrass because its AWS IoT thing no longer exists. To fix this core device, set up a core device with the same name. Until you fix this core device, you can't edit its information on this page." For clarity, when I deleted the core device I also deleted the corresponding AWS thing (target), which has stayed deleted the entire time. I have deleted the core device multiple different times and have tried a different method each time (using the AWS console, using the AWS CLI, using my root account instead of a provisioned IAM account) so I am unsure how to proceed now. Can anyone offer solutions so that deleted devices will stay deleted? Thanks in advance.
1
answers
0
votes
39
views
mitty45
asked 5 months ago
We're starting to put our IoT Greengrass v2 devices into the field. Managing deployments using the AWS console has quickly become difficult with the overwhelming number of old deployments. * development deployments * testing deployments * inactive production deployments There is no way to filter or delete deployments. Even when the IoT thing had been deleted, we can't delete its associated deployment. Are AWS customers expected to have to build their own deployment management console for even the most basic filtering? When will we be able to delete an IoT Greengrass v2 deployment?
2
answers
0
votes
89
views
asked 5 months ago
Hi , I am receiving sequential data from IoT device and need to display status data real time on the dashboard. Currently receive MQTT data to IoT Core and push to AppSync mutation through Lambda(triggered by iot rule). Browser client subscribes to AppSync mutation and receives the data. QUESTION:I need to keep the order of events so that the data will be displayed sequentially . In case of lambda scales, I am not sure if order of the events will be kept for the same topic. Do I need to use FIFO like queue in order to prevent out of order events? Is Lambda(synchronous call) good to use between Iot Core and AppSync? Or can Browser client subscribe to IoT core directly, no AppSync? Thanks
1
answers
0
votes
48
views
asked 5 months ago
Hi Experts, Followed the latest documentation from this URL: https://docs.aws.amazon.com/iot/latest/developerguide/iot-ddb-rule.html, to create a rule to insert the received IOT data into DynamoDB. I am using the IOT test client to publish the MQTT data. Find the latest cloud watch logs generated for my last run. I did create a IAM Role with the sufficient privileges to allow the rule action to execute on behalf of me as per the documentation. Could you through some light on this issue? timestamp,message 1664986813614,"{""timestamp"":""2022-10-05 16:20:13.614"",""logLevel"":""INFO"",""traceId"":""3dcaa2fc-7d2f-8d68-f150-2301ba85ac2a"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""Subscribe"",""protocol"":""MQTT"",""topicName"":""device/+/data"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""principalId"":""406825964493"",""sourceIp"":""122.162.62.41"",""sourcePort"":65047}" 1664986842003,"{""timestamp"":""2022-10-05 16:20:42.003"",""logLevel"":""INFO"",""traceId"":""be0b67f4-a8dc-4be8-3e13-c361c264ed6b"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""RuleExecution"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""topicName"":""device/9/data"",""ruleName"":""wx_data_ddb"",""ruleAction"":""DynamoAction"",""resources"":{""ItemRangeKeyValue"":""9"",""IsPayloadJSON"":""true"",""ItemHashKeyField"":""sample_time"",""Operation"":""Insert"",""ItemRangeKeyField"":""device_id"",""Table"":""wx_data_1"",""ItemHashKeyValue"":""1664986841918""},""principalId"":""406825964493""}" 1664987544715,"{""timestamp"":""2022-10-05 16:32:24.715"",""logLevel"":""INFO"",""traceId"":""317c9fee-3f3c-2cee-ccc1-b8d7247a4b4a"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""Disconnect"",""protocol"":""MQTT"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""principalId"":""406825964493"",""sourceIp"":""122.162.62.41"",""sourcePort"":65047,""disconnectReason"":""MQTT_KEEP_ALIVE_TIMEOUT""}" Find the earlier runs related cloud watch logs as well below for your information. I am attaching the cloud watch logs as well, rule is executed successfully, but not find the data in the Database. Pasting the cloud watch logs for your information below. @timestamp,@message 2022-10-05 16:32:24.715,"{""timestamp"":""2022-10-05 16:32:24.715"",""logLevel"":""INFO"",""traceId"":""317c9fee-3f3c-2cee-ccc1-b8d7247a4b4a"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""Disconnect"",""protocol"":""MQTT"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""principalId"":""406825964493"",""sourceIp"":""122.162.62.41"",""sourcePort"":65047,""disconnectReason"":""MQTT_KEEP_ALIVE_TIMEOUT""}" 2022-10-05 16:20:42.003,"{""timestamp"":""2022-10-05 16:20:42.003"",""logLevel"":""INFO"",""traceId"":""be0b67f4-a8dc-4be8-3e13-c361c264ed6b"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""RuleExecution"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""topicName"":""device/9/data"",""ruleName"":""wx_data_ddb"",""ruleAction"":""DynamoAction"",""resources"":{""ItemRangeKeyValue"":""9"",""IsPayloadJSON"":""true"",""ItemHashKeyField"":""sample_time"",""Operation"":""Insert"",""ItemRangeKeyField"":""device_id"",""Table"":""wx_data_1"",""ItemHashKeyValue"":""1664986841918""},""principalId"":""406825964493""}" 2022-10-05 16:20:41.952,"{""timestamp"":""2022-10-05 16:20:41.952"",""logLevel"":""INFO"",""traceId"":""be0b67f4-a8dc-4be8-3e13-c361c264ed6b"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""RuleMatch"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""topicName"":""device/9/data"",""ruleName"":""wx_data_ddb"",""principalId"":""406825964493""}" 2022-10-05 16:20:41.952,"{""timestamp"":""2022-10-05 16:20:41.952"",""logLevel"":""DEBUG"",""traceId"":""be0b67f4-a8dc-4be8-3e13-c361c264ed6b"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""StartingRuleExecution"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""topicName"":""device/9/data"",""ruleName"":""wx_data_ddb"",""ruleAction"":""DynamoAction"",""principalId"":""406825964493""}" 2022-10-05 16:20:41.921,"{""timestamp"":""2022-10-05 16:20:41.921"",""logLevel"":""INFO"",""traceId"":""be0b67f4-a8dc-4be8-3e13-c361c264ed6b"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""Publish-In"",""protocol"":""MQTT"",""topicName"":""device/9/data"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""principalId"":""406825964493"",""sourceIp"":""122.162.62.41"",""sourcePort"":65047}" 2022-10-05 16:20:41.917,"{""timestamp"":""2022-10-05 16:20:41.917"",""logLevel"":""INFO"",""traceId"":""de1383c6-4551-8b90-948f-8d7b26641db5"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""Publish-Out"",""protocol"":""MQTT"",""topicName"":""device/9/data"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""principalId"":""406825964493"",""sourceIp"":""122.162.62.41"",""sourcePort"":65047}" 2022-10-05 16:20:41.281,"{""timestamp"":""2022-10-05 16:20:41.281"",""logLevel"":""INFO"",""traceId"":""6da17ec1-5786-d2e7-7a49-3ec7a4b77076"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""RuleExecution"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""topicName"":""device/9/data"",""ruleName"":""wx_data_ddb"",""ruleAction"":""DynamoAction"",""resources"":{""ItemRangeKeyValue"":""9"",""IsPayloadJSON"":""true"",""ItemHashKeyField"":""sample_time"",""Operation"":""Insert"",""ItemRangeKeyField"":""device_id"",""Table"":""wx_data_1"",""ItemHashKeyValue"":""1664986841195""},""principalId"":""406825964493""}" 2022-10-05 16:20:41.230,"{""timestamp"":""2022-10-05 16:20:41.230"",""logLevel"":""DEBUG"",""traceId"":""6da17ec1-5786-d2e7-7a49-3ec7a4b77076"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""StartingRuleExecution"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""topicName"":""device/9/data"",""ruleName"":""wx_data_ddb"",""ruleAction"":""DynamoAction"",""principalId"":""406825964493""}" 2022-10-05 16:20:41.230,"{""timestamp"":""2022-10-05 16:20:41.230"",""logLevel"":""INFO"",""traceId"":""6da17ec1-5786-d2e7-7a49-3ec7a4b77076"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""RuleMatch"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""topicName"":""device/9/data"",""ruleName"":""wx_data_ddb"",""principalId"":""406825964493""}" 2022-10-05 16:20:41.200,"{""timestamp"":""2022-10-05 16:20:41.200"",""logLevel"":""INFO"",""traceId"":""6da17ec1-5786-d2e7-7a49-3ec7a4b77076"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""Publish-In"",""protocol"":""MQTT"",""topicName"":""device/9/data"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""principalId"":""406825964493"",""sourceIp"":""122.162.62.41"",""sourcePort"":65047}" 2022-10-05 16:20:41.188,"{""timestamp"":""2022-10-05 16:20:41.188"",""logLevel"":""INFO"",""traceId"":""abf5eb8c-c852-a31a-4850-b55d234c208c"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""Publish-Out"",""protocol"":""MQTT"",""topicName"":""device/9/data"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""principalId"":""406825964493"",""sourceIp"":""122.162.62.41"",""sourcePort"":65047}" 2022-10-05 16:20:37.360,"{""timestamp"":""2022-10-05 16:20:37.360"",""logLevel"":""INFO"",""traceId"":""445a948f-290c-c378-f9b6-bd3147de9fa9"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""RuleExecution"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""topicName"":""device/9/data"",""ruleName"":""wx_data_ddb"",""ruleAction"":""DynamoAction"",""resources"":{""ItemRangeKeyValue"":""9"",""IsPayloadJSON"":""true"",""ItemHashKeyField"":""sample_time"",""Operation"":""Insert"",""ItemRangeKeyField"":""device_id"",""Table"":""wx_data_1"",""ItemHashKeyValue"":""1664986837260""},""principalId"":""406825964493""}" 2022-10-05 16:20:37.293,"{""timestamp"":""2022-10-05 16:20:37.293"",""logLevel"":""INFO"",""traceId"":""445a948f-290c-c378-f9b6-bd3147de9fa9"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""RuleMatch"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""topicName"":""device/9/data"",""ruleName"":""wx_data_ddb"",""principalId"":""406825964493""}" 2022-10-05 16:20:37.293,"{""timestamp"":""2022-10-05 16:20:37.293"",""logLevel"":""DEBUG"",""traceId"":""445a948f-290c-c378-f9b6-bd3147de9fa9"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""StartingRuleExecution"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""topicName"":""device/9/data"",""ruleName"":""wx_data_ddb"",""ruleAction"":""DynamoAction"",""principalId"":""406825964493""}" 2022-10-05 16:20:37.263,"{""timestamp"":""2022-10-05 16:20:37.263"",""logLevel"":""INFO"",""traceId"":""445a948f-290c-c378-f9b6-bd3147de9fa9"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""Publish-In"",""protocol"":""MQTT"",""topicName"":""device/9/data"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""principalId"":""406825964493"",""sourceIp"":""122.162.62.41"",""sourcePort"":65047}" 2022-10-05 16:20:37.253,"{""timestamp"":""2022-10-05 16:20:37.253"",""logLevel"":""INFO"",""traceId"":""4d2bd3fa-0830-0b41-a51c-68d868134cbb"",""accountId"":""406825964493"",""status"":""Success"",""eventType"":""Publish-Out"",""protocol"":""MQTT"",""topicName"":""device/9/data"",""clientId"":""iotconsole-a4040030-a732-4e0e-a234-5277b8bb852f"",""principalId"":""406825964493"",""sourceIp"":""122.162.62.41"",""sourcePort"":65047}"
2
answers
0
votes
60
views
asked 6 months ago
I fail to run the sample [basic-connect](https://github.com/aws/aws-iot-device-sdk-cpp-v2/tree/main/samples/mqtt/basic_connect). i receive: ``` [ERROR] [2022-10-05T13:09:04Z] [00005b28] [socket] - id=000001C5BE6C1E30 handle=0000000000000214: connect completion triggered with error -1073741252 [ERROR] [2022-10-05T13:09:04Z] [00005b28] [socket] - id=000001C5BE6C1E30 handle=0000000000000214: connection error with code 1049 Connection failed with error libaws-c-mqtt: AWS_ERROR_MQTT_UNEXPECTED_HANGUP, The connection was closed unexpectedly. Connection failed ``` When I run: > basic-connect.exe --client_id "ME" --endpoint "[...]-ats.iot.eu-west-1.amazonaws.com" --cert "[...]/Certificate.crt" --key "[...]/private.key" --verbosity "Info" Full output: ``` [INFO] [2022-10-05T13:09:04Z] [00007020] [pki-utils] - static: loading certificate chain with 3 certificates. Connecting... [INFO] [2022-10-05T13:09:04Z] [00007020] [mqtt-client] - id=000001C5BE6AE5F0: using ping timeout of 3000000000 ns [INFO] [2022-10-05T13:09:04Z] [00007020] [thread] - id=000001C5BE69BFD0: cpu affinity of cpu_id 0 was specified, attempting to honor the value. [INFO] [2022-10-05T13:09:04Z] [00005bd8] [socket] - static: initializing WinSock [INFO] [2022-10-05T13:09:04Z] [00005bd8] [socket] - static: loading WSAID_CONNECTEX function [INFO] [2022-10-05T13:09:04Z] [00005bd8] [socket] - static: loading WSAID_ACCEPTEX function [ERROR] [2022-10-05T13:09:04Z] [00005b28] [socket] - id=000001C5BE6C1E30 handle=0000000000000214: connect completion triggered with error -1073741252 [ERROR] [2022-10-05T13:09:04Z] [00005b28] [socket] - id=000001C5BE6C1E30 handle=0000000000000214: connection error with code 1049 [INFO] [2022-10-05T13:09:04Z] [00005b28] [dns] - id=000001C5BE66C600: recording failure for record 2a01:578:3::22f6:70e6 for [...].eu-west-1.amazonaws.com, moving to bad list Connection failed with error libaws-c-mqtt: AWS_ERROR_MQTT_UNEXPECTED_HANGUP, The connection was closed unexpectedly. [INFO] [2022-10-05T13:09:05Z] [00005b28] [mqtt-client] - id=000001C5BE6AE5F0: sending disconnect message as part of graceful shutdown. Connection failed [...]basic_connect\build\x64-Debug\basic-connect.exe (process 30292) exited with code -1. ``` Why is there an overflow ("-1073741252")? I identified 1049 to be "AWS_IO_SOCKET_NO_ROUTE_TO_HOST", what does that mean? Why is the connection not successful? I am using msbuild & win10.
1
answers
0
votes
85
views
asked 6 months ago
I am trying to set up MQTT based file delivery. See attached screenshot for details. Procedure: 1. Publish DescribeStream request to describe-topic. 2. Publish GetStream request to get-topic with fileID supplied by description topic. 3. Request rejected based on fileID. Policies on device (italics are dummy values): * Allow - iot:Receive, Publish - arn:aws:iot:*myregion*:*123123123*:topic/$aws/things/*thingName*/streams/* * Allow - iot:Subscribe - arn:aws:iot:*myregion*:*123123123*:topicfilter/$aws/things/*thingName*/streams/* * Allow - iot:Connect - arn:aws:iot:*myregion*:*123123123*:client/*clientName* Other * Sensored thingnames on image are identical * Region on device and bucket/file are identical * Behaviour on device is identical to MQTT test client * All other MQTT operations I have tried work as expected I cannot understand what I'm doing wrong here, and I was not able to find any information on the ResourceNotFound rejection in the docs. I know that the stream works on boto3. I have set up different streams, same error. I have tried altering the request JSON, but then I get different errors eg. json format error, value type error, wrong stream version etc. If anyone has any experience with this please share. EDIT: Listed wrong arn for subscribe for sub policy. Was *topic*, is *topicfilter*. ![mqtt test client log](/media/postImages/original/IMk_11C4ILTxazy9obuBPMAQ)
2
answers
0
votes
77
views
asked 6 months ago
Hello, I'm currently running into some trouble setting up an IoT Core MQTT broker. I am able to connect to my broker using my terminal and mosquitto, but when I try to publish a message to any topic, the mosquitto client disconnects and reconnects without being able to publish. I have validated this connect/disconnect behaviour through the `$aws/events/presence/# topic` and the mosquitto client in debug mode for which I can provide a sample output : ``` Client william_terminal sending CONNECT Client william_terminal received CONNACK (0) HELLO Client william_terminal sending PUBLISH (d0, q0, r0, m1, 'test', ... (5 bytes)) Client william_terminal sending CONNECT Client william_terminal received CONNACK (0) ``` Using the AWSIotLogs set at debug level, I was able to find out that this behaviour is caused by an authorization problem happening at publish time. Here are consecutively sampled logs for the stream : ``` { "timestamp": "2022-09-29 15:16:55.406", "logLevel": "INFO", "traceId": "5697ba84-38f7-eefc-08e9-b6dd00096727", "accountId": "673559919736", "status": "Success", "eventType": "Connect", "protocol": "MQTT", "clientId": "$GEN/af403525-5e3b-4f81-9888-a31f16e300f0", "principalId": "49964471e92f354742f5394e648c97d9ac3aa940081cccf0962918bf97fcdf09", "sourceIp": "10.240.100.18", "sourcePort": 46898 } { "timestamp": "2022-09-29 15:16:59.554", "logLevel": "ERROR", "traceId": "067b15e5-9bcb-5c6d-2061-9bbefbccb3d0", "accountId": "673559919736", "status": "Failure", "eventType": "Publish-In", "protocol": "MQTT", "topicName": "sim/2", "clientId": "$GEN/af403525-5e3b-4f81-9888-a31f16e300f0", "principalId": "49964471e92f354742f5394e648c97d9ac3aa940081cccf0962918bf97fcdf09", "sourceIp": "10.240.100.18", "sourcePort": 46898, "reason": "AUTHORIZATION_FAILURE", "details": "Authorization Failure" } ``` The certificates I use to authenticate to my account have the following policy attached : ``` { "Statement": [ { "Action": [ "iot:Connect" ], "Condition": { "Bool": { "iot:Connection.Thing.IsAttached": [ "true" ] } }, "Effect": "Allow", "Resource": "*" }, { "Action": [ "iot:Publish" ], "Effect": "Allow", "Resource": "*" }, { "Action": [ "iot:Subscribe" ], "Effect": "Allow", "Resource": "*" }, { "Action": [ "iot:Receive" ], "Effect": "Allow", "Resource": "*" } ], "Version": "2012-10-17" } ``` The only restrictive part of this permissions being set on the connection action, I don't understand how it is possible to have a publication authorization failure. I will deeply appreciate any help on this topic. Cheers, William Didier
3
answers
0
votes
96
views
asked 6 months ago
I have a Greengrass device setup that I'm trying to get SSH tunneling working on but needs a service role associated with my account if I'm understanding that correctly. In AWS IoT > Settings > Greengrass service role, there is no role attached. Clicking attach gives just an empty dropdown box. I've tried creating a role named "Greengrass_ServiceRole" and attaching the AWS managed "AWSGreengrassResourceAccessRolePolicy", but it still doesn't show up in that dropdown box for Greengrass service role. Based on the docs, this role would be created for me if I used Greengrass V1, but I'm starting from scratch here, do I need to setup my device using V1 just to get things like this setup? https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-service-role.html ``` 2022-10-03T13:35:26.500Z [INFO] (pool-2-thread-15) aws.greengrass.SecureTunneling: shell-runner-start. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=STARTING, command=["java -jar /greengrass/v2/packages/artifacts/aws.greengrass.SecureTunneling/1.0..."]} 2022-10-03T13:35:30.626Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. [INFO ] 2022-10-03 08:35:30.610 [main] SecureTunneling - Starting secure tunneling component!. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:31.607Z [WARN] (Copier) aws.greengrass.SecureTunneling: stderr. Oct 03, 2022 8:35:31 AM software.amazon.awssdk.eventstreamrpc.EventStreamRPCConnection$1 onConnectionSetup. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:31.607Z [WARN] (Copier) aws.greengrass.SecureTunneling: stderr. INFO: Socket connection /greengrass/v2/ipc.socket:8033 to server result [AWS_ERROR_SUCCESS]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:32.001Z [WARN] (Copier) aws.greengrass.SecureTunneling: stderr. Oct 03, 2022 8:35:32 AM software.amazon.awssdk.eventstreamrpc.EventStreamRPCConnection$1 onProtocolMessage. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:32.001Z [WARN] (Copier) aws.greengrass.SecureTunneling: stderr. INFO: Connection established with event stream RPC server. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:32.005Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. [INFO ] 2022-10-03 08:35:32.005 [main] SecureTunnelingExecutor - Starting secure tunneling.. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.928Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. [ERROR] 2022-10-03 08:35:48.928 [Thread-1] SecureTunnelingTask - Execution exception while subscribing to topic: $aws/things/TestLocalBaseStation/tunnels/notify. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.940Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.948Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. [INFO ] 2022-10-03 08:35:48.947 [Thread-1] SubscribeResponseHandler - Subscribe to topic stream closed.. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.952Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. [INFO ] 2022-10-03 08:35:48.951 [Thread-1] SubscribeResponseHandler - Subscribe to topic stream closed.. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.991Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. [ERROR] 2022-10-03 08:35:48.936 [main] SecureTunnelingExecutor - Exception while running secure tunneling.. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.991Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. java.util.concurrent.ExecutionException: software.amazon.awssdk.aws.greengrass.model.ServiceError: Subscribe to topic $aws/things/TestLocalBaseStation/tunnels/notify failed with error java.util.concurrent.ExecutionException: software.amazon.awssdk.crt.mqtt.MqttException: Host name was invalid for dns resolution.. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.991Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395) ~[?:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.991Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2069) ~[?:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.991Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at com.aws.greengrass.component.securetunneling.executor.SecureTunnelingExecutor.runSecureTunneling(SecureTunnelingExecutor.java:50) ~[GreengrassV2SecureTunnelingComponent-1.0-all.jar:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.992Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at com.aws.greengrass.component.securetunneling.SecureTunneling.main(SecureTunneling.java:38) ~[GreengrassV2SecureTunnelingComponent-1.0-all.jar:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.992Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. Caused by: software.amazon.awssdk.aws.greengrass.model.ServiceError: Subscribe to topic $aws/things/TestLocalBaseStation/tunnels/notify failed with error java.util.concurrent.ExecutionException: software.amazon.awssdk.crt.mqtt.MqttException: Host name was invalid for dns resolution.. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.992Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.992Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:78) ~[?:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.992Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.992Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.992Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.993Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at com.google.gson.internal.ConstructorConstructor$4.construct(ConstructorConstructor.java:140) ~[GreengrassV2SecureTunnelingComponent-1.0-all.jar:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.993Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:211) ~[GreengrassV2SecureTunnelingComponent-1.0-all.jar:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.993Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at software.amazon.awssdk.eventstreamrpc.EventStreamRPCServiceModel$EventStreamPostFromJsonTypeAdapter.read(EventStreamRPCServiceModel.java:87) ~[GreengrassV2SecureTunnelingComponent-1.0-all.jar:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.993Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at software.amazon.awssdk.eventstreamrpc.EventStreamRPCServiceModel$EventStreamPostFromJsonTypeAdapter.read(EventStreamRPCServiceModel.java:61) ~[GreengrassV2SecureTunnelingComponent-1.0-all.jar:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.993Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at com.google.gson.Gson.fromJson(Gson.java:991) ~[GreengrassV2SecureTunnelingComponent-1.0-all.jar:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.993Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at com.google.gson.Gson.fromJson(Gson.java:956) ~[GreengrassV2SecureTunnelingComponent-1.0-all.jar:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.993Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at com.google.gson.Gson.fromJson(Gson.java:905) ~[GreengrassV2SecureTunnelingComponent-1.0-all.jar:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.994Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at com.google.gson.Gson.fromJson(Gson.java:876) ~[GreengrassV2SecureTunnelingComponent-1.0-all.jar:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.994Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at software.amazon.awssdk.eventstreamrpc.EventStreamRPCServiceModel.fromJson(EventStreamRPCServiceModel.java:319) ~[GreengrassV2SecureTunnelingComponent-1.0-all.jar:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.994Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at software.amazon.awssdk.eventstreamrpc.EventStreamRPCClient$1.onContinuationMessage(EventStreamRPCClient.java:92) ~[GreengrassV2SecureTunnelingComponent-1.0-all.jar:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:48.994Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. at software.amazon.awssdk.crt.eventstream.ClientConnectionContinuationHandler.onContinuationMessageShim(ClientConnectionContinuationHandler.java:41) ~[GreengrassV2SecureTunnelingComponent-1.0-all.jar:?]. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} 2022-10-03T13:35:50.351Z [INFO] (Copier) aws.greengrass.SecureTunneling: Run script exited. {exitCode=1, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING} ```
1
answers
0
votes
53
views
asked 6 months ago
I failed to run the sample code for [basic_connect](https://github.com/aws/aws-iot-device-sdk-cpp-v2/tree/main/samples/mqtt/basic_connect). While running it with the following argument: `basic_connect.exe --client_id "ME" --endpoint "*-ats.iot.eu-west-1.amazonaws.com" --cert "<>/MyCertificate.crt" --key "<>/MyPrivate.key" --verbosity "Debug"` i receive the following output: ``` [DEBUG] [2022-09-29T13:02:54Z] [00001648] [mqtt-client] - client=*: Initalizing MQTT client [DEBUG] [2022-09-29T13:02:56Z] [00001648] [tls-handler] - static: This library was built with Windows 8.1 or later, probing OS to see what we're actually running on. [DEBUG] [2022-09-29T13:02:56Z] [00001648] [tls-handler] - static: We're running on Windows 8.1 or later. ALPN is available. [DEBUG] [2022-09-29T13:02:56Z] [00001648] [tls-handler] - static: This library was built with Windows 8.1 or later, probing OS to see what we're actually running on. [DEBUG] [2022-09-29T13:02:56Z] [00001648] [tls-handler] - static: We're running on Windows 8.1 or later. ALPN is available. [DEBUG] [2022-09-29T13:02:56Z] [00001648] [tls-handler] - static: certificate and key have been set, setting them up now. [INFO] [2022-09-29T13:02:56Z] [00001648] [pki-utils] - static: loading certificate chain with 1 certificates. [ERROR] [2022-09-29T13:03:04Z] [00001648] [pki-utils] - static: no acceptable private key found, error AWS_IO_FILE_VALIDATION_FAILURE [ERROR] [2022-09-29T13:03:04Z] [00001648] [tls-handler] - static: failed to import certificate and private key with error 1038. Client Configuration initialization failed with error aws-c-io: AWS_IO_FILE_VALIDATION_FAILURE, A file was read and the input did not match the expected value ``` I have been trying to follow this AWS_IO_FILE_VALIDATION_FAILURE, and i endup with the following callstack: ``` basic-connect.exe!aws_import_key_pair_to_cert_context(aws_allocator * alloc, const aws_byte_cursor * public_cert_chain, const aws_byte_cursor * private_key, bool is_client_mode, void * * store, const _CERT_CONTEXT * * certs, unsigned __int64 * crypto_provider, unsigned __int64 * private_key_handle) Line 691 C basic-connect.exe!s_ctx_new(aws_allocator * alloc, const aws_tls_ctx_options * options, bool is_client_mode) Line 2010 C basic-connect.exe!aws_tls_client_ctx_new(aws_allocator * alloc, const aws_tls_ctx_options * options) Line 2044 C basic-connect.exe!Aws::Crt::Io::TlsContext::TlsContext(Aws::Crt::Io::TlsContextOptions & options, Aws::Crt::Io::TlsMode mode, aws_allocator * allocator) Line 423 C++ basic-connect.exe!Aws::Iot::MqttClientConnectionConfigBuilder::Build() Line 493 C++ basic-connect.exe!Utils::CommandLineUtils::GetClientConnectionForMQTTConnection(Aws::Iot::MqttClient * client, Aws::Iot::MqttClientConnectionConfigBuilder * clientConfigBuilder) Line 542 C++ basic-connect.exe!Utils::CommandLineUtils::BuildDirectMQTTConnection(Aws::Iot::MqttClient * client) Line 459 C++ basic-connect.exe!main(int argc, char * * argv) Line 41 C++ [External Code] ``` None of the call to `CryptDecodeObjectEx` will succeed in the function `aws_import_key_pair_to_cert_context`. It sounds like there is a problem with my private key which i generated as follow: `openssl req -newkey rsa:4096 -sha256 -nodes -keyout MyPrivate.key -out MyRequest.csr -config MyConfig.cnf` I am not sure to understand what this function is meant to do and what is wrong with my key. I am using win10 with msbuild (tryied in python as well).
2
answers
0
votes
160
views
asked 6 months ago
I have been trying to onboard and connect a class B device on AWS using our custom gateway working in basics station mode. But i am having a hard time sending downlinks to the end device. During a pingslot period, the downlink only reaches the end device if the pingslot frequency of the device matches the ping slot frequency in the device profile in aws. However, the device switches its pingslot frequency in each period. So during the nonmatching periods, the downlink message gets lost. So I want to ask if there is any method to support multiple pingslot frequencies in aws class B mode(also called frequency hopping). Or How i can successfully Support our gateway and end device fully with class B through AWS
1
answers
0
votes
48
views
asked 6 months ago