Saturday, January 2, 2016

Linux USB maxpower command and outputs

Sat Jan 02 11:35:53 craiga>lsusb -v |grep 'Bus\|MaxPower'

Bus 001 Device 002: ID 0a5c:bd11 Broadcom Corp. TiVo AG0100 802.11bg Wireless Adapter [Broadcom BCM4320]
      (Bus Powered)
    MaxPower              200mA



Bus 001 Device 002: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
      (Bus Powered)
    MaxPower              500mA
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    MaxPower                0mA

Asterisk to control GPIO on Beaglebone

Couldn't figure out Freepbx GUI, so went to /etc/asterisk/extensions_custom.conf and added these extensions:


exten => 3000,1,Playback(one-moment-please)
exten => 3000,2,System(/var/lib/asterisk/myscripts/heatoff.sh)
exten => 3000,n,Hangup

exten => 3001,1,Playback(one-moment-please)
exten => 3001,2,System(/var/lib/asterisk/myscripts/heaton.sh)
exten => 3001,n,Hangup


Executing System(do some stuff to GPIO) but ran into permissions problem.  After changing "direction" to 666 asterisk appears to have access.

root@raspbx:/# ls -l /sys/class/gpio/gpio7/
total 0
-rw-r--r-- 1 root root 4096 Jan  2 18:26 active_low
-rw-r--r-- 1 root root 4096 Jan  2 17:40 direction
-rw-r--r-- 1 root root 4096 Jan  2 18:26 edge
drwxr-xr-x 2 root root    0 Jan  2 18:26 power
lrwxrwxrwx 1 root root    0 Jan  2 18:26 subsystem -> ../../../../class/gpio
-rw-r--r-- 1 root root 4096 Jan  2 18:26 uevent
-rw-r--r-- 1 root root 4096 Jan  2 07:10 value

root@raspbx:/# cd /sys/class/gpio/gpio7/
root@raspbx:/sys/class/gpio/gpio7# ls
active_low  direction  edge  power  subsystem  uevent  value
root@raspbx:/sys/class/gpio/gpio7# chmod 666 direction
root@raspbx:/sys/class/gpio/gpio7# ls -l
total 0
-rw-r--r-- 1 root root 4096 Jan  2 18:26 active_low
-rw-rw-rw- 1 root root 4096 Jan  2 17:40 direction
-rw-r--r-- 1 root root 4096 Jan  2 18:26 edge
drwxr-xr-x 2 root root    0 Jan  2 18:26 power
lrwxrwxrwx 1 root root    0 Jan  2 18:26 subsystem -> ../../../../class/gpio
-rw-r--r-- 1 root root 4096 Jan  2 18:26 uevent
-rw-r--r-- 1 root root 4096 Jan  2 07:10 value