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?

asked 2 months ago155 views
1 Answer
1
Accepted Answer

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
answered 2 months ago
profile picture
EXPERT
reviewed a month 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