Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Create a persistent BlueTooth to Address Book connection Network
One of the problems with the Address Book's Bluetooth phone connection functionality is that usually it only stays active for about 10 minutes, meaning that its caller ID capabilities are diminished since you have to manually reconnect the phone. I've figured out what appears to be a solution while investigating a way to share my highspeed internet connection over Bluetooth to my Nokia 3650 phone.

In that process, I found that part of the SyncServices included with the new version of iSync is a command line mRouter application. Assuming you have iSync 1.1 installed, run the mRouter command -- it's part of the Symbian conduit that's installed in /System -> Library -> SyncServices -> SymbianConduit.bundle -> Contents -> Resources. From the Terminal type (shown on two lines; enter as one with no spaces at all):

/System/Library/SyncServices/SymbianConduit.bundle/
  Contents/Resources/mRouter
and you'll get the possible command line options. If you run (on the same path) mRouter -a, followed by your phone's MAC address (which you can find in the Bluetooth Preference pane), a PPP session will be created, displaying something like this:
 Mon Jun 16 18:21:00 2003 : Using interface ppp0 
 Mon Jun 16 18:21:00 2003 : Connect: ppp0  /dev/tty.mRouter 
 Mon Jun 16 18:21:08 2003 : local  IP address 169.254.1.68 
 Mon Jun 16 18:21:08 2003 : remote IP address 169.254.1.5 
Once that's done, your BlueTooth connection will now be alive and persistent. You can hit Control-Z to suspend the active application, or Control-C to kill it (you don't want to do that, though, because it will obviously disconnect you). I guess you could make a duplicate of the mRouter file and run it from wherever you'd like, but I've not tried that yet.

Now go over to the Address Book and click the Bluetooth icon; you'll notice that it turns on immediately since the connection is already established. I've kept the connection alive for quite a while now without a hitch. Pretty cool.

