[TMG] bluetooth howto for slackware 13.0

supat at supat.eu.org supat at supat.eu.org
Wed Sep 23 09:52:50 ICT 2009


bluetooth was completely support on slackware long time ago w/o need to do 
anyting more but no one write its howto.

howto in others places cannot be used.

It took me several weeks to learn how to use it easily.

1. install full slackware with ppp bluetooth support

2. do not have to set up ppp but simply cut below text and save in 
/etc/ppp/peers

===========cut========
/dev/rfcomm0 115200
# lock
nopcomp
noccp
novj
novjccomp
updetach
noipdefault
# defaultroute replacedefaultroute connect '/usr/sbin/chat -e -f 
/etc/chatscripts
usepeerdns
receive-all nobsdcomp nodeflate
#persist
noauth # Don't require authentication
# local # This is needed because it's not a real serial line
# noipdefault # Don't use the local hostname to determine the local IP 
used
proxyarp # Proxy ARP connections
# nodefaultroute # Don't use the default route
noipx # Don't use the IPX protocol
idle 0 # Set an unlimited disconnect timeout
# 192.168.50.1:192.168.50.214
# 10.6.6.6:10.6.6.77
# ms-dns 192.168.165.1
# ms-dns 124.40.237.236, 192.168.165.1
# netmask 255.255.255.0
    connect '/usr/sbin/chat -v -f /etc/ppp/peers/gprs.chat'
    noauth
         defaultroute
#        lcp-echo-interval 65535
         debug
#   asyncmap 0
#   mtu 1500
#   mru 1500
    idle 600
    disconnect '/usr/sbin/chat -v ABORT "BUSY" "" "\K" "" "+++ATH"'
============cut================

name above file /etc/ppp/peers/gprs

cut below file

==============cut===================
TIMEOUT              30
ECHO                    ON
HANGUP                  ON
''                              AT
ABORT "BUSY"
    ABORT "NO CARRIER"
    "" "AT"
    OK "ATZ"
    "" "AT&F"
    OK "AT+CGDCONT=1,\"IP\",\"INTERNET\",\"0.0.0.0\",0,0"
    OK "ATDT*99#"
    CONNECT
============cut===============

and save with name /etc/ppp/peers/gprs.chat

3. chmod a+x /etc/ppp/peers/gprs.chat
    chmod a+x /etc/ppp/peers/gprs

4. edit file /etc/rc.d/rc.bluetooth to look as below:

#!/bin/sh
#
# Start/stop the Bluetooth daemons
#
# This version has been modified by SukkoPera, taking inspiration from 
then
# Debian init script, to add support for register-passkeys.  Modified by
# Patrick Volkerding to add "restart" support, and cleaned up a tiny bit.

set -e

PATH=/sbin:/bin:/usr/sbin:/usr/bin
DESC="Bluetooth subsystem"

# The register-passkeys script was originally written by Debian:
REGISTER_PASSKEYS=/usr/lib/bluetooth/register-passkeys

HCID_NAME=hcid
HIDD_NAME=hidd
HID2HCI_NAME=hid2hci
RFCOMM_NAME=rfcomm
PAND_NAME=pand
DUND_NAME=dund

HCID_EXEC="`which $HCID_NAME || true`"
HIDD_EXEC="`which $HIDD_NAME || true`"
HID2HCI_EXEC="`which $HID2HCI_NAME || true`"
RFCOMM_EXEC="`which $RFCOMM_NAME || true`"
PAND_EXEC="`which $PAND_NAME || true`"
DUND_EXEC="`which $DUND_NAME || true`"

HCID_CONFIG="/etc/bluetooth/hcid.conf"
RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf"

# Source rc.bluetooth.conf
. /etc/rc.d/rc.bluetooth.conf

bluetooth_start() {
         echo -n "Starting $DESC: "
         if [ -x "$HCID_EXEC" ] ; then
                         $HCID_EXEC -s -f $HCID_CONFIG
                         echo -n " $HCID_NAME sdp"
                 else
                         $HCID_EXEC -f $HCID_CONFIG
                         echo -n " $HCID_NAME"
                 fi
         else
                 echo "BlueZ does not appear to be installed!"
                 exit
         fi
         if $HIDD_ENABLE && [ -x "$HIDD_EXEC" -a -n "$HIDD_OPTIONS" ] ; 
then
                 $HIDD_EXEC $HIDD_OPTIONS || true
                 echo -n " $HIDD_NAME"
         fi
         if $HID2HCI_ENABLE && [ -x "$HID2HCI_EXEC" ] ; then
                 $HID2HCI_EXEC --tohci > /dev/null 2>&1 || true
                 echo -n " $HID2HCI_NAME"
         fi
         if $RFCOMM_ENABLE && [ -x "$RFCOMM_EXEC" -a -f "$RFCOMM_CONFIG" ] 
; then
                 $RFCOMM_EXEC -f $RFCOMM_CONFIG bind all || true
                 echo -n " $RFCOMM_NAME"
         fi
         if $DUND_ENABLE && [ -x "$DUND_EXEC" -a -n "$DUND_OPTIONS" ] ; 
then
                 $DUND_EXEC $DUND_OPTIONS
                 echo -n " $DUND_NAME"
         fi
         if $PAND_ENABLE && [ -x "$PAND_EXEC" -a -n "$PAND_OPTIONS" ] ; 
then
                 $PAND_EXEC $PAND_OPTIONS
                 echo -n " $PAND_NAME"
         fi
         if [ -x $REGISTER_PASSKEYS ]; then
                 $REGISTER_PASSKEYS
                 echo -n " passkeys"
         fi
         echo "."
}

case "$1" in
   start)
         bluetooth_start
         ;;
   stop)
         bluetooth_stop
         ;;
   restart)
         bluetooth_stop
         sleep 1
         bluetooth_start
         ;;
   *)
         echo "Usage: $0 start|stop|restart" >&2
         exit 1
         ;;
esac

exit 0
====================

chmod a+x /etc/rc.d/rc.bluetooth

4. edit file  /etc/bluetooth/hcid.conf to look as follow


#
# 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 auto;

         # 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 "1111";
}

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

         # Local device class
         class 0x000100;

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

         # Inquiry and Page scan
         iscan enable; pscan enable;

         # 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;
}
===========================
5. edit file /etc/bluetooth/rfcomm.conf to be follow:

#
# RFCOMM configuration file.
#

rfcomm0 {
#       # Automatically bind the device at startup
         bind yes;
#
#       # Bluetooth address of the device
         device 00:26:68:38:06:7B;
#
#       # RFCOMM channel for the connection
         channel 1;
#
#       # Description of the connection
         comment "Example Bluetooth device";
}
================

6. enable bluetooth on your moblie phone to ON

7. run

hcitool scan

8. add paired device to your mobile phone by key pin code

1111

this is pass code for communication to olpc

9. run following command

pppd nomagic call gprs

That all folks !!!

it will add ppp0 route to your pc.
If the pc already has route then it should run

route del default

Before running command #9

good luck,
zxc555
ps. I write it to prevent my forgetful


On Sat, 19 Sep 2009, supat at supat.eu.org wrote:

>
> Because all laptop mouse are so bad and keyboard  are not good plus all bus 
> and microbus in TH are run badly with full schock. (no shock-absorber) so. I 
> conclude from my several days experiance that it was impossible to have super 
> computing in those environment.
>
> If have emergency internet then you need to stop the car and use it bluetooth 
> during the car is not running.
>
> or let the car run but you have to start every thing during the car stop.
> At cr run at most u can do is watching internet vdo via bluetooth.
>
> zxc555
>
>



More information about the Thai-l mailing list