Archives page

Posts Tagged ‘linux’

Mobile Internet on the Eee PC (Ubuntu Eee)

Setting up the Internet on the Eee PC over bluetooth to my Nokia N95 with T-Mobile GPRS/EDGE/3G connection can be tricky.  Yet it sounds like one of those setups that could be so easy, right?  Well it seems stable for the moment, so here’s what you’ll need.  Or rather, what I have…

You’re going to be setting up your connection though pppd, and all of these instructions are based on instructions that I’m going to steal, slightly change and probably skip parts to suit my purposes (and hopefully yours) perfectly.

If your set-up doesn’t match exactly, perhaps you can make use of both pages and work out where things should change.  Or lovingly rip these instructions off, as I did – to make your own.

Setup your bluetooth dongle
First off, you’re going to need an apt repository that has the bluez-utils packages in. So open up a terminal
sudo nano /etc/apt/sources.list
and add the line
deb http://ftp.de.debian.org/debian etch main

Then you can install the package.

apt-update
apt-get install bluez-utils
/etc/init.d/bluetooth restart
lsusb | grep -i bluetooth
(should show the bluetooth device)
hcitool dev
(also lists bluetooth devices)

Setup networking

You can grab my gprs-settings which should be put into /etc/ppp/peers directory, and untarred.
tar -xvf gprs-settings.tar

Pair the phone

