I’m having terrific success with all kinds of Pi projects, however I’m not sure what’s going on with possible hangs on app launch with GPIO. If I log in as Root then I can launch and use apps that use the GPIO module (and they work great!). However, when I log into Pi as user ID of ‘Pi’, then launching GPIO-based apps fails. The failure is simply that the app doesn’t launch, and seems to immediately and quietly die.
Under both the Root and Pi login these two commands return the same good results:
gpio -v
gpis readall
I’d seen a note on http://wiringpi.com regarding “export WIRINGPI_GPIOMEM=1” and I’m not 100% certain I know what that does - however I ran it and it doesn’t seem to remedy the issue.
Thanks for any help!
Best regards,
-Bill
Linux raspberrypi 4.4.11-v7+ #888 SMP Mon May 23 20:10:33 BST 2016 armv7l GNU/Linux
Raspberry Pi Details:
Type: Pi 3, Revision: 02, Memory: 1024MB, Maker: Embest
Device tree is enabled.
This Raspberry Pi supports user-level GPIO access.
-> See the man-page for more details
-> ie. export WIRINGPI_GPIOMEM=1
I was able to get the app running by going to its folder (in an X GUI window) and using the File Manager > Tools > Run a Command in the Current Folder
Instead of simply executing ./MyAppName I entered sudo ./MyAppName, and this made it launch with full GPIO access. I didnt have to edit any files or make any Profile entries etc.
Using this info I created both a .desktop (shortcut) and an entry into the autostart file.
For the desktop file instead of using
Exec=/home/pi/Desktop/MyAppName
I used:
Exec=sudo /home/pi/Desktop/MyAppName
so this lets me have a simple double-clickable shortcut on my pi-user desktop.
I also wanted it to launch on login by pi-user, so I edited: