Royaltek RBT-2210 Ubuntu.

July 27th, 2008 by amatesi

I recently bought a Bluetooth GPS Antennae, it is the famous Royaltek RBT-2210, known for offering an amazing 23 hours of battery life (replaceble by using standard commodity Nokia mobile batteries), and powered by the critically acclaimed Chipset Sirf Star III by various online reviewers. Shortly an acceptable fast device, with good precision, excellent battery life and great bang-for-the-buck.

I have Ubuntu 8.04.1 X86_64 updated with latest kernel (2.6.24-20).

I searched for wiki infos and howtos to make this gps bluetooth receiver work correctly under my favourite open source distro, and after some trial & errors, here’s my working experience. Note that even if this guide is made with the RBT-2210 in mind, the following info should generally apply to every other working Bluetooth GPS receiver on the market, like the Holux BT-321.

My introductory statement takes for granted the following requirements:

- a Linux laptop or PC (I used Ubuntu).
- Working Bluetooth Device or dongle.
- GPS Bluetooth receiver (mine is Royaltek RBT-2210).
- Internet.

For the bluetooth configuration file, I used a pretty standard one (just in case, here it is my /etc/bluetooth/hcid.conf):

#
# HCI daemon configuration file.
#

# HCId options
options {
        # Automatically initialize new devices
        autoinit yes;

        # Security Manager mode
        #   none - Security manager disabled
        #   auto - Use local PIN for incoming connections
        #   user - Always ask user for a PIN
        #
        security user;

        # Pairing mode
        #   none  - Pairing disabled
        #   multi - Allow pairing with already paired devices
        #   once  - Pair once and deny successive attempts
        pairing multi;

        # Default PIN code for incoming connections
        passkey "1234";
}

# Default settings for HCI devices
device {
        # Local device name
        #   %d - device id
        #   %h - host name
        name "%h-%d";

        # Local device class
        class 0x000100;

        # Default packet type
        #pkt_type DH1,DM1,HV1;

        # Inquiry and Page scan
        iscan enable; pscan enable;
        discovto 0;

        # Default link mode
        #   none   - no specific policy
        #   accept - always accept incoming connections

        # Default packet type
        #pkt_type DH1,DM1,HV1;

        # Inquiry and Page scan
        iscan enable; pscan enable;
        discovto 0;

        # Default link mode
        #   none   - no specific policy
        #   accept - always accept incoming connections
        #   master - become master on incoming connections,
        #            deny role switch on outgoing connections
        lm accept;

        # Default link policy
        #   none    - no specific policy
        #   rswitch - allow role switch
        #   hold    - allow hold mode
        #   sniff   - allow sniff mode
        #   park    - allow park mode
        lp rswitch,hold,sniff,park;
}

You get this and all BT related stuff by installing the bluetooth meta package from Synaptic.

OK, now some hands-on. First thing first we need to know the device’s MAC address, so let’s open a terminal and let’s type this:

  • sudo hcitool scan

You’ll receive some output similar to this:

Scanning ...
        00:0A:3A:2C:CE:DB       BlueGPS 2CCEDB

Now we know the MAC Address, we need to disover the device’s channel, so let’s type the following:

  • sudo sdptool browse 00:0A:3A:2C:CE:DB

If you get no output from the previous command, then launch this instead:

  • sudo sdptool records 00:0A:3A:2C:CE:DB

You should receive something like that:

Service Name: SPP
Service RecHandle: 0x10000
Service Class ID List:
  "Serial Port" (0x1101)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 1
Language Base Attr List:
  code_ISO639: 0×656e
  encoding:    0×6a
  base_offset: 0×100

Failed to connect to SDP server on 00:0A:3A:2C:CE:DB: Connection timed out

The important part being the channel number in bold (simply ignore the rest).

OK, at this point we need to make some more definitive modifications, so we’ll edit the rfcomm config file, in such a way that the changes we made, are stored and easily available next time.

  • sudo vi /etc/bluetooth/rfcomm.conf

At the EOF let’s paste the following:

#
# Configurazione porta rfcomm 2 per RBT-2210 GPS Bluetooth
#
rfcomm2 {
bind yes;
device 00:0A:3A:2C:CE:DB;
channel 1;
comment "Serial Port";
}

Now let’s connect the rfcomm port:

  • sudo rfcomm connect 2

If everything is fine, we’ll receive similar output:

Connected /dev/rfcomm2 to 00:0A:3A:2C:CE:DB on channel 1
Press CTRL-C for hangup

