Hello, help me Im dumb. Addon to control relays
#1
Rainbow 
Im trying not to be a forum noob, but I seem to keep running into the same issues. Honestly all that I want should be really simple. However, I dont know anything about coding (go figure). I have Kodi set up on my pi 3. I have successfully SSHed into it. I cannot however activate any terminal commands such as sudo anything. All I need is an addon that i can click on Kodi's main screen that can turn on/off a relay 3.3v+ on, 0.0v off (using GPIO). I actually need 4 different ones that I can turn on and off as needed.

TL;DR Want an addon (or 4) that can turn on/off GPIO with a mouse click.
Reply
#2
Thread moved to addon development
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#3
I would hope that this is possible without using sudo. Which operating system/distro are you using?

The latest debian version allows non-root access to the GPIO pins. If that's the case then I would think this should be fairly easy to do.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#4
(2017-05-23, 14:08)el_Paraguayo Wrote: I would hope that this is possible without using sudo. Which operating system/distro are you using?

The latest debian version allows non-root access to the GPIO pins. If that's the case then I would think this should be fairly easy to do.
Libreelec 8.0.1 (kernel: Linux 4.9.13) Krypton 17.1
Reply
#5
LibreELEC does not have sudo because SSH works with root privileges, however LE console has limited capabilities compared to full-featured Linux systems like Raspbian. As for accessing GPIO, there are Python libs for that that can be used in Python addons.
Reply
#6
Can you access the machine via ssh or get a shell prompt?

If so, can you post the output of
Code:
ls -l /dev/gpiomem
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#7
(2017-05-23, 16:25)el_Paraguayo Wrote: Can you access the machine via ssh or get a shell prompt?

If so, can you post the output of
Code:
ls -l /dev/gpiomem

You mean this?
Code:
LibreELEC:~ # ls -l /dev/gpiomem
crw-------    1 root     root      244,   0 Feb 26 18:33 /dev/gpiomem
Reply
#8
Yes. In raspbian, there is a group membership permission on that device which means that you can access GPIO pins without using sudo.

If the LE user right has limited privileges then my guess is that those python addons won't work.

I helped someone using osmc achieve something similar here but I've got no experience with LibreElec so I may not be much help.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#9
https://www.youtube.com/watch?v=foRy_eS5w4E

This is pretty much what I want, except 4 different "Aux"

https://github.com/nearlg/relay-addon-kodi
Here is an addon that would be nice IF it worked. It will not turn on or off the GPIO
Reply
#10
The addon bit should be fairly easy. The harder bit is just making sure you've got permission to access the pins from inside Kodi.

Take a look at the above posts and let me know if you have any questions.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#11
(2017-05-23, 18:08)el_Paraguayo Wrote: The addon bit should be fairly easy. The harder bit is just making sure you've got permission to access the pins from inside Kodi.

Kodi in LibreELEC works from root as well.
Reply
#12
Then the GPIO pins should work, shouldn't they?

It does seem a bit unnecessary to be running Kodi as root. Does that happen by default or does the OP need to do something different to enable that.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply
#13
(2017-05-23, 18:19)el_Paraguayo Wrote: Then the GPIO pins should work, shouldn't they?

It does seem a bit unnecessary to be running Kodi as root. Does that happen by default or does the OP need to do something different to enable that.

It's how LIbreElec is made. I have no idea why everything is done from root.
Reply
#14
(2017-05-23, 17:13)el_Paraguayo Wrote: Yes. In raspbian, there is a group membership permission on that device which means that you can access GPIO pins without using sudo.

If the LE user right has limited privileges then my guess is that those python addons won't work.

I helped someone using osmc achieve something similar here but I've got no experience with LibreElec so I may not be much help.
I got all the way to the part "Check that the gpio group exists:"
I have a "groups" file under etc but this is all it says:

audio:x:63:
systemd-journal:x:190:
systemd-network:x:193:
cdrom:x:11:
dialout:x:18:
disk:x:6:
floppy:x:19:
kmem:x:9:
lp:x:7:
tape:x:33:
tty:x:5:
video:x:39:
utmp:x:22:
input:x:199:
root:x:0:
users:x:100:
nogroup:x:65534:
dbus:x:81:
netdev:x:497:
system:x:430:
avahi:x:495:
Reply
#15
(2017-05-23, 18:30)Roman_V_M Wrote:
(2017-05-23, 18:19)el_Paraguayo Wrote: Then the GPIO pins should work, shouldn't they?

It does seem a bit unnecessary to be running Kodi as root. Does that happen by default or does the OP need to do something different to enable that.

It's how LIbreElec is made. I have no idea why everything is done from root.
OK - but does Kodi run as root too? If so, the GPIO pins should be available.
BBC Live Football Scores: Football scores notifications service.
script.squeezeinfo: shows what's playing on your Logitech Media Server
Reply

Logout Mark Read Team Forum Stats Members Help
Hello, help me Im dumb. Addon to control relays0