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

Palm wireless networking via IrDA Network

I use the following AppleScript to share my broadband internet connection with my USB-attached irDA adapter. This allows my Palm to use my network connection so I can sync AvantGo (modem sync) and download emails direct from my POP account on the net.

First you need to share your ethernet connection (don't know about modem dial-up) by pressing Start in the Internet tab of the Sharing control panel. Then edit the script below and insert the following details (all are needed):

  • Your Mac OS X password (you must be an administrator)
  • The name of your IrDA device. In a terminal window type ls /dev/tty*. Copy the one that starts tty.IrDA.
  • The IP address of your primary DNS server (for your internet connection)
  • The IP address of your Mac
  • An invented IP address for your remote device (e.g. Palm) that is not being used by anything else. Often just take your Mac IP Address and add 1 to the last number.
Read the rest of the hint for the script...


(* Fill in these values *)
property admin_password : ""
property irda_device_name : ""
property dns_address : ""
property mac_ip_address : ""
property irda_ip_address : ""

on run
  checkStatus()
end run

on checkStatus()
  set shellreturn to ""
  try
    set shellreturn to do shell script ¬
      "ps -ax | grep pppd | grep -v grep" password admin_password ¬
      with administrator privileges
  on error errText number errNum
    
  end try
  if shellreturn ? "" and (offset of ("/dev/" & irda_device_name) ¬
    in shellreturn) > 0 then
    set theReply to display dialog ¬
      "Network is available on IR Port." buttons ¬
      {"Quit", "Stop & Quit"} default button "Stop & Quit" with icon 0
    if button returned of theReply is "Stop & Quit" then ¬
      stopService((word 1 of shellreturn) * 1)
  else
    set theReply to (display dialog ¬
      "Network is NOT available on IR Port." buttons ¬
      {"Quit", "Start"} default button "Start" with icon 0)
    if button returned of theReply is "Start" then startService()
  end if
end checkStatus

on startService()
  set shellreturn to do shell script ¬
    ("/usr/sbin/pppd /dev/" & irda_device_name & " 115200 " & mac_ip_address ¬
      & ":" & irda_ip_address & ¬
      " proxyarp passive silent persist noauth local ms-dns " & dns_address) ¬
      password admin_password with administrator privileges
  if shellreturn ? "" then
    display dialog "Error returned when trying to start networking:" & ¬
      return & shellreturn
  end if
  delay 2
  checkStatus()
end startService

on stopService(procnum)
  set shellreturn to do shell script ("kill " & procnum) password ¬ 
  admin_password with administrator privileges
  if shellreturn ? "" then
    display dialog "Error returned when trying to stop networking:" & ¬
      return & shellreturn
  end if
end stopService

Hope this is useful. Have done no testing apart from my machine at work and at home.

    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (2 votes cast)
 
[15,014 views]  

Palm wireless networking via IrDA | 11 comments | Create New Account
Click here to return to the 'Palm wireless networking via IrDA' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Palm wireless networking via IrDA
Authored by: ars on Oct 07, '03 07:44:17PM

I was very interested in this hint to get Avantgo via a network sync on my Titanium powerbook. The script as posted got messed up: end of line characters, shellreturn ? "" (where the ? should be >). I figured out what to do with those, but the script still balked at:(offset of ("/dev/" & irda_device_name) in shellreturn) > 0
and I am not sure what it supposed to test for. When I cut it out I got the shell to run and doing the manual grep in the terminal it shows an .IR program running. Unfortunately my Visor Pro seems not able to connect via IR toPC/Handheld. Do I need to fill out a username and password in the Network panel?



[ Reply to This | # ]
Palm wireless networking via IrDA
Authored by: onlinepete on Oct 08, '03 07:55:44PM

I posted the hint. You can download it from:

http://www.glentilt.plus.com/download/IrDA_Internet_Sharing.applescript

See if it works with this



[ Reply to This | # ]
Download the script text
Authored by: onlinepete on Oct 08, '03 08:03:00PM
Offset command
Authored by: onlinepete on Oct 09, '03 07:35:47AM

If you're having a problem with the "offset" command then check you have: System/Library/ScriptingAdditions/StandardAdditions.osax



[ Reply to This | # ]
Offset command+got it to work
Authored by: ars on Oct 09, '03 08:25:34PM

Yes,
I do not have the StandardAdditions.osax. Is this part of Applescript studio? I got it to work anyhow. My error was that on my Visor I had reused an unused network connection and not deleted the login script. Once I reduced the script to contain only "end" it worked. It was kind of slow, but it worked. I had tried Plucker and ISiloX to get the NYT and that kind of worked, but Plucker was even slower and both Plucker and IsiloX produce low quality NYT pages compared to Avantgo. Thanks for the hint



[ Reply to This | # ]
Likewise for USB?
Authored by: calroth on Oct 07, '03 09:12:29PM
Is there a comparable tip to use for people connected via USB? A long time ago (circa Mac OS X 10.0), I remember seeing something like /dev/tty.usb or something, but I have no idea what happened to it since.

[ Reply to This | # ]
Palm wireless networking via IrDA
Authored by: dhdosxid on Oct 08, '03 11:42:15AM

I thought this would help me with my attempts to network via Bluetooth, replacing the Bluetooth device for the IrDA device in teh script.

I have tried all the hints on macosxhints and technohappy (including the technohappy scripts) and nothing seems to work. I have not been able to initiate an internet connection over bluetooth serial at all, with or without interface sharing through natd/ipfw. If I can get a ping, I believe I'll be able to get the sharing to work.

My device is an HP iPAQ 1945 with the following services discovered and showing in my OSX Bluetooth Preferences following pairing.

Device Name: PocketPC

Device Address: 00-04-3e-61-66-37
Device Type: Computer
Device Services: Generic Serial



[ Reply to This | # ]
Palm wireless networking via IrDA
Authored by: dhdosxid on Oct 08, '03 11:47:23AM

Device Services:
Generic Serial
OBEX Object Push
OBEX File Transfer
Dial-Up Networking
Network Access
Network Access



[ Reply to This | # ]
Palm wireless networking via IrDA
Authored by: dhdosxid on Oct 08, '03 11:48:45AM

One thing, in particular, that confuses me is that PocketPC2003 seems to have a different interface than earlier devices, and is "wizard" driven. I don't even know whether to use my Bluetooth Manager's Connection Wizard to set this up with its "connect to internet" or "join a personal network" options or rather to use the "Connectivity/Connections Control Panel" to set up a new modem connection.

My preference would be to get osx to look like a bluetooth lan access point and show up in the Bluetooth Manager's Connection Wizard. The modem connection seems like the most likely to work with your pppd solution, though, yet the ipaq seems to only have options for modem dialup and not direct serial (even though the generic serial service was discovered by osx), and there is no chat program on osx to provide the dialog with the dialup script from ipaq. The modem types in "My Connection" settings on the ipaq is (1) Bluetooth Dialup Modem (2) Bluetooth Fax Modem (3) Generic IrDA (4) Hayes Compatible on COM1:. The "Advanced" tab of the Connections control panel shows three adapters (1) AsyncMac NDISWAN Miniport (2) PPTP NDISWAN Miniport (3) Bluetooth PAN User Driver. Each of those has settings for ip address, dns, etc.

Can anyone direct me to setting this stuff up on the ipaq?



[ Reply to This | # ]
Palm wireless networking via IrDA
Authored by: penicuik on Oct 09, '03 02:22:57AM

i found this link, and the scripts provided, worked well for my Tungsten T via Bluetooth

http://www.technohappymeal.com/archives/000070.html

It is necessary, as stated, to disable Hotsync first.



[ Reply to This | # ]
Palm wireless networking via IrDA
Authored by: dhdosxid on Oct 09, '03 09:00:53AM

Yeah, the technohappy meal was one of the methods I tried. I'm still having no luck. I think I'm just doing it wrong and need a better explanation of what's going on with the bluetooth serial port setup.

I get confused because I get tty entries that aren't in the serial utility or internet prefs pane, and vice versa, and can't delete some serial ports in the internet prefs pane even though, etc. I don't fully understand the relationship between the serial ports in the tty listing, the serial utility, and the prefs panel.

Any detailed discussion of this would be helpful.



[ Reply to This | # ]