Now, if some of the more network savvy users out there (like the ones who figured out how to share your Mac's internet connection to a Palm device) could come up with something similar to share over this PPP connection, I'd be eternally grateful. This would be useful to Nokia 3650/7650 and Sony Ericsson P800 users particularly.

    •    
  • Currently 3.60 / 5
  You rated: 5 / 5 (5 votes cast)
 
[24,664 views]  

Create a persistent BlueTooth to Address Book connection | 16 comments | Create New Account
Click here to return to the 'Create a persistent BlueTooth to Address Book connection' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create a persistent BlueTooth to Address Book connection
Authored by: mithras on Jun 18, '03 12:55:37PM
My connection always dies; any ideas?
Wed Jun 18 12:48:54 2003 : Using interface ppp0
Wed Jun 18 12:48:54 2003 : Connect: ppp0  /dev/tty.mRouter
Wed Jun 18 12:49:09 2003 : Hangup (SIGHUP)
Wed Jun 18 12:49:09 2003 : Modem hangup
Wed Jun 18 12:49:09 2003 : Connection terminated.
Killed
Listen To My iTunes Library (6500+ songs, iTunes 4 required)

[ Reply to This | # ]
Create a persistent BlueTooth to Address Book connection
Authored by: rouet on Jun 18, '03 01:20:44PM

I tried with a p800 and open -vv, the interesting error was :
2003-06-18 19:07:42.948 mRouter[703] Attempting to tickle device with address: (??-??-??-??-??-?? is my p800 address)
2003-06-18 19:07:43.924 mRouter[703] We have successfully opened FIRST baseband connection
2003-06-18 19:07:43.928 mRouter[703] Service selected "Bluetooth Serial Port" on remote device " P800" on RFComm channel "1" with sdp service record handle "0x00010029"
2003-06-18 19:07:43.930 mRouter[703] Baseband still looks like it isn't up... - try again
2003-06-18 19:07:43.930 mRouter[703] Baseband is connected
2003-06-18 19:07:44.271 mRouter[703] ** RFComm channel open attempt failed with error -536870195

i also try with a little application which tried to open a RFComm channel, and i have also the same error

any idea ?



[ Reply to This | # ]
possible solution to mRouter failing...
Authored by: schwa23 on Jun 18, '03 03:17:13PM
I'm not sure ... we've also been exploring this on the Apple Discussion boards:

here

Maybe some of that info will help. One thing I've noticed is that if you've already got an mRouter or PPPD connection started, a subsequent one will fail. try

ps auxww | grep mRouter 
And kill all the running mRouter processes and try again.

Good luck, and let us know your findings!

[ Reply to This | # ]

possible solution to mRouter failing...
Authored by: rouet on Jun 19, '03 02:51:55AM

i need to launch one or more times mRouter before it correctly works (iSync lanch it always correctly, mystery)
the apple forum provide all the solution (except the dns resolution, and an cpu problem, mRouter uses all the machine cpu)

see the list of commands i try :
/System/Library/SyncServices/SymbianConduit.bundle/Contents/Resources/mRouter -a 00-0a-d9-5d-50-3e -t 30 -p800
sudo /usr/sbin/sysctl -w net.inet.ip.forwarding=1
sudo /usr/sbin/natd -alias_address 10.0.1.3 -interface en1 -use_sockets -same_ports -dynamic -clamp_mss
sudo /sbin/ipfw add divert natd ip from any to any via en1

it works with ip address (no dns resolution) and opera

to stop it i type
sudo /sbin/ipfw -f flush
sudo killall natd
sudo /usr/sbin/sysctl -w net.inet.ip.forwarding=0
sudo killall mRouter

why the mRouter run under root account ? (iSync launch it under my account)
why we don't have any DNS resolution ?

that is the questions ?



[ Reply to This | # ]
Create a persistent BlueTooth to Address Book connection
Authored by: club60.org on Feb 06, '04 08:42:00AM

Did you enter your phone address or your mac?



[ Reply to This | # ]
Is this phone specific?
Authored by: Wheaty73 on Jun 18, '03 06:34:35PM

My connection stays on as long as the phone is in range (or switched on) - Ericsson T39, with bluetooth switched to 'on' in the menu.

There is an option in my phones Bluetooth menu for 'Automatic', which doesn't make a permenant connection. Perhaps this is the problem here?



[ Reply to This | # ]
try mRouter as root
Authored by: gorjant on Jun 20, '03 05:36:30AM

Did you try the mRouter command while logged in as root?



[ Reply to This | # ]
Create a persistent BlueTooth to Address Book connection
Authored by: rouet on Jun 20, '03 08:21:55AM

that's the solution for a P800

that's the shell commands :

sudo sh -c "cd ~;nohup /System/Library/SyncServices/SymbianConduit.bundle/Contents/Resources/mRouter -a 00-0a-d9-5d-40-df -t 30 -p800 >~/mrouter.log 2>&1 &"
sudo /usr/sbin/sysctl -w net.inet.ip.forwarding=1
sudo /usr/sbin/natd -interface en0 -use_sockets -same_ports -dynamic -clamp_mss
sudo /sbin/ipfw add divert natd ip from any to any via en0
sudo named

replace 00-0a-d9-5d-40-df by the p800 mac address
replace en0 by en1 for airport

to stop it :

sudo killall named
sudo /sbin/ipfw -f flush
sudo killall natd
sudo /usr/sbin/sysctl -w net.inet.ip.forwarding=0
sudo killall mRouter
sleep 15
sudo rm -f ~/mrouter*

everything is ok now



[ Reply to This | # ]
Create a persistent BlueTooth to Address Book connection
Authored by: schwa23 on Jun 20, '03 08:52:16PM

Still not working on my end (so close!). Where did you get that -p800 flag? Is there a similar one for the Nokia 3650?



[ Reply to This | # ]
Create a persistent BlueTooth to Address Book connection
Authored by: rouet on Jun 21, '03 04:25:04AM

hi

i copy the line which is launched by isync during the processus of synchronisation.
you can do the same thing with your phone.

jr



[ Reply to This | # ]
Create a persistent BlueTooth to Address Book connection
Authored by: soundbringer on Jun 26, '03 03:22:38PM

Managed to get it working with the 3650 and G4 laptop (D-Link)
here's the log: just change the phone address and phone name (Bart here)

Start Connection:

sudo sh -c "cd ~;nohup /System/Library/SyncServices/SymbianConduit.bundle/Contents/Resources/mRouter -a 00-60-57-44-a6-cc -t 30 -Bart>~/mrouter.log 2>&1 &"
sudo /usr/sbin/sysctl -w net.inet.ip.forwarding=1
net.inet.ip.forwarding: 0 -> 1
sudo /usr/sbin/natd -interface en0 -use_sockets -same_ports -dynamic -clamp_mss
sudo /sbin/ipfw add divert natd ip from any to any via en0
00100 divert 8668 ip from any to any via en0
sudo named
/System/Library/SyncServices/SymbianConduit.bundle/Contents/Resources/mRouter -a 00-60-57-44-a6-cc
Thu Jun 26 19:16:53 2003 : Using interface ppp1
Thu Jun 26 19:16:53 2003 : Connect: ppp1 <--> /dev/tty.mRouter
Thu Jun 26 19:17:04 2003 : local IP address 169.254.1.68
Thu Jun 26 19:17:04 2003 : remote IP address 169.254.1.5


to stop it :

sudo killall named
sudo /sbin/ipfw -f flush
sudo killall natd
sudo /usr/sbin/sysctl -w net.inet.ip.forwarding=0
sudo killall mRouter
sleep 15
sudo rm -f ~/mrouter*

---
Check my Virtual reality in Full Screen and some Manchester electronic classics written by Soundbringer at www.soundbringer.com



[ Reply to This | # ]
Create a persistent BlueTooth to Address Book connection
Authored by: frumioj on Jul 02, '03 06:54:13PM

I would just note that althought the suggested solution may work for some, I had a couple of problems:

1) I had to stop mDNSResponder (which binds to port 53, and stops named from doing so)
sudo /Library/StartupItems/mDNSResponder/mDNSResponder stop

2) I had to pop some holes in my firewall for Bluetooth (ports 3000-3004) and DNS (53) to enable the phone to talk to my powerbook at all.

So now, using this script I can get my phone talking IP to my Powerbook. But, I still can't get it to look up DNS for IP addresses. And I can't figure out how to see the ppp line that mRouter uses for iSync...

I can get DNS from the machine itself, but not from the phone...



[ Reply to This | # ]
Create a persistent BlueTooth to Address Book connection
Authored by: Wheaty73 on Jul 06, '03 08:13:41AM

I am saying I don't see a need to - Address Book keeps a BT connection to my phone for as long as the phone is in range (which since the 10.2.4 upgrade seems to be to the end of the garden!).
i have the T39 set to 'on' in its BT menu. There is an option for 'Automatic', which AFAICS is more to do with headsets, and does have a 10 minute 'on-time', which could be why other people are only getting Address Book to keep a connection for 10 minutes?
As a matter of interest, I ran mRouter, with the following results (AB and phone connected, su in konsole window)

[silver:/Users/darren] darren# /System/Library/SyncServices/SymbianConduit.bundle/Contents/Resources/mRouter -vv -p
2003-07-06 13:10:34.069 mRouter[22489] Really Verbose: on
2003-07-06 13:10:34.070 mRouter[22489] Usepipes: off
2003-07-06 13:10:34.070 mRouter[22489] Created run loop 376272 and mRouterBluetooth interface 379152
2003-07-06 13:10:34.161 mRouter[22489] No service record - we are creating one
2003-07-06 13:10:34.330 mRouter[22489] Result of IOBluetoothAddServiceDict is 0
2003-07-06 13:10:34.335 mRouter[22489] Service record handle = 1
2003-07-06 13:10:34.340 mRouter[22489] Added device = 388576
2003-07-06 13:10:34.388 mRouter[22489] **** Created dynamic serial port on 0 ****
2003-07-06 13:10:34.394 mRouter[22490] **** In child process => exec pppd ****
2003-07-06 13:10:34.394 mRouter[22490] Local server IP addr: 169.254.1.68
2003-07-06 13:10:34.395 mRouter[22490] IP addresses for PPP: 169.254.1.68:169.254.1.5
Sun Jul 6 13:10:34 2003 : using link 0
Sun Jul 6 13:10:34 2003 : Using interface ppp0
Sun Jul 6 13:10:34 2003 : Connect: ppp0 <--> /dev/tty.mRouter
2003-07-06 13:10:34.469 mRouter[22489] **** In parent process ****
2003-07-06 13:10:34.469 mRouter[22489] Parent process has pid of 22489
2003-07-06 13:10:34.469 mRouter[22489] Parent process has forked child process with pid 22490
2003-07-06 13:10:34.470 mRouter[22489] Attempting to tickle device with address: 00-00-00-00-00-00
2003-07-06 13:10:40.882 mRouter[22489] Service selected "(null)" on remote device "(null)" on RFComm channel "2" with sdp service record handle "0x40413c2b"
2003-07-06 13:10:40.882 mRouter[22489] Baseband is connected
2003-07-06 13:10:46.949 mRouter[22489] ** RFComm channel open attempt failed with error -536870208
2003-07-06 13:10:46.950 mRouter[22489] >>> Flipped to root permissions <<<
2003-07-06 13:10:46.950 mRouter[22489] >>> Effective UID = 0 <<<
2003-07-06 13:10:46.951 mRouter[22489] Setuid must be 0 for root priviledge switching
2003-07-06 13:10:46.951 mRouter[22489] Creating and initiating mRouter sockets interface
2003-07-06 13:10:46.954 mRouter[22489] == Creating listening socket on UDP port 53 ==
2003-07-06 13:10:46.954 mRouter[22489] == Creating listening socket on DNS port 3004 ==
2003-07-06 13:10:46.955 mRouter[22489] DNS socket AND log listener select invoked
2003-07-06 13:10:56.955 mRouter[22489] Timeout on DNS select
2003-07-06 13:10:56.955 mRouter[22489] ** Problem -1031 in bringing up mRouter **
2003-07-06 13:10:56.955 mRouter[22489] mRouter connection has not worked - let's get out of here
2003-07-06 13:10:56.955 mRouter[22489] Caught signal 15
2003-07-06 13:10:56.955 mRouter[22489] Time to die - let's kill pppd
2003-07-06 13:10:56.956 mRouter[22489] Dealloc: Closing down all the mRouter sockets
2003-07-06 13:10:56.956 mRouter[22489] >>> Flipped to root permissions <<<
2003-07-06 13:10:56.956 mRouter[22489] >>> Effective UID = 0 <<<
2003-07-06 13:10:56.956 mRouter[22489] Setuid must be 0 for root priviledge switching
2003-07-06 13:10:56.956 mRouter[22489] Bringing down the baseband connection gracefully...
2003-07-06 13:10:56.957 mRouter[22489] Return from attempt to SIGHUP pppd 22490 is 0
Sun Jul 6 13:10:56 2003 : Hangup (SIGHUP)
Sun Jul 6 13:10:56 2003 : Modem hangup
Sun Jul 6 13:10:56 2003 : Connection terminated.
2003-07-06 13:10:57.158 mRouter[22489] Caught the exit of pppd child process 22490
2003-07-06 13:10:57.158 mRouter[22489] pppd exited normally with code 16
2003-07-06 13:10:57.158 mRouter[22489] **** pppd is down so can unregister the dynamic serial port ****
2003-07-06 13:10:57.219 mRouter[22489] **** dynamic serial port successfully unregistered ****
2003-07-06 13:10:57.220 mRouter[22489] Return from attempt to SIGKILL pppd 22490 is -1
Killed

I have no idea what this output means, but it might help someone.

Darren



[ Reply to This | # ]
Create a persistent BlueTooth to Address Book connection
Authored by: jimbo2 on Aug 21, '03 12:09:35AM

Ok, the original author of this thread wrote at the end about sharing an internet connection over PPP, well, that part is actually already done! By just doing the step originally given, your phone will have a PPP connection established, you can ping it from the Mac and everything.

One thing that you will need to do, though, is in System Preferences, open Sharing, click the Internet tab, then click the option to share the connection.

A few things I've found, though. Apparently the Services app doesn't like this connection, and mail doesn't work, but there are 3rd party options. There's a cool browser called Netfront, and there's another excellent tool called IP View that lets you display the network connection info.

Now for the down side... I can't seen to get DNS working. I can establish a connection, and I can view web pages, but only if I specify the IP address, DNS names don't resolve.

The mrouter line tells the phone to use the Mac's IP addres (69.254.1.68) as a DNS server, and that just isn't working for me.

My cable connection goes into my router, which my Mac is plugged into. I know that mrouter is apparently routing IP traffic correctly since I can get out via IP, but I either need some way to configure mrouter to pass my ISP's DNS server info (anyone know of a config file for mrouter? I can't find one!), or else set up some rudimentary DNS service on the Mac that will just point everything out to the real DNS servers.

Anyone have any ideas on how to do this?



[ Reply to This | # ]
Share2Blue-Script for Symbian Phones surfing via bluetooth/mac internet sharing
Authored by: justwords on Nov 20, '03 08:16:50AM

This script makes surfing on a symbian phone via a shared internet connection via bluetooth possible - just paste in the MAC-Adress of your phone (lookop in bluetooth system panel after successful pairing) and start the internet sharing script and select the right connection for the internet access.

http://homepage.mac.com/cks3/Share2Blue2th.sit

http://3650anda12inch.blogspot.com/

http://www.versiontracker.com/redir.fcgi/lid=373821/Share2Blue2th.sit



[ Reply to This | # ]
Create a persistent BlueTooth to Address Book connection
Authored by: justwords on Nov 20, '03 08:17:50AM

Share2Blue-Script for Symbian Phones surfing via bluetooth/mac internet sharing
Authored by: justwords on Thu, Nov 20 '03 at 08:16AM
This script makes surfing on a symbian phone via a shared internet connection via bluetooth possible - just paste in the MAC-Adress of your phone (lookop in bluetooth system panel after successful pairing) and start the internet sharing script and select the right connection for the internet access.

http://homepage.mac.com/cks3/Share2Blue2th.sit

http://3650anda12inch.blogspot.com/

http://www.versiontracker.com/redir.fcgi/lid=373821/Share2Blue2th.sit

[ Reply to This | Parent ]



[ Reply to This | # ]