Greengrass v2 interact with shadows from a nodejs lambda

0

Is there any way to interact with local shadows in ggv2 from a nodejs lambda? I know IPC is not supported in the js sdk, but maybe an mqtt client in a lambda could connect to the mqtt components. Thanks in advance for any ideas other than a python rewrite which I am working on, but, looking for a solution to get ggv2 running with ggv1 lambdas while working on python conversion.

JAG
질문됨 2년 전351회 조회
1개 답변
0
수락된 답변

Currently IPC is the only available method for communicating with the local shadow manager. However, the next release of Shadow Manager will support a PubSub API (code) which will enable you to access shadows via MQTT (as long as you configure the appropriate routes in the MQTT Bridge component).

There are downsides to your approach, as you'll need to model your lambda as a client device and give it a private key / cert. But it should serve as a stop gap solution.

AWS
답변함 2년 전
profile picture
전문가
검토됨 10달 전
  • Awesome! I tried creating a device and using the certs and the aws-iot-device-sdk-v2 js mqtt client from a lambda but I get an AWS_IO_TLS_ERROR_NEGOTIATION_FAILURE TLS (SSL) Negotiation failed. Is this expected until the updates you mention? I have not been able to get a lambda function as a device to connect to the local MQTT broker. Thanks for all your responses.

  • You won't be able to get this working end-to-end until the next Shadow Manager release. However, you should be able to get the MQTT connection to work.

    We have a detailed tutorial on how to set up client devices here: https://docs.aws.amazon.com/greengrass/v2/developerguide/client-devices-tutorial.html

    TLS failures are usually caused by your client using an incorrect CA, or Greengrass not having sufficient permissions in the certificate policy to verify the client certificate. Both are covered in the above tutorial.

  • You can check greengrass.log for hints. Anything along the lines of "bad_ca" points to an issue with the client. Otherwise it's likely a Greengrass configuration issue and the logs should point you in the right direction.

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

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

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

관련 콘텐츠