Permissions

Any program that accesses the GPIO pins must be run as root, so if you get an error, remember to “sudo” your command or run your application as root.

To avoid this the GPIO pins can be exported and have their ownership changed appropriately [Resource on this wanted].

Comments

  1. Juozas Kimtys

    6 years ago

    How to use IO pins correctly – it is an interesting question. There are my first attempts to make something on my new “Pi 4 4GB “. Raspbian (2019-07-10), me working as user “pi”. Firstly, I have connected four LED’s to pins GPIO17, GPIO27, GPIO22 and GPIO18. On Node-RED I have created and deployed application, that sequentially switches ON/OFF these LED’s. After, I have stopped Node-RED service and have started to look what to do with Thonny Python IDE. Created and loaded to execute another application (by using gpiozero library), that similarly sequentially switches ON/OFF these LED’s. If, during this execution, to manually start Node-RED service, my LED’s will start to blink by using both applications – sure out off order. If to close Thonny Python IDE, only one LED’s blink sequence will be active – those that initiated by Node-RED. No any visible error messages – very friendly system. Friendly, but, sure, not in all cases acceptable.