Made my own addon but python requires root to run

Hello,

I am having an issue where the python won’t run in my add on because it requires root access. How can you define root access for an addon? Is it even possible?

The script is supposed to be run in the background and is supposed to start at login.

Link to log: see last 5 lines

https://paste.ubuntu.com/23956619/

If you guys need anything else I am more than happy to supply. (XML or PY)

P.s the script works when I force it in command line (sudo)

Thanks,
Mark

What are you trying to do?

I am trying to use my RPi Gpio pins to force shutdown and create a makeshift remote with an IR circuit i made.

If you want to create a remote with a GPIO pin you don’t need to write an addon, just attach your IR receiver to the correct pin and use lirc.

If you search the forum you’ll find lots of threads discussing this.

You have ability to use sudo for now
In future this won’t work
For gpio access use /dev/gpiomem. Root is not needed

yknivag. think that may be the answer, i only hope I can run the IR output in parallel with two device now instead of 1. I made a IR circuit that turns off power to the pi via 5v relay and wanted to use that same circuit to control Kodi. Testing will be needed. Thanks

You shouldn’t use the pi to turn itself off with a relay as that will likely cause file system corruption.

If you want to shut off the pi you need something that will actually trigger the shutdown process and then monitor the current draw and then switch off the pi when it has completed it’s shutdown process. Such a device is not trivial to produce although there are a number available via Adafruit etc. Typically they also include a battery which is used to keep the pi alive until shutdown is compete.