Now we have all it takes for a working BT GPS receiver; let’s open a new terminal and install some software able to take advantage of that:

  • sudo apt-get install gpsd gpsdrive

Let’s launch the gpsd on the right RF port:

  • sudo gpsd /dev/rfcomm2

At this point the config game is over: prepare the car and experiment with gpsdrive!

  • gpsdrive

Upon next reboot, if you’re willing to use your GPS BT receiver again, simply power it up, start your PC, make sure the BT Service is UP and running and launch gpsd with the right port; then afterwards launch your favourite program.

ADDENDUM: If, for some reasons, you’d need to use a serial port, there is the possibility to link the rfcomm port to a standard serial port. This is especially useful with Windows emulated software; this way we are able to fool the SW and make him know that, on a specific serial port, is connected a GPS device; on my example we’ll create a symlink from the (previously created) rfcomm 2 to the serial port ttYS1 (COM2 for the emulated Windows program).

  • sudo ln -sb /dev/rfcomm2 /dev/ttyS1

Now from your Windows program, inside the configuration options, you can specify that at the "COM2" is connected a generic GPS receiver and everything should work.

Posted in GPS, Tips and Tricks. | No Comments »

Basic Networking Howto.

July 16th, 2008 by amatesi

 

Since my job deals mainly with Networking stuff, I’m gonna post a summary for me, to remember always how does it works. The following takes into account the structure of LAN Networks with TCP/IP Suite of Protocols.

In the past, I (as many others), have fallen into confusion when talking about IP Addresses/Subnets-Subnet Mask, Broadcasts and Binary Conversion.

The following is my 2cents to help draw this confusion away.

Who invented IPv4 protocols, introduced the Classes concept to better separate and distinguish a Network from another (even if today we have CIDR - but ignore it for now). The Classes concept is just a theory and is not constraining at all; you can have a Class C address layout and yet have a different network. Let’s say you have a 192.168.1.0 Network; it is obviously a class C Network, because the address is on the range 192..203, but if you specify a Subnet Mask that is not the usual one (say 255.0.0.0), you can!

The fact I wish to underline is that, saying it is a class C address, and the Subnet Mask is 255.0.0.0 is not related: the Subnet and the Class simply are unrelated concepts (for the foretold network you’d usually apply the 255.255.255.0 Subnet Mask, but this is just to simplify things). This way we’ll have the Network (aka Subnet) address masked with its own mask, and for the example we would have a 192.0.0.0 network.

Usually the difference between a class A, B or C address lies in the first 4 bits of the first octet.

Octet: a series of 8 bits composing an IP Address; this is an octet -> | 1 1 1 1 1 1 1 1 | wich translates as 255 on decimal, for us humans (try it with the calculator!)

A class A address does have the FIRST bit of the octet as a ZERO, so -> | 0 1 1 1 1 1 1 1 | translates to 127, but 127 class A address is reserved for loopback, so the range for Class A Network is 1..126 (126 is | 0 1 1 1 1 1 1 0 | ) (loopback is a special address that refer always to "YOUR_PC").

Class B address does have the SECOND bit of the octet as a ZERO, so -> | 1 0 0 0 0 0 0 0 | translates to 128, then the range assigned to class B is 128..191 (191 is | 1 0 1 1 1 1 1 1 | ).

Class C address does have the THIRD bit of the octet as a ZERO, so -> | 1 1 0 0 0 0 0 0 | translates to 192, then the range assigned to class B is 192..203 (203 is | 1 1 0 1 1 1 1 1 | ).

Class D is another form of Classes, intuitively Class D range from 224..239 (wich is | 1 1 1 0 0 0 0 0 | to | 1 1 1 0 1 1 1 1 |), where ZERO Lies on the fourth bit position.

After the preview, now let’s analyze how subnetting works.

To understand subnetting, it is important to remember that, inside a Network, there are some constraints:

  1. A network have a well-defined IP address that have usually a zero (ex. 192.168.1.0) [but it can be different from zero just in case].
  2. A Network does have always a Broadcast address (usually in the form of network-address plus last bits set at 1, i.e.: 192.168.1.255).
  3. The Network is an address masked with a Subnet Mask (in fact a Network can also be called just a Subnet).
  4. There is a limited number of possible addresses (based on the Subnet mask).

It is almost impossible to make a huge single network (like a pure class B - 65536 hosts), without considering subnetting, because the network will become clogged, slow and unmaintainable (technically there happens "collisions"). The problem lies on broadcasting: when you have a huge segment, and a client broadcasts, this broadcast spread to the entire, 65536 hosts’ network! So when you logically separate a network from the other, the broadcasts are limited to a subnet.

