Questions tagged with Internet of Things (IoT)
Content language: English
Sort by most recent
**Describe the Error**
Running IDT shows error in cloudcomponent log
```
the Greengrass deployment is COMPLETED on the device after 180 seconds
```
comes up with
```
2023-Mar-29 10:22:22,494 [cloudComponent] [idt-c057b1fc3d6bc618a399] [ERROR] greengrass/features/cloudComponent.feature - Failed at step: 'the Greengrass deployment is COMPLETED on the device after 180 seconds'
java.lang.IllegalStateException: Deployment idt-c057b1fc3d6bc618a399-gg-deployment did not reach COMPLETED
at com.aws.greengrass.testing.features.DeploymentSteps.deploymentSucceeds(DeploymentSteps.java:311) ~[AWSGreengrassV2TestingIDT-1.0.jar:?]
at ✽.the Greengrass deployment is COMPLETED on the device after 180 seconds(classpath:greengrass/features/cloudComponent.feature:26) ~[?:?]
2023-Mar-29 10:22:22,510 [cloudComponent] [idt-c057b1fc3d6bc618a399] [INFO] greengrass/features/cloudComponent.feature - Finished step: 'the com.aws.HelloWorld log on the device contains the line "Hello World!!" within 20 seconds' with status SKIPPED
```
```
2023-03-28T05:33:39.019Z [ERROR] (Copier) com.aws.greengrass.util.orchestration.SystemdUtils: systemd-setup. {stderr=Created symlink /etc/systemd/system/multi-user.target.wants/greengrass.service → /etc/systemd/system/greengrass.service., command=systemctl enable greengrass.service}
```
it seems like the mqtt test also have same error in the log after a couple times of trying not sure the problem related to the error
but some how the mqtt test pass
```
./mqtt/mqttpubsub/greengrass_2023_03_29_01_0.log:2023-03-29T01:59:34.313Z [ERROR] (Copier) com.aws.greengrass.util.orchestration.SystemdUtils: systemd-setup. {stderr=Created symlink /etc/systemd/system/multi-user.target.wants/greengrass.service → /etc/systemd/system/greengrass.service., command=systemctl enable greengrass.service}
```
Details:
I am tyring to use IDT for greengrass v2 following
https://docs.aws.amazon.com/greengrass/v2/developerguide/device-config-setup.html
by following the official guide
after by launching greengrass with
`sudo -E java -Droot="/test/greengrass/v2" -Dlog.store=FILE -jar ./GreengrassInstaller/lib/Greengrass.jar --aws-region us-west-2 --thing-name IM30 --thing-group-name GreengrassQuickStartGroup_test --component-default-user root:root --provision true --setup-system-service true --deploy-dev-tools true`
it shows
"Successfully set up Nucleus as a system service"
while watching systemctl status greengrass.service
```
root@i350-evk:/test/greengrass/v2# systemctl status greengrass.service
● greengrass.service - Greengrass Core
Loaded: loaded (/etc/systemd/system/greengrass.service; enabled; vendor preset: disabled)
Active: active (running) since Wed 2023-03-29 02:46:35 UTC; 16s ago
Main PID: 11178 (sh)
Tasks: 68 (limit: 3443)
Memory: 277.0M
CGroup: /system.slice/greengrass.service
├─11178 /bin/sh /test/greengrass/v2/alts/current/distro/bin/loader
└─11182 java -Dlog.store=FILE -Dlog.store=FILE -Droot=/test/greengrass/v2 -jar /test/greengrass/v2/alts/current/distro/lib/Greengrass.jar --setup-system-service false
Mar 29 02:46:35 i350-evk systemd[1]: Started Greengrass Core.
Mar 29 02:46:35 i350-evk sh[11178]: Greengrass root: /test/greengrass/v2
Mar 29 02:46:35 i350-evk sh[11178]: Java executable: java
Mar 29 02:46:35 i350-evk sh[11178]: JVM options: -Dlog.store=FILE -Droot=/test/greengrass/v2
Mar 29 02:46:35 i350-evk sh[11178]: Nucleus options: --setup-system-service false
Mar 29 02:46:39 i350-evk sh[11182]: Launching Nucleus...
Mar 29 02:46:46 i350-evk sh[11182]: Launched Nucleus successfully.
```
my effectiveConfig.yaml :
```
---
system:
certificateFilePath: "/test/greengrass/v2/thingCert.crt"
privateKeyPath: "/test/greengrass/v2/privKey.key"
rootCaPath: "/test/greengrass/v2/rootCA.pem"
rootpath: "/test/greengrass/v2"
thingName: "IM30"
services:
aws.greengrass.LocalHelloWorld:
componentType: "GENERIC"
configuration: {}
dependencies: []
lifecycle:
Run: "java -DcomponentName=\"HelloWorld\" -jar /test/greengrass/v2/packages/artifacts/aws.greengrass.LocalHelloWorld/1.0.0/cloudcomponent.jar"
version: "1.0.0"
aws.greengrass.Nucleus:
componentType: "NUCLEUS"
configuration:
awsRegion: "us-west-2"
componentStoreMaxSizeBytes: "10000000000"
deploymentPollingFrequencySeconds: "15"
envStage: "prod"
fleetStatus:
periodicStatusPublishIntervalSeconds: 86400
greengrassDataPlaneEndpoint: ""
greengrassDataPlanePort: "8443"
httpClient: {}
interpolateComponentConfiguration: false
iotCredEndpoint: "xxx.credentials.iot.us-west-2.amazonaws.com"
iotDataEndpoint: "xxx-ats.iot.us-west-2.amazonaws.com"
iotRoleAlias: "GreengrassV2TokenExchangeRoleAlias"
jvmOptions: "-Dlog.store=FILE"
logging: {}
mqtt:
spooler: {}
networkProxy:
proxy: {}
platformOverride: {}
runWithDefault:
posixShell: "sh"
posixUser: "root:root"
telemetry: {}
dependencies: []
lifecycle:
bootstrap:
requiresPrivilege: "true"
script: "\nset -eu\nKERNEL_ROOT=\"/test/greengrass/v2\"\nUNPACK_DIR=\"/test/greengrass/v2/packages/artifacts-unarchived/aws.greengrass.Nucleus/2.9.4/aws.greengrass.nucleus\"\
\nrm -r \"$KERNEL_ROOT\"/alts/current/*\necho \"-Dlog.store=FILE\" > \"\
$KERNEL_ROOT/alts/current/launch.params\"\nln -sf \"$UNPACK_DIR\" \"$KERNEL_ROOT/alts/current/distro\"\
\nexit 100"
version: "2.9.4"
DeploymentService:
ComponentToGroups:
aws.greengrass.LocalHelloWorld:
"4e69ead5-a595-4b96-a7c8-45da74475fe0": "LOCAL_DEPLOYMENT"
dependencies: []
GroupToLastDeployment:
LOCAL_DEPLOYMENT:
configArn: null
timestamp: 1679992938275
thing/IM30:
configArn: "arn:aws:greengrass:us-west-2:116407744508:configuration:thing/IM30:111"
timestamp: 1679993636499
thinggroup/GreengrassQuickStartGroup_test:
configArn: "arn:aws:greengrass:us-west-2:116407744508:configuration:thinggroup/GreengrassQuickStartGroup_test:51"
timestamp: 1679993661994
GroupToRootComponents:
LOCAL_DEPLOYMENT:
aws.greengrass.LocalHelloWorld:
groupConfigArn: "4e69ead5-a595-4b96-a7c8-45da74475fe0"
groupConfigName: "LOCAL_DEPLOYMENT"
version: "1.0.0"
thing/IM30: {}
thinggroup/GreengrassQuickStartGroup_test: {}
runtime:
ProcessedDeployments:
"1679993661353":
ConfigurationArn: "arn:aws:greengrass:us-west-2:116407744508:configuration:thing/IM30:111"
DeploymentId: "arn:aws:greengrass:us-west-2:116407744508:configuration:thing/IM30:111"
DeploymentRootPackages: []
DeploymentStatus: "SUCCEEDED"
DeploymentStatusDetails:
detailed-deployment-status: "SUCCESSFUL"
DeploymentType: "SHADOW"
GreengrassDeploymentId: "ef974963-4dfe-49a4-a1fc-73c8aa49a545"
version: "0.0.0"
FleetStatusService:
dependencies: []
lastPeriodicUpdateTime: 1679981624527
sequenceNumber: 122
version: "0.0.0"
main:
dependencies:
- "FleetStatusService:HARD"
- "DeploymentService:HARD"
- "aws.greengrass.LocalHelloWorld"
- "TelemetryAgent:HARD"
- "aws.greengrass.Nucleus"
- "UpdateSystemPolicyService:HARD"
- "aws.greengrass.Nucleus"
lifecycle: {}
runtime:
service-digest: {}
TelemetryAgent:
dependencies: []
runtime:
lastPeriodicAggregationMetricsTime: 1679981624784
lastPeriodicPublishMetricsTime: 1679981624784
version: "0.0.0"
UpdateSystemPolicyService:
dependencies: []
version: "0.0.0"
```
however while I launch the deployment of idt with command:
`./devicetester_linux_x86-64 run-suite --suite-id GGV2Q_2.5.0 --userdate userdata.json`
the test_manager.log in idt shows
```
[ERROR] [2023-03-28 16:56:12]: Test exited unsuccessfully testCaseId=cloudcomponent error=exit status 1 executionId=9f12b10c-cd42-11ed-bb24-080027641c32
[INFO] [2023-03-28 16:56:12]: All tests finished. executionId=9f12b10c-cd42-11ed-bb24-080027641c32
[INFO] [2023-03-28 16:56:13]:
========== Test Summary ==========
Execution Time: 26m50s
Tests Completed: 7
Tests Passed: 6
Tests Failed: 1
Tests Skipped: 0
----------------------------------
Test Groups:
lambdadeployment: PASSED
mqtt: PASSED
component: FAILED
pretestvalidation: PASSED
coredependencies: PASSED
version: PASSED
----------------------------------
Failed Tests:
Group Name: component
Test Name: cloudcomponent
Reason: Failed at 'the Greengrass deployment is COMPLETED on the device after 180 seconds'
----------------------------------
Path to AWS IoT Device Tester Report: /home/user/test/devicetester_greengrass_v2_linux/results/20230328T162913/awsiotdevicetester_report.xml
Path to Test Execution Logs: /home/user/test/devicetester_greengrass_v2_linux/results/20230328T162913/logs
Path to Aggregated JUnit Report: /home/user/test/devicetester_greengrass_v2_linux/results/20230328T162913/GGV2Q_Report.xml
==================================
```
logs/component/cloudcomponent
greengrass_2023_03_28_05_0.log shows:
```
2023-03-28T05:33:10.582Z [INFO] (main) com.aws.greengrass.deployment.DeviceConfiguration: Copy Nucleus artifacts to component store. {destination=/test/greengrass/v2/packages/artifacts-unarchived/aws.greengrass.Nucleus/2.9.4/aws.greengrass.nucleus, source=/test/GreengrassInstaller}
2023-03-28T05:33:37.517Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: Waiting for services to shutdown. {}
2023-03-28T05:33:37.543Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: effective-config-dump-complete. {file=/test/greengrass/v2/config/effectiveConfig.yaml}
2023-03-28T05:33:39.019Z [ERROR] (Copier) com.aws.greengrass.util.orchestration.SystemdUtils: systemd-setup. {stderr=Created symlink /etc/systemd/system/multi-user.target.wants/greengrass.service → /etc/systemd/system/greengrass.service., command=systemctl enable greengrass.service}
2023-03-28T05:33:39.889Z [INFO] (main) com.aws.greengrass.util.orchestration.SystemdUtils: systemd-setup. Successfully set up systemd service. {}
2023-03-28T05:33:39.891Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: system-shutdown. {main=null}
2023-03-28T05:33:39.902Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: Waiting for services to shutdown. {}
2023-03-28T05:33:39.933Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: effective-config-dump-complete. {file=/test/greengrass/v2/config/effectiveConfig.yaml}
2023-03-28T05:33:39.937Z [INFO] (Serialized listener processor) com.aws.greengrass.lifecyclemanager.KernelLifecycle: executor-service-shutdown-initiated. {}
2023-03-28T05:33:39.938Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: Waiting for executors to shutdown. {}
2023-03-28T05:33:39.940Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: executor-service-shutdown-complete. {executor-terminated=true, scheduled-executor-terminated=true}
2023-03-28T05:33:39.941Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: context-shutdown-initiated. {}
2023-03-28T05:33:39.945Z [INFO] (main) com.aws.greengrass.lifecyclemanager.KernelLifecycle: context-shutdown-complete. {}
```
greengrass-test-run.log shows:
```
2023-Mar-29 10:19:21,514 [cloudComponent] [idt-c057b1fc3d6bc618a399] [INFO] greengrass/features/cloudComponent.feature - Finished step: 'I create a Greengrass deployment with components' with status PASSED
2023-Mar-29 10:19:22,164 [cloudComponent] [idt-c057b1fc3d6bc618a399] [INFO] com.aws.greengrass.testing.resources.AbstractAWSResourceLifecycle - Created GreengrassDeployment in GreengrassV2Lifecycle
2023-Mar-29 10:19:22,165 [cloudComponent] [idt-c057b1fc3d6bc618a399] [INFO] com.aws.greengrass.testing.features.DeploymentSteps - Created Greengrass deployment: fe860f32-3236-4493-b71d-56e585382c0c
2023-Mar-29 10:19:22,166 [cloudComponent] [idt-c057b1fc3d6bc618a399] [INFO] greengrass/features/cloudComponent.feature - Finished step: 'I deploy the Greengrass deployment configuration to thing group' with status PASSED
2023-Mar-29 10:22:22,494 [cloudComponent] [idt-c057b1fc3d6bc618a399] [ERROR] greengrass/features/cloudComponent.feature - Failed at step: 'the Greengrass deployment is COMPLETED on the device after 180 seconds'
java.lang.IllegalStateException: Deployment idt-c057b1fc3d6bc618a399-gg-deployment did not reach COMPLETED
at com.aws.greengrass.testing.features.DeploymentSteps.deploymentSucceeds(DeploymentSteps.java:311) ~[AWSGreengrassV2TestingIDT-1.0.jar:?]
at ✽.the Greengrass deployment is COMPLETED on the device after 180 seconds(classpath:greengrass/features/cloudComponent.feature:26) ~[?:?]
2023-Mar-29 10:22:22,510 [cloudComponent] [idt-c057b1fc3d6bc618a399] [INFO] greengrass/features/cloudComponent.feature - Finished step: 'the com.aws.HelloWorld log on the device contains the line "Hello World!!" within 20 seconds' with status SKIPPED
2023-Mar-29 10:22:22,511 [cloudComponent] [idt-c057b1fc3d6bc618a399] [INFO] greengrass/features/cloudComponent.feature - Finished step: 'I create a Greengrass deployment with components' with status SKIPPED
2023-Mar-29 10:22:22,512 [cloudComponent] [idt-c057b1fc3d6bc618a399] [INFO] greengrass/features/cloudComponent.feature - Finished step: 'I deploy the Greengrass deployment configuration to thing group' with status SKIPPED
2023-Mar-29 10:22:22,513 [cloudComponent] [idt-c057b1fc3d6bc618a399] [INFO] greengrass/features/cloudComponent.feature - Finished step: 'the Greengrass deployment is COMPLETED on the device after 180 seconds' with status SKIPPED
2023-Mar-29 10:22:22,513 [cloudComponent] [idt-c057b1fc3d6bc618a399] [INFO] greengrass/features/cloudComponent.feature - Finished step: 'the com.aws.HelloWorld log on the device contains the line "Hello World Updated!!" within 20 seconds' with status SKIPPED
```
**To Reproduce**
See above.
**Expected behavior**
IDT for greengrass v2 pass all of the test
**Actual behavior**
IDT for greengrass v2 failed on cloud component test
**Environment**
- OS: device for greengrass Yocto linux aarch64
- device for idt Ubuntu 22.04.1 LTS
- JDK version:"openjdk version "1.8.0_282"
- //also have test with amazon-corretto-17.0.6.10.1-linux-aarch64
- https://docs.aws.amazon.com/corretto/latest/corretto-17-ug/downloads-list.html
- seems the error still happened
- Nucleus version:2.9.4
- IDT version:4.7.0
**Additional context**
Notice the same error on https://github.com/aws-greengrass/aws-greengrass-nucleus/issues/876#issuecomment-786948524
not sure if it is related
but other test Pass
I have the following code made using golang:
---------------------------------------------------------
`
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"log"
"os"
"os/signal"
"path/filepath"
MQTT "github.com/eclipse/paho.mqtt.golang"
)
func main() {
MQTT.DEBUG = log.New(os.Stdout, "", 0)
MQTT.ERROR = log.New(os.Stdout, "", 0)
// Get working dir path
dir, err := os.Getwd()
if err != nil {
panic(err)
}
// Archivos
KeyPath := filepath.Join(dir, "assets", "otra_prueba.private.key")
CertPath := filepath.Join(dir, "assets", "otra_prueba.cert.pem")
CAPath1 := filepath.Join(dir, "assets", "root-CA.crt")
ClientId := "basicPubSub"
Endpoint := "a2fqp5ya964aj9-ats.iot.us-east-1.amazonaws.com"
// Carga de certificados
tlsCert, err := tls.LoadX509KeyPair(CertPath, KeyPath)
if err != nil {
panic(err)
}
certs := x509.NewCertPool()
caPem1, err := os.ReadFile(CAPath1)
if err != nil {
panic(err)
}
certs.AppendCertsFromPEM(caPem1)
tlsConfig := &tls.Config{
Certificates: []tls.Certificate{tlsCert},
RootCAs: certs,
}
// Carga de opciones
options := MQTT.NewClientOptions()
options.AddBroker(fmt.Sprintf("tcps://%s:8883/mqtt", Endpoint))
options.SetClientID(ClientId)
options.SetTLSConfig(tlsConfig)
// Conexion
mqttClient := MQTT.NewClient(options)
if token := mqttClient.Connect(); token.Wait() && token.Error() != nil {
panic(token.Error())
}
fmt.Println("[MQTT] Connected")
quit := make(chan struct{})
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
go func() {
<-c
mqttClient.Disconnect(250)
fmt.Println("[MQTT] Disconnected")
quit <- struct{}{}
}()
<-quit
}
`
//--------------------------------------------------------------------------------
Output the following response:
- $ go1.20.2 run cmd/main.go
- [client] Connect()
- [store] memorystore initialized
- [client] about to write new connect msg
- [client] socket connected to broker
- [client] Using MQTT 3.1.1 protocol
- [net] connect started
- [net] connect got error EOF
- [client] Trying reconnect using MQTT 3.1 protocol
- [client] socket connected to broker
- [client] Using MQTT 3.1 protocol
- [net] connect started
- [net] connect got error EOF
- [client] Failed to connect to a broker
- [store] memorystore closed
- panic: network Error : EOF
// ---------------------------------------------------------------------------------
I think I'm using the certificates wrong.
How can I connect to the mqtt broker
I have study https://docs.aws.amazon.com/greengrass/v2/developerguide/idt-programmatic-download.html
and the result is that all the link and script only provide idt for x86
I have done connecting my host device to aws with greengrass while following the guide
now im trying to install idt on host but stuck on cannot find a idt download link for aarch64
requesting idt plat: aarch64 linux
I was reading through these docs and noticed that the steps to request a security token requires the client to send its private key to credential provider service.
```
curl --cert your certificate --key your device certificate key pair -H "x-amzn-iot-thingname: your thing name" --cacert AmazonRootCA1.pem https://your endpoint /role-aliases/your role alias/credentials
```
This is mentioned in these docs:
https://docs.aws.amazon.com/iot/latest/developerguide/authorizing-direct-aws.html
https://aws.amazon.com/blogs/security/how-to-eliminate-the-need-for-hardcoded-aws-credentials-in-devices-by-using-the-aws-iot-credentials-provider/
Looking at it superficially, I would think this is a security flaw and would defeat the purpose of using asymmetric keys in the first place.
Any help to help me understand what is going on is greatly appreciated.
I am trying to setup my IoT core in us-west-2, and want my IoT device in China region. I am using JITR and my device in China can use Data-ATS endpoint to register the device certificate. But query for the credentials using CredentialProvider endpoint fails.
Things I have tried
- having my IoT core in us-east-1 works. I can register on Data-ATS endpoint and query credentials on CredentialProvider endpoint
- having my IoT core in us-west-2 fails. I can register on Data-ATS endpoint but fails to query credentials on CredentialProvider endpoint.
Would appreciate any help regarding the topic. Thanks
I am attempting to trouble shoot a MTCDT-L4N1-246A gateway that was sent to New Zealand. In the USA it was known to work on frequency US915 and we had no issues. Once it arrived in New Zealand it no longer connected. The frequency was changed to AU915 and we know devices connect to the gateway, new AU915 certs were made and placed on the gateway. However, the gateway is perpetually on "Connection status - Disconnected" regardless of any changes that are made. Are there are any recommended changes to make to establish a connection?
I am working on AWS Greengrass for deploying my code to a 32bit Raspberry Pi4 remotely. I have successfully downloaded the latest version of **Greengrass nucleus**. The **aws version is 1.27.84**. After uploading the code and granting permissions, my deployment status remains at "In Progress". Could anyone tell me why this is happening?
Thank You
Hello AWS team!
I'm using AWS IoT Core with an ESP32.
When using MQTT test client with this JSON everything works as expected:
{
"pattern1": { "name":"Hello", "phases": {"position": "1", "speed":"1", "accel" : "0.2", "delay":"0"}},
"pattern2": { "name":"World", "phases": {"position": "1", "speed":"1", "accel" : "0.2", "delay":"0"}}
}
The problem is that I want to send a lot of objects in this JSON, probably 50 or more. When I test it with 3 objects it doesn't work
{
"pattern1": { "name":"Smooth", "phases": {"position": "1", "speed":"1", "accel" : "0.2", "delay":"0"}},
"pattern2": { "name":"Yanking", "phases": {"position": "1", "speed":"1", "accel" : "0.2", "delay":"0"}},
"pattern3": { "name":"Yanking", "phases": {"position": "1", "speed":"1", "accel" : "0.2", "delay":"0"}}
}
I realized that if I reduce the number of words then I'm able to send it, like this:
{
"1": { "n":"S", "p": {"p": "1", "sp":"1", "a" : "0.2", "d":"0"}},
"2": { "n":"Y", "p": {"p": "1", "s":"1", "a" : "0.2", "d":"0"}},
"3": { "n":"Y", "p": {"p": "1", "s":"1", "a" : "0.2", "d":"0"}},
"4": { "n":"Y"}
}
I read that the MQTT payload limit is 128kb, but those 3 objects are smaller than 128kb.
On the ESP32 side, the callback function is triggered as expected. But, when the payload is too big it is not triggering.
Is this an AWS problem related to being able to send those larger payloads?
The AWS region is sa-east-1
Thanks a lot in advance!
Hello,
We have a GG component that needs to send a file to another component, via memory sharing. Due to privacy issues, we cannot write the file on disk.
There seems to be a 2mb limitation for this. Any idea about increasing this issue?
Many thanks
I have deleted the component from AWS cloud, from local device, and built another device in another region as well, but it shows device unhealthy, and showing error like this.... . Can anyone tell the reason behind this.
Thank you
Nik
We have dozens of Raspberry Pi's that are running v1.7.15-a9048b4 of the device client and I now see that v1.8 is available. It supports a new feature that we need that enables us to run commands via IoT Jobs. Is there a way for us to update all the client versions using a job? If not, can you suggest an alternative? We've successfully written a custom job handler to update our own binaries but not sure how to tackle this since the client side jobs are run by the client itself.
I am working on raspberrypi4 and Greengrass V2 does not support greengrass-cli (aws -cli) file for the 32-bit processor, so I can not download files for version 2. can anyone suggest what should I do about it? Should I switch on another service or anything else?
Thank you in advance