On 27 April 2009 c. 22:43:16 Thomas Pfaff wrote:
> So, I finally got Internet access over Bluetooth to my Nokia 6233
> working. Here's a short summary of the steps taken (this assumes
> a properly configured phone).
>
> Make sure your Bluetooth device is recognized by OpenBSD:
>
> $ dmesg | grep ubt
> ubt0 at uhub4 port 1 "Micro Star International Bluetooth" \
> rev 2.00/32.64 addr 2
>
> Install the bluetooth-tools package. This provides, among
> other things, btconfig, btpin and rfcomm_sppd.
>
> Bring the Bluetooth interface up and verify that you're able
> to detect your phone:
>
> $ sudo btconfig ubt0 up
> bthub0 at ubt0 00:21:85:b2:51:41
> $ btconfig ubt0 inquiry
> Device Discovery from device: ubt0 .... 1 response
> 1: bdaddr 00:1d:e9:e5:ad:01 (phone)
>
> : name "Nokia 6233"
> : class: [0x5a0204] Cellular Phone <Networking> <Capturing>
> : <Object Transfer>
>
> <Telephony>
>
> : page scan rep mode 0x01
> : clock offset 27997
>
> Add the bdaddr to /etc/bluetooth/hosts so you don't have to
> type in the address each time you want to refer to your phone:
>
> $ sudo echo "00:1d:e9:e5:ad:01 phone" >> /etc/bluetooth/hosts
>
> Start bthcid(8), generate a pin using btpin(1) and connect to
> your phones' Dial Up Networking (DUN) service using rfcomm_sppd(1).
>
> $ sudo /usr/local/sbin/bthcid
> $ btpin -a phone -r -l 4
> PIN: 2701
> $ rfcomm_sppd -d ubt0 -a phone -s DUN
>
> You should receive a question on your phone if you want to accept
> the connection and then type in the PIN generated above. You
> should now be able to communicate with your phone:
>
> rfcomm_sppd[16519]: Starting on stdio...
> AT
> OK
> ATI3
> Nokia 6233
>
> OK
>
> Now that we know this works, we can attach this to a pty:
>
> $ rfcomm_sppd -d ubt0 -a phone -s DUN -t /dev/ttyp0
> $
In my expirience, some phones want DUN and some want SP. Maybe, some more
phones want something else.
> Create a ppp interface and connect using pppd(8) [1]
>
> $ sudo ifconfig ppp0 create
> $ pppd call netcom
> $ ifconfig ppp0
> ppp0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
> priority: 0
> groups: ppp
> inet 89.8.5.99 --> 10.6.6.6 netmask 0xff000000
>
> (fancy IP address ;-)). Now check the routing table:
>
> $ netstat -rnf inet | grep default
> default 10.6.6.6 UG 0 0 -
> 56 ppp0
>
> I've no idea what the name servers are supposed to be, so I
> just started a local one and pointed /etc/resolv.conf at it;
>
> $ sudo /usr/sbin/named
> $ sudo echo "nameserver 127.0.0.1" >> /etc/resolv.conf
>
> We're on!
>
> $ ping -c 4 www.google.com
> PING www.l.google.com (209.85.137.104): 56 data bytes
> 64 bytes from 209.85.137.104: icmp_seq=0 ttl=237 time=640.756 ms
> 64 bytes from 209.85.137.104: icmp_seq=1 ttl=237 time=595.876 ms
> 64 bytes from 209.85.137.104: icmp_seq=2 ttl=237 time=619.887 ms
> 64 bytes from 209.85.137.104: icmp_seq=3 ttl=237 time=645.883 ms
> --- www.l.google.com ping statistics ---
> 4 packets transmitted, 4 packets received, 0.0% packet loss
> round-trip min/avg/max/std-dev = 595.876/625.600/645.883/19.746 ms
>
>
> [1] My option file and chat script is as follows (you probably have
> to modify this):
>
> $ cat /etc/ppp/peers/netcom # probably don't need all this poop
> /dev/ttypz
> 115200
> local
> debug
> #crtscts
> nodetach
> noipdefault
> defaultroute
> lock
> novj
> nobsdcomp
> novjccomp
> nopcomp
> noaccomp
> noauth
> connect '/usr/sbin/chat -f /etc/ppp/peers/chat/umts.netcom'
>
> $ cat /etc/ppp/peers/chat/umts.netcom
> TIMEOUT 5
> ECHO ON
> ABORT '\nBUSY\r'
> ABORT '\nERROR\r'
> ABORT '\nNO ANSWER\r'
> ABORT '\nNO DIAL TONE\r'
> ABORT '\nNO DIALTONE\r'
> ABORT '\nRINGING\r\n\r\nRINGING\r'
> '' \rAT
> TIMEOUT 30
> OK ATD*99#
> TIMEOUT 10
> CONNECT ""
Enough good howto. I think it's even worth to be included in FAQ (after
some developer magic, of course).
--
Best wishes,
Vadim Zhukov
A: Because it messes up the way people read text.
Q: Why is a top-posting such a bad thing?