Greengrass IPC using c

0

Hello,

We have a Lambda executable developed using [1] as mentioned here - [2].
This is working completely fine with Greengrass Version 1 (GGv1)

We are currently exploring the Greengrass Version 2 (GGv2).
Since Lambda executable is not supported in GGv2 . We followed a client device pattern as mentioned here - [3]

The only time you would use the client device pattern is if your components are written in a programming language where an AWS IoT device SDK exists. In that case you can have a component act as a client device, but you will have to manage the creation of a thing and certificate in AWS IoT Core.

This is working well but we came across an issue recently.

The custom component developed using client device pattern fails to connect with the Greengrass core when Greengrass core is not connected to internet.
The same issue does not occur when component is developed to perform IPC using AWS IoT Greengrass Core IPC libraries [4].
We wanted the custom component we developed using client device pattern to work in consistent like other components developed using AWS IoT Greengrass Core IPC libraries [4] .

Question 1 - Is it the correct approach to use client device pattern ?

We also thought about few alternative approaches as below -

  • As mentioned here [7] , we can use [6] . But this wont seem to be feasible to convert complete application already written in C to C++
  • It seems it is possible to perform IPC by writing custom code [5]

Question 2 - if it is the better approach to write custom code to perform IPC. How feasible is this approach, I mean is it possible to do the same. Could some one provide some steps or guidelines or links to do the same?

Could some one help with the above queries?

Thank you.

References -
[1] - https://github.com/aws/aws-greengrass-core-sdk-c
[2] - https://docs.aws.amazon.com/greengrass/v1/developerguide/lambda-functions.html
[3] - https://aws.amazon.com/blogs/iot/implementing-local-client-devices-with-aws-iot-greengrass/
[4] - https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-service-connect
[5] - https://forums.aws.amazon.com/thread.jspa?messageID=973781&#973781
[6] - https://github.com/aws/aws-iot-device-sdk-cpp-v2
[7] - https://forums.aws.amazon.com/message.jspa?messageID=994773#994773

질문됨 2년 전369회 조회
2개 답변
0
수락된 답변

Hi,
So from what I understand, you want to develop a component which can run your executable and talk to Greengrass core.
I think the best path forward is to use the C++ IPC SDK as you pointed out [6]. It should be pretty straightforward to write a layer over the C++ SDK to expose the functionality you need (Make sure the symbols are not mangled - example method https://isocpp.org/wiki/faq/mixing-c-and-cpp#call-cpp). You won't need to rewrite your existing C application.

I want to hear what are the challenges you think you will face with the approach. Thanks

PS. I have used this approach to use C++ SDK from C code but don't have the code handy ATM.

답변함 2년 전
profile picture
전문가
검토됨 10달 전
0

Hi sushantAtAws,

Thank you for the response.
It seems it could be possible as suggested by you to write a layer over the C++ SDK to expose the functionality and looks the better approach.

I am able to run the mixed C and C++ code.
Thank you so much again.

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