![]() When BCM2835 runs as 'non-root' and /dev/gpiomem exists, it tries to use /dev/gpiomem instead of /dev/mem, so opening the /dev/mem to group gpio doesn't help. I don't know which is the case, but it will get worked out eventually. You can create your own filters using the New button, or modify existing filters using the Edit button. GrandPerspective comes with a few default filters. ![]() If you don't want to change the root password then you can use: sudo -i. Editing filters The Filters window You can edit filters in the 'Filters' window, accessible from the GrandPerspective menu. After that you can type su and enter the 'root' password. Then enter your password and type the new root password. ![]() when you enter your account, type: sudo passwd root. It seg-faults using /dev/gpiomem as it has some bugs still either in node-dht-sensor or in /dev/gpiomem or the way they are working together. this will add you to the sudoers group Then type exit and boot normally. For example, using the node-red-contrib-dht-sensor module, which depends on the node-dht-sensor, which depends on BCM2835. There are currently still some many issues where you still need to run as root. Until then you have two choices, open up the /dev/mem to group gpio as read/write, or run as root, which has full read write to all of /dev/mem. In the future, drivers such as the bcm2835 library and wiringPi will be updated more (some updates are already happening) and the apps that are built on top of those tools will get further updated and then in the future, hopefully all this GPIO hassle as root will disappear. In effect, this blows a hole in both security and system stability protections to allow access to the GPIO stuff, as well as the rest of the memory, but only to the users in group GPIO, which Pi is a member of. This allows access to the GPIO memory addresses and disallows any other parts of the memory, such as memory currently being used by any other programs. This in effect masks/shields the rest of the memory space from being access and only allows the GPIO bits to be accessed. To help protect the entire memory space, the powers that be mapped just the memory parts that we need to work with the GPIO bits to /dev/gpiomem. So far I have been using Pseudo to launch it as root in my non-admin account, which works. The kicker is, you need to be sure you do it correctly or bad bad things can happen to your system. Running an app as root There's an app, GrandPerspective, that I use to graphically view disk use (cool app, try it out.) But I need to run it as root to see what's using up disk space in System areas and inside other user accounts. When you toggle GPIO pins, you are changing a bit in one of these registers. You can run your script as a non-root user, then raise privileges to root via sudo python3 script.py. Now, in the memory space are many things, including CPU registers. If you are running your Python program in Linux, you can write a bash script and execute your Python code from inside it. This means that now the group gpio, and everyone in it, can read and write to the memory space. The /dev/mem object is basically the entire memory space on the system. Then gives the group read write access to this /dev/mem object. GrandPerspective is not available for Linux but there are plenty of alternatives that runs on Linux with similar functionality. Each file is shown as a rectangle with an area proportional to the files size. Disk usage is visualised using tree maps. It can help you to manage your disk, as you can easily spot which files and folders take up the most space. Again, the same security implications apply here. proot script to root and whoever can execute it (group/others) will always run the script as root. This changes the owner and group of /dev/mem to root and gpio respectively. GrandPerspective is a small utility application that graphically shows the disk usage within a file system. This is a file permission that allows executing a script with its owner's permission. "50 Mac Essentials #6: GrandPerspective". "Five ways to slim down your Mac OS X install". "Use this app to find all the junk files that are slowing down your Mac". "Outline disk usage with Grand Perspective (review)".
0 Comments
Leave a Reply. |