Lunch greengrass with java command but it don't take the config file with --init-config

0

Hello,

I try to configure a raspberry pi 4 on raspbian OS as a edge. I install greengrass on it.

I use this documentation : https://docs.aws.amazon.com/fr_fr/greengrass/v2/developerguide/manual-installation.html

I create a config file :

system:
  certificateFilePath: "/greengrass/v2/device.pem.crt"
  privateKeyPath: "/greengrass/v2/private.pem.key"
  rootCaPath: "/greengrass/v2/AmazonRootCA1.pem"
  rootpath: "/greengrass/v2/"
  thingName: "THING_NAME"
services:
  aws.greengrass.Nucleus:
    componentType: "NUCLEUS"
    version: "2.12.2" 
    configuration:
      awsRegion: "eu-central-1"
      iotRoleAlias: "GreengrassCoreTokenExchangeRoleAlias"
      iotCredEndpoint: "IOT_CREDENTIAL_ENDPOINT"
      iotDataEndpoint: "IOT_ENDPOINT"
      mqtt:
        port: 443
      greengrassDataPlanePort: 443

And I use this command to install Greengrass : sudo -E java -Droot="/greengrass/v2" -Dlog.store=FILE \ -jar ./GreengrassInstaller/lib/Greengrass.jar \ --init-config ./GreengrassInstaller/config.yaml \ --component-default-user ggc_user:ggc_group \ --setup-system-service true

But it create a defautl Thing but not the thing that I mention on the config file.

Thank for all who read me.

  • You can use the --thing-name flag to set your desired thing name instead of the config file. https://docs.aws.amazon.com/fr_fr/greengrass/v2/developerguide/configure-installer.html

    sudo -E java -Droot="/greengrass/v2" -Dlog.store=FILE \ 
     -jar ./GreengrassInstaller/lib/Greengrass.jar \
    --thing-name THING_NAME \
    --init-config ./GreengrassInstaller/config.yaml \ 
     --component-default-user ggc_user:ggc_group \ 
     --setup-system-service true
    

    If this doesn't work then can you double check the values are correct in your config.yaml file?

  • Also I would like to clarify, what do you mean by default thing? What do you actually see in the console and what do you expect to see?

已提问 2 个月前166 查看次数
1 回答
1
已接受的回答

Hello,

As per the documentation that is being followed,

[+] https://docs.aws.amazon.com/fr_fr/greengrass/v2/developerguide/manual-installation.html

The IoT thing is created in the starting step of the GreenGrass configuration. Further, the same thing is used in the config.yaml file for making the setup work. Hence, as per the public documentation you might need to use the thing that was created as the starting step of the setup and use it in the config.yaml file as manual provisioning does not support this creation of thing from config file.

You could try using custom/automatic provisioning as an other option to create thing while running the java command.

[+] Automatic resource provisioning - https://docs.aws.amazon.com/greengrass/v2/developerguide/quick-installation.html#run-greengrass-core-v2-installer

[+] Custom resource provisioning - https://docs.aws.amazon.com/greengrass/v2/developerguide/custom-provisioning.html

AWS
已回答 2 个月前
profile picture
专家
已审核 2 个月前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则