Author Topic: Mb-applet-powerctrl  (Read 34829 times)

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #60 on: July 10, 2007, 07:56:09 am »
next version:
card ctrl should be add into at first.
But I do not know how to usb serial device's infor?
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #61 on: July 10, 2007, 09:10:48 pm »
Quote
next version:
card ctrl should be add into at first.
But I do not know how to usb serial device's infor?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=164643\"][{POST_SNAPBACK}][/a][/div]

here's my hacked mb-applet-card.c
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

pelrun

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Mb-applet-powerctrl
« Reply #62 on: July 10, 2007, 10:19:17 pm »
Here's a quick patch to add a approximate percentage battery charge reading when connected to AC power, since apm helpfully refuses to tell us.

I was pleasantly surprised to find the applet already has support for displaying it once it is supplied!
SL-C3100 with usb power mod running debian eabi
pdaXii13 still on the NAND for dualbooting
16GB SDHC! (a new one, after I sat on the old one and it went kaput)
D-Link 660 wifi, Socket Bluetooth rev H
External 9800mAh LiIon battery and slimline dvd drive
Homebrew microphone and remote

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #63 on: July 10, 2007, 10:50:05 pm »
Thanks Meanie & pelrun, I will try.
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

wrc4

  • Full Member
  • ***
  • Posts: 114
    • View Profile
Mb-applet-powerctrl
« Reply #64 on: July 11, 2007, 10:40:20 pm »
Anybody tried it on R198?

I installed it and got the following error after started:

mb-applet-powerctrl: failed to open /proc/driver/fl/corgi-bl.
mb-applet-powerctrl: failed to open /proc/zaurus/VCORE.
...

and when using it, I got a lot of:
mb-applet-powerctrl: failed to open /proc/zaurus/VCORE.

and the speedstep thing didn't happen.

Any idea?
Zaurus SL-C1000 (Debian)
Zaurus SL-7500C
Nokia N810
KOHJINSHA SC3
ASUS EEEPC 701
ASUS WL-HDD 2.5
ASUS WL-500GPv2
WD MyBookWorldEdition (with a Segate 500G HD inside)

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #65 on: July 11, 2007, 11:13:16 pm »
Quote
Anybody tried it on R198?

I installed it and got the following error after started:

mb-applet-powerctrl: failed to open /proc/driver/fl/corgi-bl.
mb-applet-powerctrl: failed to open /proc/zaurus/VCORE.
...

and when using it, I got a lot of:
mb-applet-powerctrl: failed to open /proc/zaurus/VCORE.

and the speedstep thing didn't happen.

Any idea?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=164755\"][{POST_SNAPBACK}][/a][/div]

the r198 kernel is very different and wont just play game. the applet needs to be enhanced to also support the 2.6 kernel, but that is something that will happen later. at least it wont crash anymore (it used to just crash). the cpu and volume thing wont work without some enhancements to the code, but most of the other features should work...
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #66 on: July 16, 2007, 05:51:57 am »
Add card control according to meanie's mb-applet-card.c
Add charge percent according to pelrun's patch, but it seems not exactly on my C1000.
Add usb device check, not only storage.

Please test it and tell me result.

Next:
add usb function.
« Last Edit: July 16, 2007, 06:19:28 am by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #67 on: July 16, 2007, 06:17:34 am »
My friend, Yangyang has post a cpu26 test program, but my C1K is not use r198 yet.
The program is test ok on c1k, r198. If interesting it, you may merge it to powerctrl.
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

pelrun

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
    • http://
Mb-applet-powerctrl
« Reply #68 on: July 16, 2007, 08:09:22 am »
The ac charge percentage is never going to exactly match the no-ac charge percentage from apm at partial charge. More important is for 100% to be right and 0% to be relatively close.

If the battery is fully charged and the ac level isn't showing 93-100%, could you tell me what /proc/driver/battery/sharpsl_main_battery_voltage is reporting with the power cable still plugged in? On my battery it's about 222, but I'd like to know if other people get markedly different values.
SL-C3100 with usb power mod running debian eabi
pdaXii13 still on the NAND for dualbooting
16GB SDHC! (a new one, after I sat on the old one and it went kaput)
D-Link 660 wifi, Socket Bluetooth rev H
External 9800mAh LiIon battery and slimline dvd drive
Homebrew microphone and remote

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #69 on: July 16, 2007, 08:38:07 am »
Quote
The ac charge percentage is never going to exactly match the no-ac charge percentage from apm at partial charge. More important is for 100% to be right and 0% to be relatively close.

If the battery is fully charged and the ac level isn't showing 93-100%, could you tell me what /proc/driver/battery/sharpsl_main_battery_voltage is reporting with the power cable still plugged in? On my battery it's about 222, but I'd like to know if other people get markedly different values.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=164974\"][{POST_SNAPBACK}][/a][/div]

Thanks for reply.
As you said, I have make a mistake because I try to match ac charge percent with no-ac, and failed. I guess, the charge procedure is not linear.

It is really good idea to get charge percent by voltage.
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #70 on: July 17, 2007, 10:29:38 am »
New source:
add usb function. The storage is different with usbfunction.py, and use mount point directly.

code clean

Next:
add swap function according by qtopia-memory applet.
The prog can swap off according by /proc/swaps, and create swap file on sd or cf with different size.