First, get the bluetooth ID of the N95
hcitool scan
Then pair your Eee with your phone, you have to do this from the N95.
Bluetooth -> right arrow (Paired devices) - Options
New paired devices (search)
Choose your eee and then type the pairing keys (anything of your choosing

Bind bluetooth to an rfcomm device

We use “rfcomm” to bind the bluetooth connection to a device. So first, find out the channel the phones bluetooth dial up networking system is on. You can do this with sdptool (Service Discovery Protocol tool):
sdptool search dun
Service Name: Dial-Up Networking
Service RecHandle: 0x1001e
Service Class ID List:
"Dialup Networking" (0x1103)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 2
Language Base Attr List:
code_ISO639: 0x454e
encoding: 0x6a
base_offset: 0x100
Profile Descriptor List:
"Dialup Networking" (0x1103)
Version: 0x0100

Note the “Channel: 2” which show which channel to bind.

Then to bind the channel (in this case #2) to one of the rfcomm devices (for example, rfcomm0):
rfcomm bind 0 11:22:BE:EF:44:33 2
You can see the binding with:
rfcomm
rfcomm0: 11:22:BE:EF:44:33 channel 2 clean

You might find you need to reset the bind and restart it every now and then (especially failed connection attempts)
rfcomm release 0
rfcomm bind 0 11:22:BE:EF:44:33 2

You can edit the settings in “/etc/bluetooth/rfcomm.conf,” set bind to “yes” and give the device and channel for rfcomm0. Then you can put these commands into /etc/init.d/bluetooth and it will automatically bind and release the rfcomm device:
# At the end of the "start)" section
rfcomm bind all
# At the beginning of the "stop)" section
rfcomm release all

Start pppd to connect.
Start up pppd.  Command line first, but because we’ve called it ppp0, you will later be able to do this via the normal ubuntu eee networking menu in the menu bar.
% pppd call ppp0
You should now have a ppp0 interface in your ‘ifconfig’ output that is up and running. The output should look something like this:
# pppd call ppp0
Press CTRL-C to close the connection at any stage!
defining PDP context...
rAT
OK
ATH
OK
ATE1
OK
AT+CGDCONT=1,"IP","general.t-mobile.uk","",0,0
OK
waiting for connect...
ATD*99#
CONNECT
Connected.
If the following ppp negotiations fail,
try restarting the phone.
Serial connection established.
using channel 1
Using interface ppp0
Connect: ppp0 <--> /dev/rfcomm0

You can hit control-c on the pppd process and it will shut down the connection, then you can release the rfcomm binding.

So… as I was saying… It’s not the easiest thing in the world to get going, but once you’ve got the hang of it, and set it up once you’ll have a connection everywhere you go.

Eee PC – cheap mobile computing for the masses

Eee PC compared to a John Grisham paperback, and full size laptop

I recently bought myself an Asus Eee 701 4G Surf from Expansys for the bargain price of 169.33 including delivery.  If you don’t know about these tiny laptops, they’re low-spec, cheap machines often times running a Debian-based Linux installation called Xandros, rather than Windows (although XP versions are also available in the higher spec versions).  Its key specs are a 7-inch screen, 512MB of RAM (upgradeable to 2GB), built-in WiFi and hard wired ethernet ports, 4GB solid-state drive, weighing only 922g, and really really small.

For those of you that just about nodded off to sleep – it’s really light, really small (for a feature-packed laptop, I mean), and lets you use word processing, spreadsheets, browse the Internet, read emails, blogging, instant messenger, Skype and, well – just about everything you’d normally do on your laptop really.  Except… did I mention it’s really portable?

I’m not totally sure where it fits into my technology arsenal yet.  It’s certainly not a desktop replacement, and it might even be best described as a second-laptop (the first of which, I hasten to add, spends way more time charging than it ever does getting used).  But the Eee PC is certainly a lot easier to carry around, and more likely to be dropped into my rucksuck as an afterthought since it takes up so little space.

It’s also been described as “something to play with” and the Eee fits into this category just as well as it would as a solid dependable netbook (if you’d rather leave the endless tinkering alone).  Perhaps it’s because the device is so cheap, or easy to reinstall the base system with all your essential apps in tact (take that Microsoft) – but even if you’re just looking for an alternative to Windows, the Eee might just be a good place to start.

So, expect more posts about the Eee shortly – the usual technical-guides are going to help me rebuild the system if I do manage to break it – as well as give me an excuse for something to write about 😉

Twitter – Conversation in the Machine

It’s another of those life-changing technologies which will not only improve the way you interact your fellow humans across the planet, but also shape and change the web as we know it for a brighter future beyond our current limited borders.

No it’s not.

It’s a micro-blogging tool which performs about the same function as your Facebook status, with a bit more history and more conversation potential than real speaking. It also falls into the category of “shiny web things” that the magpie’s of the Internet world run bounding towards with wings flapping, declaring their undying allegiance and overwhelming excitement about the grand new era of technology, society and communication.

I am said magpie. I just haven’t had much use for it, so whilst most people are bounding towards Pownce with their wings wide open, I’m still trying to find an excuse.

My Twitter feed is decidedly empty, having originally opened it as a way only of updating my Facebook status before I realised that was syndication for the sake of it (See integrations with BrightKite, Loopt, and Flickr integration for reference). But I do get a kick out of things like the Tower Bridge Tweets. The wonderful thing about this Web 2.0 stuff is that you don’t have to use any of it for what it was intended for (which is usually so vague and fluffy, it only really starts to take shape after the rules have been broken).

So I grabbed a copy of the Net::Twitter module for Perl and before you know it, my script that monitors if the Wifi connection on the Blakepics server had gone down was happily tweeting away with only three more lines of (my) code.

use Net::Twitter;
my $twit = Net::Twitter->new(username=>"username", password=>"password", source => "DowntimeMonitor" );
$twit->update("Internet connection ".($state ? "is now up" : "has been restarted"));

Upgrading Fedora 8 to Fedora 9

It’s time for another Fedora upgrade. Whilst the installations aren’t necessarily getting any better – fixing them is becoming a bit faster, because the problems are pretty similar every time and these notes I’m keeping are helping.

  1. System won”t boot. Met with a grub> prompt, and no menu
    • Boot the system from the DVD again, and select “rescue an install system”.
    • ‘chroot /mnt/sysimage/’
    • “nano /boot/grub/grub.conf”
    • Change this line, “root (hd2,0)” to root “(hd0,0)”. (I’m not sure why Grub seems incapable of finding the right hard drive to boot from each time… It doesn’t change.)
    • Uncomment the line at the top #boot
  2. Cyrus imapd won”t start. Complaining of libcrypto.so.6 library missing.
    • Upgrade Cyrus – “yum upgrade -y cyrus”
    • Restart the service – ‘service cyrus-imapd restart’
  3. Rss2imap no longer posts the messages into Cyrus IMAPD
    • Difficult to place the blame on this one. One turning on Rss2imap debug mode, I see i@m getting the error ‘Message contains bare newlines’, and although Rss2imap has posted the message. It’s been discarded by Cyrus. This is actually proper RFC behaviour for Cyrus – as message’s shouldn’t contain the broken ‘\n’ character, but rather ‘\r\n’. At the same time, I also think, ‘so what?’. Either way, the Cyrus behaviour has changed, or Mail::IMAPClient modules have.
    • So the fix… Edit Rss2imap\RSS2IMAPLIB\Rss2imap.pm, and add the bold text.
       my $message = ($headers . $body);
      $message =~ s/\n/\r\n/g;
      utf8::encode ( $message );

      and
       my $folder = $this->get_real_folder_name ($this->{'last-modified-folder'});
      $body =~ s/\n/\r\n/g;
      $this->{imap}->append_string ($folder, $body);

      You’ll notice we’ve replaced all the \n line endings with the more correct \r\n. Let’s just hope we don’t have to undo that later when the problem gets resolved elsewhere 😉

Remarkably, this was the first time the wireless card started up immediately after the upgrade, perhaps things are improving after all 😉