HowTo: Use bcharge to charge your BB under linux
Net Direct :: Open Solutions
SourceForge Project Downloads:
'bcharge' is a utility that's part of the Barry project - which aims to be a complete desktop toolset for interfacing your BlackBerry with linux. The purpose of the bcharge tool is to detect when a BB has been plugged in and then alter the current to the USB port - it will increase the default 100mA flow up to 500mA, which is what the BlackBerry is expecting. This is exactly what the Windows driver does.
The 0.1 version currently available (2007-02-19) will work with any BlackBerry older than the Pearl 8100; for the 8100 (and presumably the 8800, unreleased at this time) you'll need to get the latest version of the code from CVS (only "bcharge.cc" is needed); the product ID internally has changed from '0x0001' to '0x0006' in this newer handset. The latest CVS version will recognize both older and newer devices, but the newer CVS code includes some special action to take when "seeing" an 8100 device.
CVS link for post-0.1 bcharge.cc:
SourceForge.net Repository - [barry] Index of /barry/tools
Compiling the code is beyond the scope of this HowTo, but it's extremely simple and uses all the standard linux-isms (autoconf, g++, etc.) -- if you can compile any generic application you should be able to compile bcharge; because this code interfaces with USB ports, make sure you have the 'libusb-devel' (exact name depends on your distro) installed so it'll find the headers and link libraries. There may already be installable packages available download as well (.deb/.rpm) - your need to compile may vary.
There are two parts to 'bcharge' - the main binary itself and a "udev" script. You can use the tool without doing anything, just plug in your BlackBerry to any USB port and type ./bcharge (substitute the path if needed). This will scan all the USB devices plugged in, find your BB handset, and adjust the current flow. It's that simple.
But, to automate the process you can copy a script from CVS (or the official downloads) to your /etc/udev/rules.d/ directory (location may vary depending on distro) to have everything done for you. First, copy the compiled binary (bcharge) to /usr/sbin/ and make sure it's at least mode 0755 (executable), owned by root (for security's sake). Now copy one of the scripts from here:
SourceForge.net Repository - [barry] Index of /barry/udev
...to the udev rules directory mentioned above. Obviously if you're using Debian (and maybe Ubuntu?) use the one called "Debian". :)
NOTE: if you have a newer Pearl device you will need to update the ProductID in this script. Replace this code:
Reboot. I say again, Reboot. 'udev' rules don't seem to work quite right unless they're loaded at startup (when udev runs), so just save yourself some hassle and sacrifice your uptime with a reboot. Now plug in your BB device and it should initially flash on the handset the error message about insifficient charge, but then the message will go away in 1sec (or so) when bcharge runs and performs the adjustment.
You can use the 'lsusb' tool to verify the current has been changed - run 'lsusb -v | less' as root, find the RIM BlackBerry section and it'll show the current USB port power flow. It should say 500mA and not 100mA.
bcharge: charge your BlackBerry under linux « rivviepop phantom
Very nice. I hope the option for the Pearl comes soon.
Wicked. I've been looking for this for years... You are officially my hero. Now to see if there's a Gentoo ebuild..
Got it! Sweet!!!! Working as advertised! :)
Any luck getting the MicroSD card in the BB recognized?????
This could also use a sticky! Mods? Thanks! :)
Here is the bcharge RPM(*)... I had to add the .zip at the end of the file to get the forums to take the upload... Just rename it by removing the .zip at the end of the filename...
You will need to satisfy the following:
rpmlib <= 3.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
config(bcharge) = 1.0-1
Just a note (trying to tie these two threads together) -- the above RPM is old (I think?) and doesn't use the fancy new CVS code from the Barry project; I do have a RPM for FC6 that I'll give out personally (PM me), but I don't want to share it publically. I made my own tarball and called it "0.2", it's entirely unofficial code -- I don't wish to disrespect the Barry project by accident, hence not releasing it.
It's not hard to do yourself, though. :) I'll at least post my SPEC file here to get you started; it's an enhancement of the one from the Barry project, and is intended to use the latest bcharge.cc and a patched udev ruleset (see the Barry patches page if it's not in CVS yet) to support both old and new device IDs.
Let me just add an important note regarding the use of bbcharge.
With bbcharge active, I can use vmware+winxp and the blackberry software to perform the sync operations. Without it, I cannot. bbcharge is a necessary component to make it work.
Note: I do not have winxp....
BUT... You are able to do a complete sync with vmware after installing bcharge?
Hope this isn't off-topic, but are there any Ubuntu 6.10 users who have already compiled Barry who could give me a hand? I'm trying to get a tethered Blackberry as a modem and would hate to get too sidetracked learning how to compile for my distro. Thanks in advance for any assistance.
It's never a bad idea, and it's actually not hard, to do... I'd say read up on how to compile and give it a shot.... You get to learn and play with the BB at the same time! :)
How To Compile A Kernel - The Ubuntu Way | HowtoForge - Linux Howtos and Tutorials
Ladies & Gents:
SourceForge.net: Detail: 1672178 - RPM spec file to build barry-bcharge
You can use that now to build a 'barry-bcharge' RPM (for Fedora/Red Hat) right out of the official tarball. The udev rule patch isn't in CVS, so you also have to download it as well (outlined in the above link).
I'm trying to install bcharge for my Pearl 8100 but it keeps saying it isn't a perl when I run it. I found out (through lsusb) that my iProduct is actually 4 not 5. I tried changing the constant acordingly but it does not seem to modify the Max Power to 500mA instead of 100mA, even though there seem to be no error.
Here is the output I get after changing the constant to 4:
Hrm... I tried looking at the patch and ti seems to have similar changes that the patch adds. I have the latest CVS version which already has a detection for 0x0004 which is what seemed to be in the patch so that didn't work, and I didn't find anything useful while reading through the mailing list archive. I sent an email to the mailing list and I will keep playing to see what the cause of this is.
Ah! Alright I will do that then! Thanks for the tip... I will let you know how it works out.
I tried using 0.6 with the patch and it seems to actually do some thinking in the execution unlike before. The only problem is that MaxPower is still 100mA :(
This is the output from running bcharge:
|All times are GMT -5. The time now is 07:56 PM.|
Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.