Showing posts with label fedora. Show all posts
Showing posts with label fedora. Show all posts

December 29, 2008

Connecting to the Internet on Ubuntu Linux using GPRS, Bluetooth enabled mobile

Mobile phones can act as a gateway between our computer and the Internet. In this post I will discuss how to connect your computer(with Ubuntu 8.10 Interpid Ibex as operating system) to the Internet using a mobile phone(Nokia, Sony Ericsson, Treo etc.) with Bluetooth and GPRS functionality.

To make the connection, we first need to setup a link between mobile phone and Ubuntu system. Steps:

Discovering the mobile phone
We
will use hcitool utility to discover the mobile phone. First of all, TURN ON the bluetooth on both mobile phone and computer. Then launch the Terminal from Applications->Accessories->Terminal. Now type the following:

mohit@mohit-laptop:~$ hcitool scan
Scanning ...
00:16:BC:F4:6E:EF mNokia

Note down the address of your mobile, in my case it was 00:16:BC:F4:6E:EF.

Adding the mobile device to /etc/bluetooth/rfcomm.conf
We will now add an entry for our mobile phone in /etc/bluetooth/rfcomm.conf. Open the rfcomm.conf using the command given below.

mohit@mohit-laptop:~$ sudo vim /etc/bluetooth/rfcomm.conf

Now, we have to specify our mobile phone's address ( which we found in the previous step using hcitool scan)
My rfcomm.conf looks like this:

rfcomm0 {
bind yes;
# Bluetooth address of the device
device 00:16:BC:F4:6E:EF
# RFCOMM channel for the connection
channel 1;
# Description of the connection
comment "Nokia";

}

Making the connection
Use the command sudo rfcomm bind rfcomm0 to make the connection. Now we have a modem on /dev/rfcomm0

Creating some PPP Scripts
First of all we will create a chatscript
/etc/chatscripts/BluetoothPhone. Here APN should be replaced with the Access Point Name that the service provider uses. In my case it is "airtelgprs.com".

TIMEOUT 10
ABORT 'BUSY'
ABORT 'NO ANSWER'
ABORT 'ERROR'
SAY 'Starting GPRS connect script\\n'

# Get the modem's attention and reset it.
"" 'ATZ'

# E0=No echo, V1=English result codes
OK 'ATE0V1'

# Set Access Point Name (APN)
SAY 'Setting APN\\n'
OK 'AT+CGDCONT=1,"IP","airtelgprs.com"'

# Dial the number
ABORT 'NO CARRIER'
SAY 'Dialing...\\n'
OK 'ATD*99***1#'
CONNECT ''

Second, we have to create /
etc/chatscripts/BluetoothPhone-Disconnect

""      "\\K"
"" "+++ATH0"
SAY "GPRS disconnected."

Finally, we have to create /etc/ppp/peers/BluetoothPhone

/dev/rfcomm0 # Bluetooth modem
115200 # speed
defaultroute # use the cellular network for the default route
usepeerdns # use the DNS servers from the remote network
nodetach # keep pppd in the foreground
crtscts # hardware flow control
lock # lock the serial port
noauth # don't expect the modem to authenticate itself
local # don't use Carrier Detect or Data Terminal Ready
replacedefaultroute
debug

# Use the next two lines if you receive the dreaded messages:
#
# No response to n echo-requests
# Serial link appears to be disconnected.
# Connection terminated.
#
lcp-echo-failure 4
lcp-echo-interval 65535

connect "/usr/sbin/chat -V -f /etc/chatscripts/BluetoothPhone"
disconnect "/usr/sbin/chat -V -f /etc/chatscripts/BluetoothPhone-Disconnect"

Connecting to the Internet
Now to connect to the Internet, type the command sudo pppd call BluetoothPhone. Internet can be disconnected anytime by pressing Ctrl+C.

February 15, 2008

Increasing the Performance of Linux Kernel by Tweaking the CPU configuration

The default installation of Linux installs a generic kernel. The generic will compromise compatibility with speed. In order to increase the we have to specify manually the processor installed on board. Doing so will help in increasing the performance of the kernel.

So, let's start. (You must have installed the kernel source in order to proceed further)
1. Start your terminal or shell.
2. Go to the filesystem root folder i.e. '/' folder.
3. cd /usr/src/kernels
4. Now open the folder containing your kernel source.
5. Pick one of the following:
  • make config (Bash shell script)
    make menuconfig (uses text window curses)
  • make xconfig
  • make oldconfig

6. Select Processor type and features and then select Subarchitecture Type and then check the appropriate choice.
(X) PC-compatible
( ) AMD Elan
( ) Voyager (NCR)
( ) NUMAQ (IBM/Sequent)
( ) Summit/EXA (IBM x440)
( ) Support for other sub-arch SMP systems with more than 8 CPUs
( ) SGI 320/540 (Visual Workstation)
( ) Generic architecture (Summit, bigsmp, ES7000, default)
( ) Support for Unisys ES7000 IA32 series

7. Then select Processor family and select the processor installed on your system.

8. Save and exit.

9. Reboot the machine.

(NOTE: The list given above may vary.)