Difference between revisions of "Chumby device settings information on /proc"
(→/proc/sys/sense1/dimlevel) |
PaperClippy (Talk | contribs) m (→/proc/chumby-wifi/link-status) |
||
(21 intermediate revisions by 10 users not shown) | |||
Line 9: | Line 9: | ||
CPU architecture: 5TEJ | CPU architecture: 5TEJ | ||
etc. | etc. | ||
+ | |||
+ | Note, most of these files will be migrating out of /proc in the future to /sys, so do not write code that expects these files to be present all the time. | ||
+ | |||
+ | ==/proc/driver== | ||
+ | ===/proc/driver/imxfb=== | ||
+ | ====/proc/driver/imxfb/enable==== | ||
+ | Contains 0 to display the framebuffer 0. Set 1 to composite the framebuffer 1 with the framebuffer 0 with alpha transparency. | ||
+ | |||
+ | ====/proc/driver/imxfb/alpha==== | ||
+ | Contains a hexadecimal value (between 0x00 and 0xff) indicating the alpha transparency to the framebuffer 0 when the enabled framebuffer is 1 | ||
==/proc/sys== | ==/proc/sys== | ||
Line 29: | Line 39: | ||
====/proc/sys/sense1/debounce==== | ====/proc/sys/sense1/debounce==== | ||
====/proc/sys/sense1/hpin==== | ====/proc/sys/sense1/hpin==== | ||
+ | |||
+ | Contains 1 if something is plugged into the audio-out (headphone) jack. | ||
+ | |||
====/proc/sys/sense1/BTvolts==== | ====/proc/sys/sense1/BTvolts==== | ||
+ | |||
+ | Keeps reporting -1 as voltage... bug? | ||
+ | |||
+ | --[[User:PaperClippy|PaperClippy]] 12:05, 3 May 2009 (UTC) | ||
+ | |||
====/proc/sys/sense1/DCvolts==== | ====/proc/sys/sense1/DCvolts==== | ||
+ | |||
+ | Keeps reporting -1 as voltage... bug?<br> | ||
+ | --[[User:BuZz|BuZz]] 04:43, 12 December 2007 (PST) | ||
+ | |||
====/proc/sys/sense1/dimlevel==== | ====/proc/sys/sense1/dimlevel==== | ||
− | Dim the screen (night mode) with echo 1 > /proc/sys/sense1/dimlevel | + | *Full brightness (normal mode) with '''echo 0 > /proc/sys/sense1/dimlevel''' |
+ | *Dim the screen (night mode) with '''echo 1 > /proc/sys/sense1/dimlevel''' | ||
+ | *Screen off with '''echo 2 > /proc/sys/sense1/dimlevel''' | ||
+ | |||
+ | ''This worked for me once, then it stopped. Don't know why. dimlevel does reflect the current dimlevel if I change it manually via the ControlPanel, however.'' | ||
+ | |||
+ | ''Update: It works for me again. Did I do something wrong before?'' | ||
+ | |||
+ | NOTE! Because of the way the (Ironforge) backlight/LCD power supply is designed, you CANNOT go from "off" to "dim", you MUST go to full brightness for at least a few hundred milliseconds (empirical) before doing to dim. (More here: http://forum.chumby.com/viewtopic.php?id=1482) Here's an example shell script: | ||
− | ' | + | <pre>#!/bin/sh |
+ | #turn screen off | ||
+ | echo 2 > /proc/sys/sense1/dimlevel | ||
+ | #wait a bit to demonstrate my point | ||
+ | sleep 10 | ||
+ | #unless the next two lines are present, chumby's screen will look inverse and distorted | ||
+ | #comment them out and try for yourself | ||
+ | echo 0 > /proc/sys/sense1/dimlevel | ||
+ | sleep 1 | ||
+ | echo 1 > /proc/sys/sense1/dimlevel</pre> | ||
====/proc/sys/sense1/spkmute==== | ====/proc/sys/sense1/spkmute==== | ||
Line 52: | Line 91: | ||
TODO: How to convert this to human readable values? | TODO: How to convert this to human readable values? | ||
+ | |||
+ | Perhaps the infos from Texas Instruments about controller TSC2100 are interesting: http://focus.ti.com/lit/ds/symlink/tsc2100.pdf. On page 21 ff. the temperature-measurement of the chip is mentioned. | ||
===/proc/chumby/battery-voltage=== | ===/proc/chumby/battery-voltage=== | ||
Line 58: | Line 99: | ||
Most recent values are at the head of the file. | Most recent values are at the head of the file. | ||
− | + | How to convert this to human readable values? /proc/chumby/power-summary may be used, but requires de-formatting. | |
+ | |||
+ | The values in /proc/chumby/battery-voltage-history can be converted to human readability (see contents of power-summary), but don't seem to be related to the values in /proc/chumby/battery-voltage. | ||
+ | |||
+ | ===/proc/chumby/power-summary=== | ||
+ | Contains formatted & labeled human-readable information on the 9V battery and DC line. | ||
+ | |||
+ | chumby:/# cat /proc/chumby/power-summary | ||
+ | |||
+ | Chumby is plugged into the wall and the battery voltage is 9.36 volts. | ||
+ | |||
+ | Timer Poll Interval...........................1000 msecs | ||
+ | DCLine Measurement Poll Interval..............4000 msecs | ||
+ | Unplugged Battery Measurement Poll Interval...4000 msecs | ||
+ | Plugged-in Battery Measurement Poll Interval..4000 msecs | ||
+ | Time until next DCLine voltage measurement....1000 msecs | ||
+ | Time until next battery voltage measurement...1000 msecs | ||
+ | Voltage Sample Count..........................5 | ||
+ | Voltage Samples...............................5 | ||
+ | [dc_unplugged_threshold]......................170 | ||
+ | [dc_and_battery_dead_threshold]...............184 | ||
+ | [battery_dead_threshold]......................162 | ||
+ | [raw9volts]...................................195 | ||
+ | Time until next SIGPWR signal.................0 seconds | ||
+ | [sigpwr_holdoff]..............................30 seconds | ||
+ | [sigpwr_pid]..................................2079 | ||
+ | Plugged into wall? [avg_dc_power(258) >= dc_unplugged_threshold(170)?] -- YES | ||
+ | Battery installed? [avg_batt_power(203) > raw9volts(195)/2 && avg_batt_power <= raw10volts(216)?] -- YES | ||
+ | Battery voltage 9.36 [avg_batt_power(203) * 900 / raw9volts(195)] | ||
+ | Battery dead? [dc_and_battery_dead_threshold(184) < 0 || avg_batt_power(203) < dc_and_battery_dead_threshold?] -- NO | ||
+ | |||
+ | It can be configured using: | ||
+ | */proc/chumby/battery-dead-threshold (default 154) | ||
+ | */proc/chumby/dc-and-battery-dead-threshold (default 174) | ||
+ | */proc/chumby/dc-unplugged-threshold (default 170) | ||
+ | */proc/chumby/dcline-poll-interval (default 4000) | ||
+ | */proc/chumby/pluggedin-battery-poll-interval (default 4000) | ||
+ | */proc/chumby/raw9volts (default 185) | ||
+ | */proc/chumby/unplugged-battery-poll-interval (default 4000) | ||
+ | */proc/chumby/voltage-sample-count (default 5) | ||
===/proc/chumby/tsc2100=== | ===/proc/chumby/tsc2100=== | ||
Line 100: | Line 180: | ||
echo 1 > /proc/chumby/touchscreen/touchclick | echo 1 > /proc/chumby/touchscreen/touchclick | ||
− | ===/proc/chumby/touchscreen/ | + | ===/proc/chumby/touchscreen/timer-interval=== |
+ | shows when the data(coordiantes + pressure) from the touchscreen are polled by the driver. | ||
+ | cat /proc/chumby/touchscreen/timer-interval | ||
+ | 1000 milliseconds | ||
+ | |||
+ | to change it (default value is 1000) | ||
+ | echo 1000 > /proc/chumby/touchscreen/timer-interval | ||
+ | |||
+ | note: Setting this value to high values, like 1000000 doesn't seem to change anything. | ||
===/proc/chumby/touchscreen/coordinates=== | ===/proc/chumby/touchscreen/coordinates=== | ||
Line 142: | Line 230: | ||
==/proc/chumby-wifi== | ==/proc/chumby-wifi== | ||
===/proc/chumby-wifi/network-status=== | ===/proc/chumby-wifi/network-status=== | ||
+ | |||
+ | chumby:/# cat /proc/chumby-wifi/network-status | ||
+ | MEDIA_CONNECTED=1 | ||
+ | ADHOC_ON()=0 | ||
+ | INFRA_ON()=1 | ||
+ | ADAPTER_RESET_IN_PROGRESS=0 | ||
+ | ADAPTER_HALT_IN_PROGRESS=0 | ||
+ | |||
===/proc/chumby-wifi/link-status=== | ===/proc/chumby-wifi/link-status=== | ||
+ | |||
+ | chumby:/# cat /proc/chumby-wifi/link-status | ||
+ | 2: STATUS=0 NETWORK=INFRA SSID=<Wireless> AUTH=WPA2-PSK ENCRYPT=AES KEY=AES[xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx] | ||
+ | |||
===/proc/chumby-wifi/regs=== | ===/proc/chumby-wifi/regs=== | ||
===/proc/chumby-wifi/bss-scantab=== | ===/proc/chumby-wifi/bss-scantab=== |
Latest revision as of 05:23, 3 May 2009
Contents
- 1 Device access
- 1.1 /proc/driver
- 1.2 /proc/sys
- 1.2.1 /proc/sys/accel
- 1.2.2 /proc/sys/timerx
- 1.2.3 /proc/sys/sense1
- 1.2.3.1 /proc/sys/sense1/resetSerial
- 1.2.3.2 /proc/sys/sense1/debounce
- 1.2.3.3 /proc/sys/sense1/hpin
- 1.2.3.4 /proc/sys/sense1/BTvolts
- 1.2.3.5 /proc/sys/sense1/DCvolts
- 1.2.3.6 /proc/sys/sense1/dimlevel
- 1.2.3.7 /proc/sys/sense1/spkmute
- 1.2.3.8 /proc/sys/sense1/dbg-error
- 1.2.3.9 /proc/sys/sense1/dbg-ioctl
- 1.2.3.10 /proc/sys/sense1/dbg-trace
- 1.3 /proc/chumby
- 1.3.1 /proc/chumby/temperature
- 1.3.2 /proc/chumby/battery-voltage
- 1.3.3 /proc/chumby/power-summary
- 1.3.4 /proc/chumby/tsc2100
- 1.3.5 /proc/chumby/tsc2100/control5-page2
- 1.3.6 /proc/chumby/tsc2100/control4-page2
- 1.3.7 /proc/chumby/tsc2100/pll2-page2
- 1.3.8 /proc/chumby/tsc2100/pll1-page2
- 1.3.9 /proc/chumby/tsc2100/control3-page2
- 1.3.10 /proc/chumby/tsc2100/powercon-page2
- 1.3.11 /proc/chumby/tsc2100/control2-page2
- 1.3.12 /proc/chumby/tsc2100/sidetone-page2
- 1.3.13 /proc/chumby/tsc2100/audiodac-page2
- 1.3.14 /proc/chumby/tsc2100/audioadc-page2
- 1.3.15 /proc/chumby/tsc2100/control1-page2
- 1.3.16 /proc/chumby/tsc2100/refctl-page1
- 1.3.17 /proc/chumby/tsc2100/adc-page1
- 1.3.18 /proc/chumby/tsc2100/registers
- 1.3.19 /proc/chumby/audio
- 1.3.20 /proc/chumby/audio/side-tone
- 1.3.21 /proc/chumby/audio/side-tone/digital-gain
- 1.3.22 /proc/chumby/audio/side-tone/digital-mute
- 1.3.23 /proc/chumby/audio/side-tone/analog-gain
- 1.3.24 /proc/chumby/audio/side-tone/analog-mute
- 1.3.25 /proc/chumby/audio/mixer
- 1.3.26 /proc/chumby/audio/mixer/both-speakers
- 1.3.27 /proc/chumby/audio/mixer/both-speakers/volume
- 1.3.28 /proc/chumby/audio/mixer/both-speakers/mute
- 1.3.29 /proc/chumby/audio/mixer/right-speaker
- 1.3.30 /proc/chumby/audio/mixer/right-speaker/volume
- 1.3.31 /proc/chumby/audio/mixer/right-speaker/mute
- 1.3.32 /proc/chumby/audio/mixer/left-speaker
- 1.3.33 /proc/chumby/audio/mixer/left-speaker/volume
- 1.3.34 /proc/chumby/audio/mixer/left-speaker/mute
- 1.3.35 /proc/chumby/touchscreen
- 1.3.36 /proc/chumby/touchscreen/touchclick
- 1.3.37 /proc/chumby/touchscreen/timer-interval
- 1.3.38 /proc/chumby/touchscreen/coordinates
- 1.3.39 /proc/chumby/touchscreen/enable
- 1.4 /proc/chumby-wifi
- 1.4.1 /proc/chumby-wifi/network-status
- 1.4.2 /proc/chumby-wifi/link-status
- 1.4.3 /proc/chumby-wifi/regs
- 1.4.4 /proc/chumby-wifi/bss-scantab
- 1.4.5 /proc/chumby-wifi/mlme-aux
- 1.4.6 /proc/chumby-wifi/mlme-struct
- 1.4.7 /proc/chumby-wifi/dev-stats
- 1.4.8 /proc/chumby-wifi/counters
- 1.4.9 /proc/chumby-wifi/active-config
- 1.4.10 /proc/chumby-wifi/port-config
- 1.4.11 /proc/chumby-wifi/rtmp-adapter
- 1.4.12 /proc/chumby-wifi/trace-buffer
- 1.4.13 /proc/chumby-wifi/dbug-pages
- 1.4.14 /proc/chumby-wifi/dbug-level
- 1.4.15 /proc/chumby-wifi/RTDebugLevel
Device access
On Linux you can communicate with "device drivers" through the "/proc" filesystem. For example,
chumby:~# cat /proc/cpuinfo Processor : ARM926EJ-Sid(wb) rev 4 (v5l) BogoMIPS : 174.89 Features : swp half thumb fastmult edsp java CPU implementer : 0x41 CPU architecture: 5TEJ etc.
Note, most of these files will be migrating out of /proc in the future to /sys, so do not write code that expects these files to be present all the time.
/proc/driver
/proc/driver/imxfb
/proc/driver/imxfb/enable
Contains 0 to display the framebuffer 0. Set 1 to composite the framebuffer 1 with the framebuffer 0 with alpha transparency.
/proc/driver/imxfb/alpha
Contains a hexadecimal value (between 0x00 and 0xff) indicating the alpha transparency to the framebuffer 0 when the enabled framebuffer is 1
/proc/sys
Here are some chumby-specific system driver files
/proc/sys/accel
/proc/sys/accel/romBusy
/proc/sys/accel/painThresh
/proc/sys/accel/touchThresh
/proc/sys/accel/dbg-error
/proc/sys/accel/dbg-ioctl
/proc/sys/accel/dbg-trace
/proc/sys/timerx
/proc/sys/timerx/dbg-error
/proc/sys/timerx/dbg-ioctl
/proc/sys/timerx/dbg-trace
/proc/sys/sense1
/proc/sys/sense1/resetSerial
/proc/sys/sense1/debounce
/proc/sys/sense1/hpin
Contains 1 if something is plugged into the audio-out (headphone) jack.
/proc/sys/sense1/BTvolts
Keeps reporting -1 as voltage... bug?
--PaperClippy 12:05, 3 May 2009 (UTC)
/proc/sys/sense1/DCvolts
Keeps reporting -1 as voltage... bug?
--BuZz 04:43, 12 December 2007 (PST)
/proc/sys/sense1/dimlevel
- Full brightness (normal mode) with echo 0 > /proc/sys/sense1/dimlevel
- Dim the screen (night mode) with echo 1 > /proc/sys/sense1/dimlevel
- Screen off with echo 2 > /proc/sys/sense1/dimlevel
This worked for me once, then it stopped. Don't know why. dimlevel does reflect the current dimlevel if I change it manually via the ControlPanel, however.
Update: It works for me again. Did I do something wrong before?
NOTE! Because of the way the (Ironforge) backlight/LCD power supply is designed, you CANNOT go from "off" to "dim", you MUST go to full brightness for at least a few hundred milliseconds (empirical) before doing to dim. (More here: http://forum.chumby.com/viewtopic.php?id=1482) Here's an example shell script:
#!/bin/sh #turn screen off echo 2 > /proc/sys/sense1/dimlevel #wait a bit to demonstrate my point sleep 10 #unless the next two lines are present, chumby's screen will look inverse and distorted #comment them out and try for yourself echo 0 > /proc/sys/sense1/dimlevel sleep 1 echo 1 > /proc/sys/sense1/dimlevel
/proc/sys/sense1/spkmute
Speaker mute (master?)
/proc/sys/sense1/dbg-error
/proc/sys/sense1/dbg-ioctl
/proc/sys/sense1/dbg-trace
/proc/chumby
Chumby has a special section just for Chumby-specific drivers. It's in /proc/chumby*
/proc/chumby/temperature
Appears to contain the most recent polled temperature values in raw format.
Most recent values are at the head of the file.
TODO: How to convert this to human readable values?
Perhaps the infos from Texas Instruments about controller TSC2100 are interesting: http://focus.ti.com/lit/ds/symlink/tsc2100.pdf. On page 21 ff. the temperature-measurement of the chip is mentioned.
/proc/chumby/battery-voltage
Appears to contain the most recent polled battery voltage values in raw format.
Most recent values are at the head of the file.
How to convert this to human readable values? /proc/chumby/power-summary may be used, but requires de-formatting.
The values in /proc/chumby/battery-voltage-history can be converted to human readability (see contents of power-summary), but don't seem to be related to the values in /proc/chumby/battery-voltage.
/proc/chumby/power-summary
Contains formatted & labeled human-readable information on the 9V battery and DC line.
chumby:/# cat /proc/chumby/power-summary Chumby is plugged into the wall and the battery voltage is 9.36 volts. Timer Poll Interval...........................1000 msecs DCLine Measurement Poll Interval..............4000 msecs Unplugged Battery Measurement Poll Interval...4000 msecs Plugged-in Battery Measurement Poll Interval..4000 msecs Time until next DCLine voltage measurement....1000 msecs Time until next battery voltage measurement...1000 msecs Voltage Sample Count..........................5 Voltage Samples...............................5 [dc_unplugged_threshold]......................170 [dc_and_battery_dead_threshold]...............184 [battery_dead_threshold]......................162 [raw9volts]...................................195 Time until next SIGPWR signal.................0 seconds [sigpwr_holdoff]..............................30 seconds [sigpwr_pid]..................................2079 Plugged into wall? [avg_dc_power(258) >= dc_unplugged_threshold(170)?] -- YES Battery installed? [avg_batt_power(203) > raw9volts(195)/2 && avg_batt_power <= raw10volts(216)?] -- YES Battery voltage 9.36 [avg_batt_power(203) * 900 / raw9volts(195)] Battery dead? [dc_and_battery_dead_threshold(184) < 0 || avg_batt_power(203) < dc_and_battery_dead_threshold?] -- NO
It can be configured using:
- /proc/chumby/battery-dead-threshold (default 154)
- /proc/chumby/dc-and-battery-dead-threshold (default 174)
- /proc/chumby/dc-unplugged-threshold (default 170)
- /proc/chumby/dcline-poll-interval (default 4000)
- /proc/chumby/pluggedin-battery-poll-interval (default 4000)
- /proc/chumby/raw9volts (default 185)
- /proc/chumby/unplugged-battery-poll-interval (default 4000)
- /proc/chumby/voltage-sample-count (default 5)
/proc/chumby/tsc2100
/proc/chumby/tsc2100/control5-page2
/proc/chumby/tsc2100/control4-page2
/proc/chumby/tsc2100/pll2-page2
/proc/chumby/tsc2100/pll1-page2
/proc/chumby/tsc2100/control3-page2
/proc/chumby/tsc2100/powercon-page2
/proc/chumby/tsc2100/control2-page2
/proc/chumby/tsc2100/sidetone-page2
/proc/chumby/tsc2100/audiodac-page2
/proc/chumby/tsc2100/audioadc-page2
/proc/chumby/tsc2100/control1-page2
/proc/chumby/tsc2100/refctl-page1
/proc/chumby/tsc2100/adc-page1
/proc/chumby/tsc2100/registers
/proc/chumby/audio
/proc/chumby/audio/side-tone
/proc/chumby/audio/side-tone/digital-gain
/proc/chumby/audio/side-tone/digital-mute
/proc/chumby/audio/side-tone/analog-gain
/proc/chumby/audio/side-tone/analog-mute
/proc/chumby/audio/mixer
/proc/chumby/audio/mixer/both-speakers
/proc/chumby/audio/mixer/both-speakers/volume
/proc/chumby/audio/mixer/both-speakers/mute
/proc/chumby/audio/mixer/right-speaker
/proc/chumby/audio/mixer/right-speaker/volume
/proc/chumby/audio/mixer/right-speaker/mute
/proc/chumby/audio/mixer/left-speaker
/proc/chumby/audio/mixer/left-speaker/volume
/proc/chumby/audio/mixer/left-speaker/mute
/proc/chumby/touchscreen
/proc/chumby/touchscreen/touchclick
Contains 1 if touchscreen click is enabled.
Contains 0 if touchscreen click is disabled.
You can enable the touchscreen click by putting a 1 in this file:
echo 1 > /proc/chumby/touchscreen/touchclick
/proc/chumby/touchscreen/timer-interval
shows when the data(coordiantes + pressure) from the touchscreen are polled by the driver.
cat /proc/chumby/touchscreen/timer-interval 1000 milliseconds
to change it (default value is 1000)
echo 1000 > /proc/chumby/touchscreen/timer-interval
note: Setting this value to high values, like 1000000 doesn't seem to change anything.
/proc/chumby/touchscreen/coordinates
Shows the most recent 29(?) touchscreen events.
Most recent values are at the head of the file.
This example shows the last two events once per second. Run this and then touch the screen to see it update.
chumby:~# while [ 1 ] ; do head -2 /proc/chumby/touchscreen/coordinates ; sleep 1 ; done
There appear to be two events logged in the coordinates file, pen-up and pen-down.
- pen-up is logged when you stop touching the screen. Its coordinates are always 0.
- pen-down is continuously logged when you are touching the screen. Its coordinates reflect the location you are touching on the screen (x,y) and the pressure applied (p).
- P is LARGER for lighter touches. It seems to range from 0 - 10000 most of the time, but I have seen some values over 19,000.
- Y coordinates range from about 167 to 3920 on my screen, left to right.
- X coordinates range from about 220 to 3860 on my screen, bottom to top.
chumby:~# head /proc/chumby/touchscreen/coordinates 256: x=0 y=0 p=0 pen-up 255: x=564 y=3763 p=6698 pen-down 254: x=561 y=3768 p=6052 pen-down 253: x=561 y=3757 p=5798 pen-down 252: x=566 y=3760 p=5677 pen-down 251: x=573 y=3761 p=5767 pen-down 250: x=579 y=3757 p=5873 pen-down 249: x=583 y=3762 p=6122 pen-down 248: x=590 y=3761 p=6426 pen-down 247: x=590 y=3752 p=6633 pen-down
/proc/chumby/touchscreen/enable
Contains 1 if touchscreen is enabled.
Contains 0 if touchscreen is disabled.
You can disable the touchscreen by putting a 0 in this file:
echo 0 > /proc/chumby/touchscreen/enable
/proc/chumby-wifi
/proc/chumby-wifi/network-status
chumby:/# cat /proc/chumby-wifi/network-status MEDIA_CONNECTED=1 ADHOC_ON()=0 INFRA_ON()=1 ADAPTER_RESET_IN_PROGRESS=0 ADAPTER_HALT_IN_PROGRESS=0
/proc/chumby-wifi/link-status
chumby:/# cat /proc/chumby-wifi/link-status 2: STATUS=0 NETWORK=INFRA SSID=<Wireless> AUTH=WPA2-PSK ENCRYPT=AES KEY=AES[xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx]