Welcome, Guest
Username: Password: Remember me
20 Aug 2017
INDI development team is happy to announce the release of INDI Library v1.5.0. This new exciting release builds on the maturity of INDI Library and comes with many new supported devices and fixes for existing drivers.
Read More...
  • Page:
  • 1

TOPIC: Focuser driver for RPi with A4988 stepper driver

Focuser driver for RPi with A4988 stepper driver 3 years 4 months ago #898

  • beyond
  • beyond's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 21
  • Thank you received: 2
As per my earlier post, I am in the process of making a focuser driver for Raspberry Pi with the A4988 stepper driver.

I find the best performing option for RPi GPIO access is via /dev/mem, which requires root access.

I have had some trouble getting setuid access to work, and have found the issue is with following snippet in indidrivermain.c dropping the effective uid:
#ifndef _WIN32
    setgid( getgid() );
    setuid( getuid() );
    if (geteuid() != getuid())
        exit(255);
#endif

Is this preventing setuid for drivers by design, or is there a better way of getting /dev/mem access in a driver?

Please Log in or Create an account to join the conversation.

Focuser driver for RPi with A4988 stepper driver 1 week 1 day ago #18443

Sorry for diggin out this old thread but I stumbled upon it while investigating how to access gpio's without root
on non raspbian systems like gentoo on my RaspberryPi 2.
I was trying to start an indiserver as normal user with indi_wiringpi_gpio driver which gave an error:
wiringPiSetup: Unable to open /dev/mem

Check the group and its "rw" status of
pi@astro ~ $ ls -lah /dev/gpiomem 
crw-rw---- 1 root gpio 245, 0  1. Jan  1970  /dev/gpiomem

If gpio doesnt exist just create that group and change the group ownership of "/dev/gpiomem"
to it. Then add your ordinary user to the gpio group and you should have non root
access to gpio. Of cause you then have to do the change of gpiomem on every reboot so just put it in
a system startup script

Please Log in or Create an account to join the conversation.

--= human, without Windows™ =--
pls excuse my bad english! :)
Last Edit: by pauledd.

Focuser driver for RPi with A4988 stepper driver 1 week 1 day ago #18444

Ok, this seems not to work with code that uses the bcm2835 library (like the astroberry focuser driver) that accesses /dev/mem.
Even changing group and permission of /dev/mem seems not to work for non-root access.
If anyone is aware of another trick please share it. In the meantime I'll willy-nilly have to use root
to start my indiserver :unsure:

Please Log in or Create an account to join the conversation.

--= human, without Windows™ =--
pls excuse my bad english! :)
  • Page:
  • 1
Time to create page: 0.145 seconds

Login

3rd Party

Choose from the numerous 3rd party INDI drivers to suit your needs!

Got Problem?

Check out the FAQ, the forum, and the bug tracking system to resolve any issues you might have!
You can also subscribe to INDI newsletter and development mailing lists to get the latest updates on INDI!

Gallery

Replica

Why INDI

Replica