hzeller / txtempus

A DCF77, WWVB, JJY and MSF clock LF-band signal transmitter using the Raspberry Pi
GNU General Public License v3.0
429 stars 67 forks source link

Problem With Non Raspberry OS #32

Open DSH850 opened 1 year ago

DSH850 commented 1 year ago

My Raspberry Pi 3 on Debian 12 is giving me the following errors when txtempus is run.

non-existent Revision: Could not determine Pi model mmap error: : Operation not permitted MMapping from base 0x3f000000, offset 0x200000 Need to be root

All of this is conjecture on my part as I am not a programmer, but after poking around the code, it appears that the programming is using /proc/cpuinfo to determine the needed information on model etc. Unfortunately it also appears that the /proc/cpuinfo information provided by the Raspberry Pi OS is non standard (at least it doesn’t match the Debain or Slackware versions) and gives more information than was intended. Is it possible for the code to query the needed information from the user when needed, so it can be used on all Raspberry Pis regardless of the OS?

hzeller commented 1 year ago

If txtempus gives out that message, then it would fall back to Raspberry Pi 3, so that should probably just work in your case.

But you need to be root to be able to access the GPIO pins. Did you start txtempus with sudo ?

DSH850 commented 1 year ago

I su to root rather than have a user with sudo privileges, so I ran it as root.

hzeller commented 1 year ago

it couldn't memory map the GPIO area of the Raspberry Pi, that should not be dependent on the operating system (I used it at least with DietPi). This is why it looks like you're not running as root.

Anyway, if you're running a non-standard operating system on your Pi, you'll have to figure out the details involved getting it to run.

DSH850 commented 1 year ago

OK. Thanks. It was worth a shot.

lachesis commented 11 months ago

I'm running Debian 10 on my Pi Zero W v1.1. Debian sets CONFIG_STRICT_DEVMEM=y which blocks mmapping on /dev/mem unless you pass iomem=relaxed on the kernel command line (by editing /boot/firmware/cmdline.txt). This may not apply in OP's specific situation but leads to a similar error, so I found myself here.

https://wiki.debian.org/RaspberryPi4#GPIO_support