theyosh / TerrariumPI

Home automated terrarium/aquarium or other enclosed environment with a Raspberry Pi
https://terrarium.theyosh.nl
GNU General Public License v3.0
408 stars 98 forks source link

[BUG?]: Button could not be added: No access to /dev/mem. Try running as root! #880

Closed Swiftnesses closed 8 months ago

Swiftnesses commented 8 months ago

Hello :)

Latest version (clean install) - I'm getting

Button could not be added: No access to /dev/mem. Try running as root! when trying to add a magnetic door sensor.

All other aspects work fine, inc webcam, relays.

I've checked permissions and all seems OK.

theyosh commented 8 months ago

Did you rebooted the Pi after clean install? It need at least one reboot after a clean install.

Swiftnesses commented 8 months ago

I sure did!

theyosh commented 8 months ago

What did you enter as GPIO address? I can just add a button without any problems

theyosh commented 8 months ago

Keep in mind the address should be the physical number on the Raspberry PI board.

Swiftnesses commented 8 months ago

This is just a new install @theyosh, I'm using GPIO14 for the magnetic sensor (I enter 14 like before).

theyosh commented 8 months ago

entering 14 is NOT possible. That is a ground pin. So if you have connected on GPIO14 according to https://pinout.xyz/ you have to enter 8 as address

Swiftnesses commented 8 months ago

Let me check, I simply pulled the values from my old db, so everything was copied across.

Swiftnesses commented 8 months ago

Feels like user error, I'm just baffled how this worked before! Or at least that value was in the old db (working).

Swiftnesses commented 8 months ago

Sorry, it's on GPIO24, so I entered 18, not 14 :-/

It doesn't accept that.

Swiftnesses commented 8 months ago

I fixed it with:

sudo chown root.gpio /dev/gpiomem
sudo chmod g+rw /dev/gpiomem
theyosh commented 8 months ago

Are you on a Pi zero?

Swiftnesses commented 8 months ago

Pi 3 +

theyosh commented 8 months ago

Ok, but it is al working now? Still strange that you had to change some rights..

But this issue can now be closed?