Hi, I'm setting up GreengrassV2 and the Modbus adapter on a RPI3b.
I'm running
- aws.greengrass.Modbus: 2.1.8
- aws.greengrass.LegacySubscriptionRouter: 2.1.11
- aws.greengrass.LambdaManager: 2.3.2
I'm using more or less default for everything, I just added a USB modbus adapter as a device by merging the following through the UI
{
"lambdaExecutionParameters": {
"EnvironmentVariables": {
"ModbusLocalPort": "/dev/ttyUSB0"
}
},
"containerParams": {
"memorySize": 525312,
"mountROSysfs": false,
"volumes": {},
"devices": {
"0": {
"path": "/dev/ttyUSB0",
"permission": "rw",
"addGroupOwner": true
}
}
}
}
and set up the LegacySubscriptionRouter to read from the topic
{
"subscriptions": {
"aws-greengrass-modbus": {
"id": "aws-greengrass-modbus",
"source": "component:aws.greengrass.Modbus",
"subject": "modbus/adapter/response",
"target": "cloud"
}
}
}
Howver this breaks the LambdaManager:
2023-11-15T10:24:21.627Z [WARN] (Serialized listener processor) com.aws.greengrass.lambdamanager.LambdaManager: service-invalid-state-error. Invalid reported state. {serviceName=aws.greengrass.LambdaManager, currentState=BROKEN, newState=ERRORED}
2023-11-15T10:24:21.635Z [ERROR] (Serialized listener processor) com.aws.greengrass.lambdamanager.LambdaManager: service-errored. {serviceName=aws.greengrass.LambdaManager, currentState=BROKEN}
com.aws.greengrass.lambdamanager.system.v1subscription.InvalidArnException: The provided arn is not in proper format, arn: modbus/adapter/response
at com.aws.greengrass.lambdamanager.system.v1subscription.RouteTable.parseArnType(RouteTable.java:163)
at com.aws.greengrass.lambdamanager.system.v1subscription.RouteTable.convertConfigToRoute(RouteTable.java:110)
at com.aws.greengrass.lambdamanager.system.v1subscription.RouteTable.addRoute(RouteTable.java:98)
at com.aws.greengrass.lambdamanager.system.v1subscription.RouteTable.loadRoutesFromConfig(RouteTable.java:59)
at com.aws.greengrass.lambdamanager.system.RouterLambda.loadSubscription(RouterLambda.java:60)
at com.aws.greengrass.lambdamanager.LambdaManager.reloadV1Subscription(LambdaManager.java:351)
at com.aws.greengrass.lambdamanager.LambdaManager.lambda$install$1(LambdaManager.java:147)
at com.aws.greengrass.config.Topics.childChanged(Topics.java:439)
at com.aws.greengrass.config.Topics.childChanged(Topics.java:461)
at com.aws.greengrass.config.Topics.childChanged(Topics.java:461)
at com.aws.greengrass.config.Topics.childChanged(Topics.java:461)
at com.aws.greengrass.config.Topics.childChanged(Topics.java:461)
at com.aws.greengrass.config.Topics.lambda$remove$9(Topics.java:418)
at com.aws.greengrass.dependency.Context$1.run(Context.java:68)
Any tips why? Seems it expects the source to an ARN, but I'm using the LegacySubscriptionRouter from the dev guide: https://docs.aws.amazon.com/greengrass/v2/developerguide/modbus-rtu-protocol-adapter-component.html#modbus-rtu-protocol-adapter-component-output-data
Does it actually need an ARN instead here?
Is the deployment actually in progress on the device, or is the group in progress? You are deploying to a thing group rather than an individual device. Because you deploy to a group, the group-level deployment is always active until it is cancelled. Even if all devices in a group have completed the deployment the deployment at the group level remains active so that any newly added devices will also get the deployment.
Check the status of deployment by looking at the individual job executions at the thing (device) level. If that is in progress then the deployment is not yet done on the device.
In a response which it seems you just deleted, you showed that "RESET" was underneath "MERGE". This is not correct and will not fix the problem. Make sure you are properly configuring "RESET" which is a sibling key to "MERGE". If you use the AWS Console, the reset option is the box above the merge option.
Hi! Sorry for editing the history here, I realized my own mistake so I figured I'd remove it before you read it!
If you still have a problem with the deployment after correcting the merge/reset you may wish to restart Greengrass on the device which will ensure that it picks up the latest deployment you made.
Seems to do the tricks, yeah! Thanks for helping out :)