PS:
After release 0.0.2-3, I found it is hard to finish source and release.
I need help for testing and release.
« Last Edit: July 17, 2007, 10:30:49 am by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #71 on: July 17, 2007, 09:48:21 pm »
Quote
New source:
add usb function. The storage is different with usbfunction.py, and use mount point directly.

code clean

Next:
add swap function according by qtopia-memory applet.
The prog can swap off according by /proc/swaps, and create swap file on sd or cf with different size.

PS:
After release 0.0.2-3, I found it is hard to finish source and release.
I need help for testing and release.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=165047\"][{POST_SNAPBACK}][/a][/div]


thanks for all your hard work. i have just downloaded the latest. i'm off to the airport now. will test later on the plane...
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #72 on: July 18, 2007, 09:06:05 am »
ok did some testing and also some enhancements

tested some of the USB Function, ie switching between net and storage. did not test serial mode. the mounts for the storage mode needs to be filtered. rootfs should not be available as an option since it can cause file corruptions. also, not all mountable filesystems should be made available as an options, ie only vfat partitions and maybe ext2 and ext3 in some kind of advanced mode set in powerctrl.conf, but cramfs and squashfs mounts should be filtered out.

tested the card applet functionality and it works so now pretty much this applet can replace all the other applets (except for clock, wireless and tasks).
i just remembered that the usb storage mount is quite rudimentary. it only allows you to mount and unmount 1 usb disk. maybe this needs to be enhanced to detect whether there is a usb hub attached and if so, allow more disks to be mounted, ie check for /dev/sd[a-d] instead just /dev/sda. i wrote a applet for qtopia long time ago which did most of that, it also allowed you to mount/unmount zip drives and cdrom/dvd drives. it also had hooks to allows you to run scripts for usb ethernet, bluetooth, keyboard/mouse.


i took the liberty to make a few enhancements:

replaced the icon for the memory display to powerctrl-memory.png
renamed Cards to External Storage
renamed USB Function to USB Client Function
filtered the usb storage mounts to be only vfat partitions
renamed Volumes to Volume Control
added a mute option
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

Meanie

  • Hero Member
  • *****
  • Posts: 2803
    • View Profile
    • http://www.users.on.net/~hluc/myZaurus/
Mb-applet-powerctrl
« Reply #73 on: July 18, 2007, 09:41:04 am »
i will try to find the source for qtopia-usb-applet and attach it here...

for the 2.6 kernel, it would be nice to also have an option to switch between speaker and headphones since that is not automatic like in the 2.4 kernel

/proc/driver/fl/corgi-bl equivalent in 2.6 kernel is /sys/class/backlight/corgi-bl//brightness
valid values are from 0 to 47 although anything above 7 is useless

for /proc/meminfo, the first 3 summary lines dont exist in 2.6 kernel, but the MemTotal, MemFree, SwapTotal,SwapFree values beneath are exactly the same.

for reading the current cpu frequency and voltage, use /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq and /sys/devices/system/cpu/cpu0/cpufreq/cpu-voltage respectively
SL-C3000 - pdaXii13 build5.4.9 (based on pdaXrom beta3) / SL-C3100 - Sharp ROM 1.02 JP (heavily customised)
Netgear MA701 CF, SanDisk ConnectPlus CF, Socket Bluetooth CF, 4GB Kingston CF,  4GB pqi SD, 4GB ChoiceOnly SD, 2GB SanDisk SD USB Plus, 1GB SanDisk USB Plus, 1GB Transcend SD, 2GB SanDisk MicroSD with SD adaptor, Piel Frama Leather Case, GoldX 5-in-1 USB cable, USB hub, USB mouse, USB keyboard, USB ethernet, USB HDD, many other USB accessories...
(Zaurus SL-C3000 owner since March 14. 2005, Zaurus SL-C3100 owner since September 21. 2005)
http://members.iinet.net.au/~wyso/myZaurus - zBook3K

ecc_hy

  • Full Member
  • ***
  • Posts: 125
    • View Profile
Mb-applet-powerctrl
« Reply #74 on: July 18, 2007, 11:11:43 am »
tested some of the USB Function, ie switching between net and storage. did not test serial mode.
-> Not test serial too, never use it before. The progam is based on the usbfunction.py and checked carefully.

the mounts for the storage mode needs to be filtered.
-> There are two method.
1. use powerctrl.cfg, let user defined mount point, and good name like "SD card"/"CF card" can be easy added
2. use mtab to get all mount point, and filtered out. The exclude/inlcude types can be easy defined in powerctrl.cfg.

Which one is better?

tested the card applet functionality....
-> now powerctrl detects the usb host and usb serial device attached.
My question is: Do we need the deattach function? and how?
Waiting for meanie's qtopia-usb-applet, and try to modify it again.

Next:
swap on and off function should based on qtopia-memoryapplet.
swap off the item in /proc/swaps
create swapfile on sd/cf with different size which predefined in powerctrl.cfg.
check swap before eject sd/cf card.

auto swap on swapfile when sd/cf insert? the function I am not sure now.

About kernel 2.6:
I may add kernel 2.6 support to powerctrl, but can not test it now since only kernel 2.4 on my machine. The working should be very detail, something like file format, and hard to debug without kernel 2.6 env.
So I hope someone else develop and make it.
« Last Edit: July 19, 2007, 12:54:41 am by ecc_hy »
SL-C1000, Roku wifi, pdaxii13v2/Debian dual booting