2

I have a python function that is able to access local USB printer when run independently on my raspberry pi. When am trying to run that python function as part of AWS greengrass function deployed on the same raspberry pi, it's unable to access the USB printer device

Exception in greengrass lambda logs :

raise USBNotFoundError("Device not found or cable not plugged in.")

Even though I have provided required local resource access to the aws greengrass to the function using AWS greengrass console. Updated local resource of type "Device" with path /dev/bus/usb/001/009 and updated, deployed, restarted the GG daemon.

Verified using /dev/usb/ folder the path of the device

pi@raspberrypi:/greengrass/ggc $ find /dev/bus/usb
/dev/bus/usb
/dev/bus/usb/001
/dev/bus/usb/001/009 //USB Printer
Ben T
  • 4,656
  • 3
  • 22
  • 22
Scorpion
  • 633
  • 3
  • 11
  • 24

1 Answers1

0

I'm assuming that you're using Greengrass v1.

You need to give the GGC Group access to the local resources. To do this you will have to go AWS IoT > Greengrass > Groups > <Group-name>.

Then, go to Resources > Add Local Resource and choose the type as Device and inform the Device Path, like /dev/ttyUSB0. Also, select Lambda function affiliations to inform which function will have access to it.

usb configuration example

brunoto
  • 91
  • 9