Chumby device settings information on /proc

=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/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/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:

echo 2 > /proc/sys/sense1/dimlevel sleep 10 echo 0 > /proc/sys/sense1/dimlevel sleep 1 echo 1 > /proc/sys/sense1/dimlevel
 * 1) !/bin/sh
 * 2) turn screen off
 * 1) wait a bit to demonstrate my point
 * 1) unless the next two lines are present, chumby's screen will look inverse and distorted
 * 2) comment them out and try for yourself

/proc/sys/sense1/spkmute
Speaker mute (master?)

/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/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/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= AUTH=WPA2-PSK ENCRYPT=AES KEY=AES[xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx]