Fleet Provisioning of GGv2 devices

0

Hi,
I am experimenting with fleet provisioning for our GG devices. I am able to following the example of IoT Fleet provisioning to create IoT thing and thing group, with proper certs. But it is not a Greengrass core device. What do I need to do to create a Greengrass core device and properly provisioning it? Some earlier questions mentioned setting up aws-greengrass-nucleus, but it is not clear to me how that works. I cannot seem to find any documentation on this. Thanks!

jcai
asked 3 years ago478 views
3 Answers
0

For anyone interested. This seems to be problem with 32-bit Raspberry Pi OS. Once I moved to 64-bit Pi OS, the problem went away.

jcai
answered 3 years ago
  • Seems like I have the same problem... After a successful GreenGrass Fleet Provision, the device is registered in AWS IoT as a Thing (I know provisioning was successful as I can see the new certificate attached to the Thing), but is not registered as a GreenGrass Core device.

    I have a setup on EC2 (with TCP connection enabled) and RPi, both with the same issue, in both cases, I get these errors in /greengrass/v2/logs/greengrass.log related to MQTT:

    EC2 Instance:
    2022-06-24T05:22:27.557Z [WARN] (pool-2-thread-9) com.aws.greengrass.deployment.IotJobsHelper: No connection available during subscribing to Iot Jobs descriptions topic. Will retry in sometime. {ThingName=ec2_gg_thing_test}
    2022-06-24T05:22:35.268Z [ERROR] (pool-2-thread-1) com.aws.greengrass.mqttclient.MqttClient: Error subscribing. {topic=$aws/things/ec2_gg_thing_test/shadow/name/AWSManagedGreengrassV2Deployment/update/accepted}
    2022-06-24T05:22:35.269Z [WARN] (pool-2-thread-1) com.aws.greengrass.deployment.ShadowDeploymentListener: Caught exception while subscribing to shadow topics, will retry shortly. {}
    
    RPi Zero:
    2022-06-24T05:25:20.883Z [WARN] (pool-2-thread-11) com.aws.greengrass.deployment.IotJobsHelper: No connection available during subscribing to Iot Jobs descriptions topic. Will retry in sometime. {ThingName=rpiZero}
    2022-06-24T05:26:10.037Z [ERROR] (pool-2-thread-10) com.aws.greengrass.mqttclient.MqttClient: Error subscribing. {topic=$aws/things/rpiZero/shadow/name/AWSManagedGreengrassV2Deploymen
    
0

Hi jcai,

Once you have the thing, thing group and certs, you would have to follow steps for manual resource provisioning here: https://docs.aws.amazon.com/greengrass/v2/developerguide/manual-installation.html . You could skip to the "Download the AWS IoT Greengrass Core software" section as you do not need IoT thing and certs to be recreated.

Thanks,
Navya.

AWS
answered 3 years ago
0

Hi Navya,

Thanks for the response. I did what you suggested. But when I ran the java command with init-config file:
"sudo -E java -Droot="/greengrass/v2" -Dlog.store=FILE -jar ./GreengrassCore/lib/Greengrass.jar --init-config ./GreengrassCore/config.yaml --component-default-user ggc_user:ggc_group --setup-system-service true"

I don't see GG core device created. The greengrass log shows exception create new aws_tls_ctx (below).

2021-05-14T19:31:24.545Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: Attempt to load service from plugins. {serviceName=TelemetryAgent}
2021-05-14T19:31:24.652Z [ERROR] (pool-2-thread-6) com.aws.greengrass.lifecyclemanager.KernelExceptionHandler: uncaught-exception. {thread=Thread[pool-2-thread-6
,5,main]}
software.amazon.awssdk.crt.CrtRuntimeException: TlsContext.tls_ctx_new: Failed to create new aws_tls_ctx (aws_last_error: AWS_IO_TLS_CTX_ERROR(1033), Failed to c
reate tls context) UNKNOWN(-1)
at software.amazon.awssdk.crt.io.TlsContext.tlsContextNew(Native Method)
at software.amazon.awssdk.crt.io.TlsContext.<init>(TlsContext.java:24)
at software.amazon.awssdk.crt.io.ClientTlsContext.<init>(ClientTlsContext.java:26)
at software.amazon.awssdk.iot.AwsIotMqttConnectionBuilder.build(AwsIotMqttConnectionBuilder.java:418)
at com.aws.greengrass.mqttclient.AwsIotMqttClient.establishConnection(AwsIotMqttClient.java:240)
at com.aws.greengrass.mqttclient.AwsIotMqttClient.connect(AwsIotMqttClient.java:212)
at com.aws.greengrass.mqttclient.AwsIotMqttClient.subscribe(AwsIotMqttClient.java:144)
at com.aws.greengrass.mqttclient.MqttClient.subscribe(MqttClient.java:410)
at com.aws.greengrass.mqttclient.WrapperMqttClientConnection.subscribe(WrapperMqttClientConnection.java:73)
at software.amazon.awssdk.iot.iotshadow.IotShadowClient.SubscribeToUpdateNamedShadowAccepted(IotShadowClient.java:748)
at com.aws.greengrass.deployment.ShadowDeploymentListener.subscribeToShadowTopics(ShadowDeploymentListener.java:134)
at com.aws.greengrass.deployment.ShadowDeploymentListener.lambda$postInject$0(ShadowDeploymentListener.java:116)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

2021-05-14T19:31:24.732Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: service-loaded. {serviceName=TelemetryAgent}
2021-05-14T19:31:24.774Z [INFO] (main) com.aws.greengrass.lifecyclemanager.Kernel: effective-config-dump-complete. {file=/greengrass/v2/config/effectiveConfig.ya
ml}

Some additional information for you. I get the exception when I specify "thingName" in the config.yaml. If I don't specify "thingName" in the config,yaml, but specify -tn option on the command line, I don't see the exception in the log file. The command will run successfully, but I still don't see the core device on IoT console.

Any idea what went wrong? Thanks

Edited by: jcai on May 14, 2021 1:37 PM

jcai
answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions