Author: Boten

GPIO ADDON & OPENELEC

[Copy link]

1

threads

6

posts

46

credits

Novice

Rank: 1

credits
46
 Author| Published in 2016-10-17 23:01:53 | Show all floors
it's still non responsive, i even tried to turn all the wpi out & on without success! i feel like the GPIO library is not responsive at all.

As i said before, i'm trying to run a 5V fan:








4

threads

1118

posts

9187

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9187
Published in 2016-10-17 23:48:02 | Show all floors
Ok, I forgot to mention few things. Those pins are 3.3V only and they can provide only 10mA of current or so. Both of these two ratings are too low, especially current is waaay too low. What you need is an additional circuit like this here: http://elinux.org/RPi_GPIO_Interface_Circuits#Using_a_FET But first, please check with multimeter that you can really control those pins. If you are ok with always on fan, you can simply connect it to +5V and GND.

1

threads

6

posts

46

credits

Novice

Rank: 1

credits
46
 Author| Published in 2016-10-18 20:05:15 | Show all floors
jernej replied at 2016-10-17 23:48
Ok, I forgot to mention few things. Those pins are 3.3V only and they can provide only 10mA of curre ...

sounds a bit complicated... that's the think i'm not ok with fan always on, it needs to be run depending the temp.

4

threads

1118

posts

9187

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9187
Published in 2016-10-19 00:54:33 | Show all floors
Actually, instructions are the simplest one. I guess you should ask someone who has some knowledge about electronics and soldering. It is basic stuff. Pins (GPIOs) on SoCs are meant only to signal, so they don't need much current or voltage to do that. To actually drive something, you need some kind of electronic switch. Transistors, especially MOSFETs, are good for that. Well, it is more complicated than that, but for your understanding it is ok.

3

threads

15

posts

211

credits

Intermediate member

Rank: 3Rank: 3

credits
211
Published in 2016-11-4 03:14:16 | Show all floors
I can confirm that library is working, congratulations on your work. Now I'll work on input mode(switch, rotary encoder). Any sugguestions?

4

threads

53

posts

2935

credits

Gold member

Rank: 6Rank: 6

credits
2935
Published in 2016-11-7 02:28:32 | Show all floors
Thank you Jernej for your work. I will try to use this library for connect a power off button.

4

threads

1118

posts

9187

credits

Moderator

Rank: 7Rank: 7Rank: 7

credits
9187
Published in 2016-11-7 05:53:15 | Show all floors
Giachi replied at 2016-11-6 19:28
Thank you Jernej for your work. I will try to use this library for connect a power off button.

It is not a library, just "gpio" program. Same functionality could be achieved trough sysfs...

4

threads

53

posts

2935

credits

Gold member

Rank: 6Rank: 6

credits
2935
Published in 2016-11-8 01:37:57 | Show all floors
jernej replied at 2016-11-7 05:53
It is not a library, just "gpio" program. Same functionality could be achieved trough sysfs...

excuse me for the mistaked word. I will try this plugin connecting a button for power off use.

10

threads

55

posts

345

credits

Intermediate member

Rank: 3Rank: 3

credits
345
Published in 2016-12-11 19:09:13 | Show all floors
I have some problem when i try to switch off the fan controlled by a pin.

I don't know why it remains active.

I switch on my pin on startup (that's my autostart.sh)  At startup it also activate acestream -- and it works!
  1. (modprobe gpio-sunxi;
  2. echo 1 > /sys/class/gpio_sw/PD14/data;)&
  3. (
  4. /storage/.config/.acestream/start_acestream.sh --client-console
  5. --live-cache-type disk
  6. )&
Copy code


The problems are in my shutdown.sh because the fan does not turn off always. I suppose that some case are missing.
  1. #!/bin/sh

  2. case "$1" in
  3.   halt)
  4.     echo 0 > /sys/class/gpio_sw/PD14/data
  5.     ;;
  6.   poweroff)
  7.         echo 0 > /sys/class/gpio_sw/PD14/data
  8.     ;;
  9.   reboot)
  10.         echo 0 > /sys/class/gpio_sw/PD14/data
  11.     ;;
  12.   *)
  13.         /storage/.config/.acestream/stop_acestream.sh
  14.         echo 0 > /sys/class/gpio_sw/PD14/data
  15.     ;;
  16. esac

  17. #(

  18. #/storage/.config/.acestream/stop_acestream.sh
  19. #)&
Copy code


So it works when - from console - I type "reboot" or "shutdown".
It doesn't work when I choose the shutdown button from UI.
From UI works on the reboot button.


Help and suggestions are appreciated.

6

threads

26

posts

466

credits

Intermediate member

Rank: 3Rank: 3

credits
466
Published in 2016-12-11 23:11:58 | Show all floors
It sounds like that almost work but only shutdown button doesn't work.
if so as for me also shutdown button works as suspend.
I don't know whether it is related.
You need to log in before you can reply login | Register

Points Rule

Quick reply Top Return list