annotate py/setup_gpio.sh @ 215:4d82099d1fe0
use requests rather than urllib2, better ipv6->ipv4 fallback
author |
Matt Johnston <matt@ucc.asn.au> |
date |
Fri, 25 Jul 2014 23:53:38 +0800 |
parents |
d03157c7ad60 |
children |
659953f2ee03 |
rev |
line source |
148
|
1 #!/bin/sh |
|
2 |
|
3 # this must run as root |
|
4 |
155
|
5 PINS="17 7 24 25" |
148
|
6 GROUP=fridgeio |
|
7 |
155
|
8 for PIN in $PINS; do |
|
9 echo $PIN > /sys/class/gpio/export |
148
|
10 |
155
|
11 for f in direction value; do |
|
12 fn=/sys/devices/virtual/gpio/gpio$PIN/$f |
|
13 chgrp $GROUP $fn |
|
14 chmod g+rw $fn |
|
15 done |
148
|
16 done |