For this reason we use subnetting, by separating a Network Segment from another and by joining them accordingly by using a router, usually a device with two I/Fs, one on either end, connecting two different networks (maybe next article..).

Enter Subnet Mask.

The Subnet Mask is an IP-like address composed of binary ONES and ZEROS. The SM is a layer applied to an IP Address to "identify" and distinguish a network from the hosts.

An IP address is composed of bits, these bits can be one or zeros; when you specify a mask, you have to apply this mask to the IP address to identify precisely what the network is.

Example:
IP: 192.168.1.0 - netmask: 255.0.0.0

Open questions:

  1. What is the class?
  2. What is the network?
  3. What is the Broadcast?
  4. What IP address the Network’s hosts should have?

 Answers:

  1. The Class of the Network is Class C, because 192 translates to | 1 1 0 0 0 0 0 0 | and the ZERO lies on the third bit.
  2. The Network is 192.0.0.0, because the subnet mask is composed of all | 1 1 1 1 1 1 1 1 | on the first octet, and when we have all 1s on the octet, we want to distinguish the network part from the host part [by assigning a 1 to the net and a 0 to the host]. This is how it works intuitively, in reality it is the result of a logical AND operation.
  3. The Broadcast address is 192.255.255.255, that is because all the host bits part should be set at all 1s, since the hosts part of the network is the 0.0.0 of the 192.0.0.0 network, and we set them to all 1s ( | 1 1 1 1 1 1 1 1 | -> 255 decimal).
  4. A host inside this network could have an address like 192.1.10.14 or 192.100.25.1 or whatever.

Extension of answer 3:
The logical AND operation gives 1 only when applied to two 1s, so:

0 AND 0 -> 0;

0 AND 1 -> 0;

1 AND 0 -> 0;

1 AND 1 -> 1;

If we put into column IP plus Subnet Mask, and we apply the AND operation on ‘em, we’d obtain the right Network address:

IP: | 1 1 0 0 0 0 0 0 | . | 0 0 0 0 0 0 0 0 | . | 0 0 0 0 0 0 0 0 | . | 0 0 0 0 0 0 0 0 |

AND

M: | 1 1 1 1 1 1 1 1 | . | 0 0 0 0 0 0 0 0 | . | 0 0 0 0 0 0 0 0 | . | 0 0 0 0 0 0 0 0 |

we gain the right Network Address:

N: | 1 1 0 0 0 0 0 0 | . | 0 0 0 0 0 0 0 0 | . | 0 0 0 0 0 0 0 0 | . | 0 0 0 0 0 0 0 0 |

 

Addendum:

Today we can find some address expressed in the form IP.Address/number (like 192.168.1.0/24).

What this mean is simple: It is a network that dedicates the first 24 bits on the Subnet Mask (as 1s for the network part), and the rest 8 bits as 0s (on the hosts part). So we intuitively identify this network as 192.168.1.0 (given by the AND operation between the IP and the Subnet Mask,  192.168.1.0 AND 255.255.255.0 -> CONVERTED TO BINARY -> AND OPERATION -> CONVERT THE RESULT TO DECIMAL -> 192.168.1.0 as Network Address).

That seems all.

Posted in System Administrator | No Comments »

pogo, the new 3D browser!

July 1st, 2008 by amatesi

I’m adding a new category on my site: reviews. Like all new things, my first review is more a "preview" than a review, and its subject is a closed beta 3D browser: the pogo browser.

Today’s browsers became so popular that we may distinguish between "core"-browsers and "value-added" ones.

"Core"-browsers are more specialized on interpreting web pages and rendering them as faster as they can, their functionalities may be considered somewhat basic and somewhat current (althoug they can be extended with plugins). Examples of core browsers are Firefox, Internet Explorer, Safari and Opera (and minor others).

"Value-added" browsers are built on top of core browser’s engines, modified with custom stuff, redesigned UI and other hacks (when applicable). Generally you can find some ready made niche-oriented features, or simply some hacks that "core"-browsers can’t offer out of the box (like Maxthon, a value-added browser built on top of the IE engine that used to offer tabs at the times of IE5). Examples of value-added browsers are Flock, Midori, or this new AT&T, Gecko-based (gecko is Firefox’s engine), "valued added" pogo browser.

The main pogo browser’s value added features are:

  • an exciting 3D interface for some common functions.
  • a cute lower bar, meant to represent thumbnails of open web sites.

