Please select To the mobile version | Continue to access the desktop computer version

OrangePi

 Login            
 Register            
Search
Hot search: orangepi
Author: Boten

GPIO ADDON & OPENELEC

[Copy link]

1

Threads

6

Posts

46

Credits

Novice

Rank: 1

Credits
46
 Author| Post time 2016-10-17 23:01:53 | Show all posts
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

1128

Posts

8248

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
8248
Post time 2016-10-17 23:48:02 | Show all posts
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| Post time 2016-10-18 20:05:15 | Show all posts
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

1128

Posts

8248

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
8248
Post time 2016-10-19 00:54:33 | Show all posts
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
Post time 2016-11-4 03:14:16 | Show all posts
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

2663

Credits

Gold member

Rank: 6Rank: 6

Credits
2663
Post time 2016-11-7 02:28:32 | Show all posts
Thank you Jernej for your work. I will try to use this library for connect a power off button.

4

Threads

1128

Posts

8248

Credits

Moderator

Rank: 7Rank: 7Rank: 7

Credits
8248
Post time 2016-11-7 05:53:15 | Show all posts
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

2663

Credits

Gold member

Rank: 6Rank: 6

Credits
2663
Post time 2016-11-8 01:37:57 | Show all posts
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
Post time 2016-12-11 19:09:13 | Show all posts
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 the 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 the 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

408

Credits

Intermediate member

Rank: 3Rank: 3

Credits
408
Post time 2016-12-11 23:11:58 | Show all posts
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 have to log in before you can reply Login | Register

Points Rules

Archiver|Mobile edition|Darkroom|OrangePi En ( 粤ICP备14086627号-2

2021-11-27 07:58 GMT+8 , Processed in 0.034645 second(s), 20 queries .

Powered by Discuz! X3.2

© 2014-2015 orangepibbs en.

Quick Reply To Top Return to the list