-
Operating system: Rasperian Having an issue using gpiozero in AWS Greengrass environment. I have a simple script that just creates a button. That is where I get the error. My script: # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
import time
import datetime
import json
import awsiot.greengrasscoreipc
from awsiot.greengrasscoreipc.model import (
PublishToTopicRequest,
PublishMessage,
JsonMessage
)
from gpiozero import Button
def say_hello():
print("Hello!")
# Configure button
button = Button(16)
button.when_pressed = say_hello My error:
When logged in as the user the pi was provisioned with I CAN define the button ang get meaningful results manually in python:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
I'm not sure what's getting run where, but your error is:
This error comes from Where is the code getting run? |
Beta Was this translation helpful? Give feedback.
-
Thanks for the quick response! |
Beta Was this translation helpful? Give feedback.
-
OK. This is solved. A user at AWS suggested that I add the user that runs the Greengrass components to the group "gpio". That fixes it. |
Beta Was this translation helpful? Give feedback.
OK. This is solved. A user at AWS suggested that I add the user that runs the Greengrass components to the group "gpio". That fixes it.