Much ado about scripting, Linux & Eclipse: card subject to change

Showing posts with label bold. Show all posts
Showing posts with label bold. Show all posts

2010-08-16

Linux modem tethering with berry4all, Rogers 3G network, and Blackberry Bold 9000

Because I'll be out of town for the next couple days, part of my packing list included setting up tethering via my Blackberry.

First I tried barry but was unsuccessful in trying to make a successful connection.

Then I found berry4all.

I had two problems, but thanks to the extensive FAQ, I managed to solve them:

  1. Ensure your device (in my case, Blackberry Bold 9000) has its APN correctly set in Setup > Options > Advanced > TCP
  2. Ensure other network connections are disabled using route -n; ifconfig -a before attempting to connect via tethered 3G modem. See also If your PPPD does not support replacedefaultroute
  3. Ensure /etc/resolv.conf is being correctly updated with the appropriate DNS entries (I have to do this by hand at the moment, but tweaked the default /opt/bbtether/berry4all.sh script to add this line so that I can automatically update the file immediately before connecting:
    #!/bin/sh
    cp -f /etc/resolv.conf.bbtether /etc/resolv.conf
    python bbgui.py &
    where /etc/resolv.conf.bbtether contains:
    domain rogers.com
    search rogers.com
    nameserver 64.71.255.198
    #nameserver 64.71.255.253
  4. Load up a bandwidth speed test such as bandwidthplace.com and see what network speed you can get.

Admittedly, tethered speeds are nothing close to wifi speeds.

  • With Rogers 3G network and Blackberry Bold 9000 attached via USB, I managed to get about 500-2800kbps down and 100-200 kpbs up.
  • With Rogers "Exterme" cable internet access (wifi @ home) I get 9800kbps down, 960kbps up.

But at least I can surf on my laptop using the 3G network while I'm away from the office.

To disconnect wired & wifi, then tether automatically and stay connected until CTRL-C is pressed, try this script:

#!/bin/bash
if [[ $UID != 0 ]]; then
 echo "Must be run as root!"
else
 /etc/init.d/network stop
 cp /etc/resolv.conf.bbtether /etc/resolv.conf
 route -n; ifconfig

 cd /opt/bbtether; python bbtether.py rogers -P **YOUR_DEVICE_PASSWORD_HERE**

 /etc/init.d/network start
 route -n; ifconfig
fi

2009-01-03

Blackberry Linux Calendar & Contact Sync

Ugh, what a nightmare. Skip to solution. See also Part 2.


PocketMac for Blackberry, Linux Edition

Unfortunately, I missed the deadline to be a beta tester for this new app. Comes highly recommended by a Macolyte friend of mine; unfortunately until it's released I won't be able to come anywhere near it. :(

Blackberry Desktop Manager in VirtualBox

First, I tried to install Blackberry Desktop Manager into a VirtualBox 2.1 Win XP Home guest OS, running on xubuntu 8.04. Problem there was that OOTB the VB guest couldn't see my USB devices (ie., the mounted Blackberry). Solved [1], [2].

Unfortunately, while the Windows guest could see the Blackberry, it couldn't sync with it. I keep getting prompted for my password to enter "mass storage mode", then ultimately the backup failed, as the connection was dropped midway through.

Hoping that the story would be better on my newer x200 Thinkpad, I tried again -- same result. Additionally, though the VirtualBox Windows guest found my bluetooth adapter, I couldn't make it work under Windows to connect to the BB.


barry

I tried installing barry, the Blackberry Desktop For Linux project. I installed 0.14-4.fc10 and 0.14-6.fc11, but it didn't work - perhaps the Bold is too new?

(-1, error sending control message: Operation
not permitted): Probe: GetConfiguration failed

So, for now, the only way to backup/restore is via my wife's WinXP laptop.

UPDATE, 2009/01/05: Turns out you have to run barry w/ root privileges. I can now backup on linux. W00t!

But surely there's another way to sync?


OpenSync

Next, I tried OpenSync. This didn't work either. I tried 0.22 on xubuntu 8.04, with KitchenSync 0.1, but it couldn't connect to the device. Then I tried 0.36 on the x200 Fedora 10 box with msynctool, but it too couldn't connect to the device (even though I'd already paired the BB with the Thinkpad over bluetooth), perhaps because my settings were incorrect? Either way, both front ends left a lot to be desired for a total noob user. XML config files are fine, but better in-file documentation would be nice.
msynctool 
msynctool --listplugins
msynctool --addgroup BB
msynctool --enable-objtype BB syncml-obex-client
msynctool --addmember BB syncml-obex-client
msynctool --enable-objtype BB google-calendar
msynctool --addmember BB google-calendar
msynctool --enable-objtype BB file-sync
msynctool --addmember BB file-sync
msynctool --showgroup BB
msynctool --configure BB 1
msynctool --configure BB 2
msynctool --configure BB 3
msynctool --sync BB

... still failed to connect to device :(

Funambol

Then I discovered the Funambol web-based sync option, and signed up. This worked, and I now have my contacts and BB calendar synched with their server. OK, that's great, but what I really wanted was to sync w/ my desktop apps and/or with Google Calendar. So, I tried the Funambol Mozilla Plugin 0.8 for synching contacts and calendar with Sunbird 0.9 (or Thunderbird 2.0 with Lightning 0.9). It worked on my home xubuntu 8.04 machine (one email address, no calendars) but failed to install on my work Fedora 10 machine (two email addresses, two calendars, RSS feeds & newgroup subscriptions). Bummer.

UPDATE, 2009/01/05: My Thunderbird profile had been corrupted. Creating a new one, importing from the old one, and reinstalling all extensions fixed this problem. But because I can use Google Sync for Contacts and Calendar, I'm only using Funambol for Tasks now. Details here.


Google Sync

Finally, checking my Google Calendar online I noticed a new "Sync" link in the top right. I found that Google has released an early Xmas present: Google Sync for your BlackBerry. Finally, a solution!

BBToday

If you would like to have a snapshot of your mail, calendar, tasks, calls and optionally, battery status & weather in one convenient portal page, try BBToday 1.6.


Captured with CaptureIt

UPDATE, 2009/01/29: I've found a better Today screen, but it's not free. BOLD CrossBar Plus Xtreme - BOLD OS 4.6 by JC Designs / Gadgetbean. Combine this with WeatherEye from The Weather Network, and you've got weather, mail, messages, calendar... all on one attractive screen! Best. Seven Bucks. Ever.

Continued in Part 2...

2009-01-02

Blackberry Bold + MidpSSH + Mutt = Mail Over VPN

Got a new Blackberry Bold 9000 for Xmas. Typical of Rogers, I was overcharged for it, and all the freebies I had quoted to me on the phone have yet to arrive. I'm told I'll be credited back the surcharge, but I won't see that until February.

Anyway, customer service infractions aside, setting up Gmail, TwitterBerry, Facebook, Google Talk, Windows Live Messenger, Yahoo! Messenger, and of course Blackberry Messenger was a snap. Tried to use the internal mail client for Gmail but it doesn't respect my filters so I get the flashing light notification for every bit of spam, rather than just the interesting mail I want to see.

Setting up IRC was a little tricky, but thanks to Opera Mini and mibbit.com, I can more or less check Freenode channels on the go. Not ideal, but tolerable.

But the real challenge was getting access to my corporate mail, since we're not running a BES server, and thanks to all the supported options, there are over 5,000 possible ways to configure Cisco VPN access on a Blackberry. I'm not that patient.

Instead, I decided to try using MidpSSH 1.7.3 to connect into my laptop (which is already connected to the VPN), then use Mutt 1.5.18 to connect over IMAP to the mail server. Because I'm connecting to a local IP within my home LAN, I set the SSH session's Connection Type to WiFi, rather than Default, BES, or TCP/IP. In order to avoid having to key in a password every time I connect to the laptop, I set up an SSH key and shared that with my laptop.

If I want to have this solution work when I'm not at home, I'll have to expose my laptop to the outside world, and connect using Connection Type = Default to that public IP address instead of my more secure internal one. Still, it's a step in the right direction.

Incidentally, this tip might help, if you're having network access problems:

Options > Advanced Options > TCP > APN: "internet.com" (no username or password) [1], [2]

Now I just have to teach myself all the keyboard commands for Mutt. I tried using MidpSSH on my previous phone, a SonyEricsson W810i, but it's nearly impossible to do anything without a full keyboard.

If you're thinking of doing something like this, here are some handy links for setting up Mutt to connect to IMAP and to send mail via SMTP.

Is there a better way to VPN over BIS for IMAP mail? If so, feel free to share your solution here or via email with nickboldt(at)rogers(dot)blackberry(dot)net.