Uhm…pogo they say? Hell, yeah!…that freaky way of jumping at gigs under your favourite bands, playin’it loud!

Imagine you were the playing band: the open browser’s tabs may be considered your fans, pushing, jumping and freaking around under your cursor. That seems the driving pogo philosophy. Cool, isn’t it?

So, after reading some news, I was driven at the AT&T’s pogo Browser home page; after signing up with my email, the day after, I received an invitation code, to try their closed beta (thank you man behind the scenes!).

I proceeded with the Sign up process (becoming this way a registered member of their forum), and was invited to download and try their 1.1 Beta (…so as to when they open it up to public they exit with the trendy 2.0 :).

The download, for us westerners, maybe heavy: 56.4Mb (well..compared to latest Firefox, it does feel kinda heavy, but for the Japanese powered networks it could be just a matter of seconds), but consider:

  1. This is beta software.
  2. Is a value-added browser.

As soon as the download have finished, I launched the install process: the Installshield is one of the latest, so cool installer: click, click and done (user? can you hear me?).

Upon first launch, you’re greeted by a wizard, it allows you to set some very basics, like importing your favorites from IE, Opera or delicious (no Firefox nor Google Bookmarks yet - weird: since it is based on Firefox, the unability to import my Bookmarks from there make me have some suspects). On a personal experience note, I keep my bookmarks on Google, so I first exported my bookmarks from Google to an HTML file, then I imported this file under IE, and then I was finally able to try and import my bookmarks inside pogo, but unfortunately this hasn’t worked. I repeated the same steps switching IE with Opera 9.50 (very good browser indeed), but the results were the same: no updated bookmarks under pogo for me. Although this may sound so wrong, I must say I can”t expect everything to work: it is still a closed beta, to support this, I must say that the menu still has no function to import bookmarks, so I suppose this is still WIP (I accessed this function only from the [initial] Setup Wizard, by closing and re-opening the program).

The browsing experience is fun: the first eye candy is the bar on the lower side, where you have grouped all your open tabs. Accessing tabs this way seem efficient and straightforward, but the preview is still too much blurry: it’s usefulness actually may work only on known layouts, if you were browsing a previously unknown site, you’ll hardly recognize it. Switching through tabs is fine (for us all keybindings junkies, CTRL+T & CTRL+TAB works out of the box), but the close button is really annoying: I ended up killing tabs I never meant to. My search for the option to disable it, was useless, on the contrary I discovered the mouse middle button would do what you’d expect to. Another concern I had was the representation of tabs on the lower side: I wish I could move this bar on the upper side, but unfortunately no option yet.

The other eye candy feature is the vista-like representation of the Collections [of bookmarks] and the History.

The Collections is a categorized representation of Bookmarks: you are presented a stream of 3D tables, each grouping a category of your bookmarks. The concept is similar to files and folders. Take this example: the folder is "IT NEWS" and its files are "anandtech.com", "xbitlabs.com"..etc. With the scroll wheel you select your collection, after clicking on it, you are presented with a board made of your sites thumbnails. Even if this function is soooo slow, seems to be the most complete one. The only suggestion I feel I’d need, is having more than just a collection open at the same time (consider who does have a big lcd and a powerful gpu - even if it seems this is not the targeted users).

The History representation is the more crippled feature of this closed beta: it aims at representing a nice and intuitive cronological order of previously browsed pages. Here, essentially, the scroll wheel doesn’t work well: the miniatures get resized up and down and their representational order respond randomly, if you fast scroll forward or backward. If you are patient and scroll slowly, you can go correctly back and forth, although the unexplainable resizing remains.

Overall, my conclusion with this browser is positive: accepting the project roughness, and the need to polish it, after some time, I think this browser may gain some consensus, especially on the younger side. It is clearly not targeted at the super-effficient power-Firefox 3.x, it seems targeted for the bored and frustrated IE user, in search of a funnier, casual, browsing experience. And don’t expect to keep 60+ tabs open simultaneously, save session and reopen it up: 5 tabs are enough to cripple the computer’s performance heavily.

On the OS compatibility there seems there is still a lot of work to be done. On the Windows side, I see no 64 bit version (for who cares of course); on the MAC and Linux side, if the devs choose to stick with DirectX, I see a performance hiccup on the alternatives (call it VM or wine, at least it won’t be native).

If I receive the authorization to invite people to try this software, I’m gonna post it here.

Posted in reviews | No Comments »