annotate py/setup_gpio.sh @ 149:d686b111dab4

working better. logging works properly, cleanup fridge.off() happens.
author Matt Johnston <matt@ucc.asn.au>
date Sun, 16 Dec 2012 22:14:46 +0800
parents b32e5a11a4cb
children d03157c7ad60
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
148
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
1 #!/bin/sh
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
2
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
3 # this must run as root
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
4
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
5 PIN=17
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
6 GROUP=fridgeio
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
7
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
8 echo $PIN > /sys/class/gpio/export
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
9
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
10 for f in direction value; do
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
11 fn=/sys/devices/virtual/gpio/gpio$PIN/$f
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
12 chgrp $GROUP $fn
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
13 chmod g+rw $fn
b32e5a11a4cb few updates, seems to run
Matt Johnston <matt@ucc.asn.au>
parents:
diff changeset
14 done