view · edit · history · print

Setup Serial Communication over BT

Note: Here we will Set-up a Serial Communication (over Bluetooth) and connect to a Cell Phone.

In case you dont own BT, load Serial2USB module...

Note: This module is only nessesary if you do not have a BT device and use the alternate serial cable between GSM and UBS port, because these days portables are no longer equipped with RS232 but that does not stop us using a USB to RS232 converter!

  
$ modprobe pl2303

$ mknod /dev/ttyUSB0 c 188 0

For the lucky ones, setup BT USB...

  
$ modprobe hci_usb

$ modprobe bcm203x

$ lsmod # test
Module                  Size  Used by
bcm203x                 6464  0 
hci_usb                14336  0 
bluetooth              50564  1 hci_usb
..snip..

$ apt-get install bluez-hcidump bluez-pin bluez-utils libbluetooth1 libsdp2

$ echo 'usbfs /proc/bus/usb usbfs noauto 0 0' >>/etc/fstab

$ mount /proc/bus/usb

$ hciconfig -a # test

$ /etc/init.d/bluez-utils restart

Testing the BT device...

  
$ hcitool scan
Scanning ...
        00:01:E3:29:2E:EF       WVH

$ l2ping 00:01:E3:29:2E:EF
Ping: 00:01:E3:29:2E:EF from 00:0B:0D:32:6D:3B (data size 20) ...
0 bytes from 00:01:E3:29:2E:EF id 200 time 33.55ms
0 bytes from 00:01:E3:29:2E:EF id 201 time 13.63ms
0 bytes from 00:01:E3:29:2E:EF id 202 time 15.78ms
..snip..

$ sdptool browse 00:01:E3:29:2E:EF
Browsing 00:01:E3:29:2E:EF ...
Service Name: SerialPort
Service RecHandle: 0x11101
Service Class ID List:
  "Serial Port" (0x1101)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 1
..snip..

Pairing and paired tests...

 
$ cat << EOF >> /etc/bluetooth/rfcomm.conf
rfcomm0 {
        device 00:01:E3:29:2E:EF;
        channel 1;
        comment "Cell Phone S55 - WVH";
}
EOF

$ /etc/init.d/bluez-utils restart

# make sure your user has access to a usable X display to enter the pairing key.
$ rfcomm connect rfcomm0 00:01:E3:29:2E:EF
# typ a code on the cell phone...
# now type a code on the x input box...
[ctrl]-[c] # to finish connection and pairing initiation.

$ rfcomm bind 0 00:01:E3:29:2E:EF

$ minicom -s
# set /dev/rfcomm0
# set 9600
# no hw flow controll
# set as default

$ minicom -o
atz
OK
atdt 00000
NO CARRIER
ath
OK
..snip..

SMS PDU test

  
AT+CMGS=23
> 0011000B912374386044F50000AA0AE8329BFD4697D9EC37

Note: This will actually send an SMS with body "hellohello" to my cell phone!


Notes for using gnokii...

  
# get everything...
$ apt-get install gnokii gnokii-smsd gnokii-smsd-mysql libgnokii2-dev

Lets go back becouse gnokii screwed up my ttyUSB and rfcomm devices!!!!

admin · attr · attach · edit · history · print
Page last modified on March 30, 2006, at 01:55 PM