2

I'm using AWS Greengrass V2 with an Lambda based component. The Lambda Sourcode contains code which should controll the gpio pins of the raspberry pi.

The Lambda is successfully deployed to the GG Core Device (=RaspberryPI). Unfortunately the Lambda throws an error: no such file or directory, open '/sys/class/gpio/export'

I explicit defined in the greengrass component that the lambda is not executed in a Greengrass Container. i choosed the option "No Container" But nevertheless the code can't finde or access /sys/class/gpio/export to control the gpio pins.

if i execute the same code from the lambda function in a local nodejs project directly on the raspberry pi. The code works. The Problem is not the code.

i assume that the problem is either an isolation of the lambda runtime, or that the user ggc_user doesn't have enough permissions.

can someone give me an hint, how to fix this problem?

Kind Regards Stefan

Stefan Volkmer
  • 318
  • 2
  • 13
  • 1
    Update: In the meantime i tried to assign the ggc_user to the same usergroups as the "PI" user. Unfortunately it doesn't fix the problem. i switched now from nodejs to python. While the nodejs (using "require('onoff').Gpio" ) needs access to /sys/class/gpio/export, which was not possible, python (using import RPi.GPIO as GPIO) works fine. it seems that python doesn't need access to '/sys/class/gpio/export' to control the GPIOs. – Stefan Volkmer Mar 11 '21 at 19:57
  • I'm having issues with the RPi.GPIO import , what version of Python are you using and what resources did you need to give the lambda function? I'm using Raspberry Pi 4. The Greengrass lambda runtime is stating that RPi.GPIO module can only run on Raspberry Pi – cdugga Jul 11 '21 at 21:01

0 Answers0