# PPP Connection with my PalmOS handheld

## rcxAsh

I'm trying to follow the howto found at http://howto.pilot-link.org/ppp/ Specifially, section 3.  

It's not working though...  I've followed mostly all the instructions.  The only difference is that I'm running devfs, so I don't use the ttyUSB0 and ttyUSB1 that most people use.  Rather, I use /dev/usb/tts/0 and /dev/usb/tts/1.  (Note that I'm running Gentoo, and devfs was required, so I'm not clear on what exactly it is).  

So, I'm at section 3.4 now.  Establishing a Connection (btw, I'm using a Clie TG50, an OS5 device).  I have all the proper modules loaded, an "lsmod | grep ppp" gives the same output as shown in the howto.  A "dmesg" reveals that the "Clie 4.x converter" is attached.  The issue is that the howto says to execute the script, and then connect with the palm.  However, if I try to run the script without connecting first, pppd gives me an error because "/dev/usb/tts/0" does not exist.  These only appear when I connect with the Clie.  However, if I connect with the Clie, which results in "/dev/usb/tts/0" and "/dev/usb/tts/1" being created, the script still doesn't work.  This is what happens if I connect first, then run the script:

```
lostech root # ./palmgo.sh

Now launching the ppp connection to talk with your Palm deviceusing channel 1

Using interface ppp0

Connect: ppp0 <--> /dev/usb/tts/0

sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x3ead5144> <pcomp> <accomp>]

sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x3ead5144> <pcomp> <accomp>]

sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x3ead5144> <pcomp> <accomp>]

sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x3ead5144> <pcomp> <accomp>]

sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x3ead5144> <pcomp> <accomp>]

sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x3ead5144> <pcomp> <accomp>]

sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x3ead5144> <pcomp> <accomp>]

sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x3ead5144> <pcomp> <accomp>]

sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x3ead5144> <pcomp> <accomp>]

sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x3ead5144> <pcomp> <accomp>]

LCP: timeout sending Config-Requests

```

I don't get the terminal back..  And eventually, my TG50 will say, "Error: timeout (0x1212)"

Arg.  I've tried the trial version of Softick PPP in Windows, and it works fine.  However, Linux seems to be a bit more finicky.  

I'm running Gentoo GNU/Linux with Alan Cox's 2.4.22 sources.  

Also, after this fails, I can't use any of my usb ports anymore...  I can't mount my Clie's memory stick as I could before, nor can I mount my usb pen drive.  I have to reboot to use them again...

My dmesg output after it fails looks like this:

```
hub.c: new USB device 00:1f.2-1.2, assigned address 5

usbserial.c: Handspring Visor / Treo / Palm 4.0 / Clié 4.x converter detected

usbserial.c: Handspring Visor / Treo / Palm 4.0 / Clié 4.x converter now attached to ttyUSB0 (or usb/tts/0 for devfs)

usbserial.c: Handspring Visor / Treo / Palm 4.0 / Clié 4.x converter now attached to ttyUSB1 (or usb/tts/1 for devfs)

host/usb-uhci.c: interrupt, status 3, frame# 1280

host/usb-uhci.c: process_transfer: fixed toggle

host/usb-uhci.c: process_transfer: fixed toggle

host/usb-uhci.c: process_transfer: fixed toggle

host/usb-uhci.c: process_transfer: fixed toggle

usb.c: USB disconnect on device 00:1f.2-1.2 address 5

visor.c: Bytes In = 0  Bytes Out = 460

Unable to handle kernel NULL pointer dereference at virtual address 000009a4

 printing eip:

ccbe930c

*pde = 00000000

Oops: 0002

CPU:    0

EIP:    0010:[<ccbe930c>]    Tainted: P 

EFLAGS: 00010246

eax: 00000000   ebx: c3864000   ecx: 00000000   edx: 00000000

esi: c386401c   edi: 00000000   ebp: c3864000   esp: c12a9f18

ds: 0018   es: 0018   ss: 0018

Process khubd (pid: 10, stackpage=c12a9000)

Stack: c386401c 00000000 c033fab4 ccbea620 ccbea600 00000000 c5ebe640 c0287510 

       c2985a00 c3864000 c2985a04 00000005 00000000 c2985a00 00000100 0000000a 

       cba9ce00 00000001 c028a4c0 cba9cf14 00000002 00000010 cba9ce00 c0289eec 

Call Trace:    [<ccbea620>] [<ccbea600>] [<c0287510>] [<c028a4c0>] [<c0289eec>]

  [<c028a7d2>] [<c028a885>] [<c028a830>] [<c0105000>] [<c010755e>] [<c028a830>]

Code: 89 90 a4 09 00 00 8d 4e 5c f0 ff 43 78 0f 8e 65 05 00 00 0f 
```

Any suggestions?

----------

## lucida

I met the same problem yesterday, with gentoo-dev-source 2.6.0 and a TJ25. Since I don't use devfs,  it should be the kernel's problem.

Have no idea...

----------

## rcxAsh

Hmm, thanks for the reply!  At least I know I'm not alone...

Has anyone ever successfully establised a PPP connection with their PalmOS device?  

I can use "dlpsh" to "hotsync" my handheld without any problems, but I still cannot get a PPP connection.  

I also posted this question in a PalmOS forum (the Linux section) but I only received a reply that that person had never been able to do it either.  

Could it just be that the newer PalmOS devices can't do this with Linux anymore?  (eg, under the 2.4.20 kernel, I could not mount my OS5 Clie's memory stick, but I can under 2.4.22)

----------

## lucida

I follow the instruction here:

http://atulchitnis.net/writings/palm-ppp.php

the ppp works(kind of...there are kernel panic though)

it seems that the script from pilot-link is the problem.

Now my palm can connect with PC and get an ip address, it can ping the host pc as well, but can't get access to the adsl router. So I'm working on the NAT part now.

----------

## lucida

I've got it work..just add "proxyarp" to the pppd options and comment out the iptables line..

The next thing to do is how to let the script run automatically when I initialize the connection from palm..

----------

## rcxAsh

Wow thanks!  It seems to be working for me now too!  

I can ping my Clie and can access my computer's webpage running on apache.  However, I can't seem to connect to anything outside of my computer.  I'm using the NetFront browser on my Clie and if I enter in an address such as google.com or cliemax.co.uk (a clie site with a mobile version), I get a Network timeout.  

Is this something wrong with the web browser, or is it the PPP connection not giving me access out side of my palm-computer connection?

Also, the output from the script says,

"Cannot determine ethernet address for proxy ARP"

Did I comment out too much?  I commented out every line that ran iptables.

----------

## lucida

I've got everything settled, including use hotplug to launch pppd, so now, it works exactly the same as the softick pppd in windows.

The *persist* parameter seems to be the problem of pilot-link's script.

This is my current line in palm-ppp.

${MyPPPD} ${MyPort} ${MyBaud} local noauth proxyarp \

  ${MyPcIP}:${MyPalmIP} ${MyDNS} \

        passive updetach asyncmap 0

I don't know why proxyarp fails for you, do you load iptables module?

anyway, I'll try to write a how-to later.

----------

## rcxAsh

The ip_tables module loads.  though, the modules ip_conntrack_ftp and ip_conntrack_irc do not.  Do I need these?  My current palm-ppp script looks like this:

```
#!/bin/sh

# Script to establish a routed and NAT'd ppp link between a Palm PDA

# and your PC.

# This script accompanies the article at 

# http://atulchitnis.net/writings/palm-ppp.php

# By Atul Chitnis <http://atulchitnis.net>

# Version 1.1

# Note - if you are using a USB connection, start the connection 

# at the Palm end *FIRST*, wait 2-3 seconds, then run this script.

# ---- start of parameter block 

# The port your Palm is connected to

MyPort="/dev/usb/tts/1"

# The speed it talks at (ignored for USB connections)

MyBaud="115200"

# The IP address to assign to the Palm

MyPalmIP="192.168.99.2"

# The IP address to assign to PC's side of the link

MyPcIP="192.168.2.12"

# What DNS should the Palm use?

MyDNS=`grep ^nameserver /etc/resolv.conf|awk '{ print "ms-dns " $2 }'`

# Comment the previous line and uncomment and edit the next line if you

# prefer to use a DNS different from the ones in your /etc/resolv.conf

# MyDNS="192.168.1.1"

# What device will we use by default for the uplink?

MyUplink="eth0"

# Where are my tools?

MyTools="/sbin/"

# Where is pppd?

MyPPPD="/usr/sbin/pppd"

# ---- end of parameter block 

# No edits should be required below

# Get rid of ipchains, if loaded

${MyTools}rmmod ipchains &> /dev/null

# Load iptables and some related modules

${MyTools}modprobe ip_tables

${MyTools}modprobe ip_conntrack_ftp

${MyTools}modprobe ip_conntrack_irc

# Flush any rules that may be hanging around 

#${MyTools}iptables -F 

# OK, let's find out what our uplink device really is

DEFDEV=`${MyTools}route -n |grep "^0.0.0.0"|tr -s " "|cut -d " " -f8`

if [ ! -z "$DEFDEV" ]; then

   MyUplink=$DEFDEV

fi

# All done, kick off pppd to talk to the port and establish a link

# pppd will wait for the actual connection to happen before going 

# into the background

${MyPPPD} ${MyPort} ${MyBaud} local noauth proxyarp \

  ${MyPcIP}:${MyPalmIP} $MyDNS passive updetach asyncmap 0

if [ ! -z "`${MyTools}ifconfig|grep ${MyPalmIP}`" ]; then

   # OK, we have a link, let's NAT

   echo 1 > /proc/sys/net/ipv4/ip_forward

   #${MyTools}iptables -A INPUT -i ! ${MyUplink} -j ACCEPT

   #${MyTools}iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

   #${MyTools}iptables -t nat -A POSTROUTING -o ${MyUplink} -j MASQUERADE

   echo

   echo -e Link is up, your Palm is at ${MyPalmIP} \\a

else

   echo -e Link failed \\a

fi
```

I've commented out these lines:

```
#${MyTools}iptables -F 
```

```

   #${MyTools}iptables -A INPUT -i ! ${MyUplink} -j ACCEPT

   #${MyTools}iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

   #${MyTools}iptables -t nat -A POSTROUTING -o ${MyUplink} -j MASQUERADE
```

----------

## rcxAsh

I just recompiled my kernel and added in the other modules that I didn't have before.  All the modules seem to be loaded.  At least, I don't see any of the modprobes complaining now.  

However, it still says, "Cannot determine ethernet address for proxy ARP."  What exactly is proxy ARP?  I saw under the kernel configuration that there was an item called "ARP filtering" or something similar.  Do I need that?

----------

## lucida

hi!

I just checked my configuration, the iptables modules are not necessary.

It seems that you are also using a router, so..you should set the palm ip in the same subnet as the pc's(the pc is using a static ip, 192.168.0.15, in my case, with a netgear mr814v2 router)

This is my script:

```

#!/bin/sh

# Script to establish a routed and NAT'd ppp link between a Palm PDA

# and your PC.

# This script accompanies the article at 

# http://atulchitnis.net/writings/palm-ppp.php

# By Atul Chitnis <http://atulchitnis.net>

# Version 1.1

# Note - if you are using a USB connection, start the connection 

# at the Palm end *FIRST*, wait 2-3 seconds, then run this script.

# ---- start of parameter block 

# The port your Palm is connected to

MyPort="/dev/ttyUSB0"

# The speed it talks at (ignored for USB connections)

MyBaud="115200"

# The IP address to assign to the Palm

MyPalmIP="192.168.0.16"

# The IP address to assign to PC's side of the link

MyPcIP="192.168.0.15"

# What DNS should the Palm use?

MyDNS="ms-dns 206.13.29.12"

# Comment the previous line and uncomment and edit the next line if you

# prefer to use a DNS different from the ones in your /etc/resolv.conf

# MyDNS="192.168.1.1"

# What device will we use by default for the uplink?

MyUplink="eth0"

# Where are my tools?

MyTools="/sbin/"

# Where is pppd?

MyPPPD="sudo /usr/sbin/pppd"

# ---- end of parameter block 

# No edits should be required below

# Get rid of ipchains, if loaded

#${MyTools}rmmod ipchains &> /dev/null

# Load iptables and some related modules

${MyTools}modprobe ip_tables

#${MyTools}modprobe ip_conntrack_ftp

#${MyTools}modprobe ip_conntrack_irc

# Flush any rules that may be hanging around 

#${MyTools}iptables -F 

# OK, let's find out what our uplink device really is

DEFDEV=`${MyTools}route -n |grep "^0.0.0.0"|tr -s " "|cut -d " " -f8`

if [ ! -z "$DEFDEV" ]; then

   MyUplink=$DEFDEV

fi

# All done, kick off pppd to talk to the port and establish a link

# pppd will wait for the actual connection to happen before going 

# into the background

${MyPPPD} ${MyPort} ${MyBaud} local noauth proxyarp \

  ${MyPcIP}:${MyPalmIP} ${MyDNS} \

   passive updetach asyncmap 0 

if [ ! -z "`${MyTools}ifconfig|grep ${MyPalmIP}`" ]; then

   echo 1  > /proc/sys/net/ipv4/ip_forward

   echo

   echo -e Link is up, your Palm is at ${MyPalmIP} \\a

else

   echo -e Link failed \\a

fi

```

and a working output from ifconfig

```

 $ ifconfig

eth0      Link encap:Ethernet  HWaddr 00:00:E8:11:11:15

          inet addr:192.168.0.15  Bcast:192.168.0.255  Mask:255.255.255.0

          inet6 addr: fe80::200:e8ff:fe11:1115/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:20029 errors:0 dropped:0 overruns:0 frame:0

          TX packets:16856 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:5314835 (5.0 Mb)  TX bytes:4257869 (4.0 Mb)

          Interrupt:10 Base address:0xdc00

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          inet6 addr: ::1/128 Scope:Host

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:236 errors:0 dropped:0 overruns:0 frame:0

          TX packets:236 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:27313 (26.6 Kb)  TX bytes:27313 (26.6 Kb)

ppp0      Link encap:Point-to-Point Protocol

          inet addr:192.168.0.15  P-t-P:192.168.0.16  Mask:255.255.255.255

          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1

          RX packets:9 errors:0 dropped:0 overruns:0 frame:0

          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:3

          RX bytes:378 (378.0 b)  TX bytes:568 (568.0 b)

```

About the hotplug settings, follow the guide here:

https://forums.gentoo.org/viewtopic.php?t=104260

and rename the above palm-ppp script to /etc/hotplug/usb/visor

good luck!

----------

## rcxAsh

Wow! Thanks so much lucida!!  It works now!  I have yet to check out the hotplug stuff, but so far, I'm pretty content  :Smile: 

Thanks again!

----------

## Petaris

Where did you guys get the palmgo.sh script?  I can't find it on pilot-links site or on my system.

~Petaris

----------

## rcxAsh

I think that the palmgo.sh script is somewhere in Pilot-Link's howto.  It's not a file I recall, just a code listing.  

However, you may have better luck using the palm-ppp script described above.  It's working for me.

----------

## Petaris

I was actually tring to follow the Network Hotsync document on the pilot-link web site but it wasn't finished.

I'll try that script above though.

Thanks,

----------

## erik258

I have a similar problem with a NEC MobilePro 770.  I have all the ppp stuff up and running, but i have no iptables set up to forward from the handheld to the linux box.  I'm not seeing any iptables config here in your script, i am confused as to how this is established.  Is iptable stuff being done here, or something else?  Do i have to forward packets from my ppp0 to my eth0 to be able to get my handheld to see my dns?  Since Windoze CE doesn't have a

ping command i can't really do much but try to get internet sites up in explorer which isn't working.

----------

## rcxAsh

Yah, I'm not sure either.  IIRC, when I first set this up, I did not have iptables installed at all.  Can't remember, but I don't recall.  

Did you already try to see if it works regardless?  What about going to websites in your internal network?  Maybe it's just not resolving properly?  Not sure...

Unfortunately, I haven't used this method for a long time.  I've since gotten WiFi/Bluetooth access so haven't needed this USB method...

----------

## erik258

Dear rcxAsh (and everyone else using this forum),  your posts were quite helpful to get this working.  I am currently using my handheld to write this message!  

If anyone else is trying to do anything like this, here are some bits of help for you.

1) ppp in kernel, and emerge pppd too.

2) get ppp0 up over serial cable w/ handheld,

    works similarly with irda i have been told.      There are many good helpers on the interweb, try http://bnv.home.cern.ch/bnv/software/ce_linux/

3) iptables are important.  They allow packets from an "external interface" ie an internet connection through a modem, nic, etc.  to an "internal interface" eg in my case a handheld pc.  My iptables is a bit hacked out but it appears to work.  I;m not too worried about security because my handheld pc has its os and all on a readonly chip deep inside it and can't really be harmed.  

The next post from me will have some code listings from the computer serving -- ie routing to- this handheld.  

Thx, again, everyone, it's always surprising how much a little affermation of something being doable helps out  :Cool:  .

----------

## erik258

if your ifconfig has some stuff in it like this, you're golden. 

```

ppp0      Link encap:Point-to-Point Protocol  

          inet addr:192.168.55.1  P-t-P:192.168.55.100  Mask:255.255.255.255

          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1

          RX packets:1060 errors:12 dropped:0 overruns:0 frame:0

          TX packets:1097 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:3 

          RX bytes:94435 (92.2 Kb)  TX bytes:895354 (874.3 Kb)

ra0       Link encap:Ethernet  HWaddr 00:0E:3B:02:C3:67  

          inet addr:192.168.1.70  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:1605 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1747 errors:0 dropped:0 overruns:0 carrier:0

          collisions:38 txqueuelen:1000 

          RX bytes:1296175 (1.2 Mb)  TX bytes:181997 (177.7 Kb)

          Interrupt:11 Base address:0xc000 

```

Now you have to get iptables up, there's a very good guide somewhere in this forum on getting home routers to work.  But if you have a handheld like me and you don't at all care about security (i mostly use it behind other firewalls anyway) your iptables can look something like...

```

Chain INPUT (policy ACCEPT)

target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)

target     prot opt source               destination         

ACCEPT     all  --  anywhere             192.168.0.0/16      

ACCEPT     all  --  192.168.0.0/16       anywhere            

DROP       all  --  anywhere             192.168.0.0/16      

Chain OUTPUT (policy ACCEPT)

target     prot opt source               destination  

```

try... 

```

iptables -I FORWARD -I <internal-device> -d 192.168.0.0/255.255.0.0 -j DROP

iptables -I FORWARD -A <internal-device> -s 192.168.0.0/255.255.0.0 -j ACCEPT

iptables -I FORWARD -A FORWARD -i <external-device> -d 192.168.0.0/255.255.0.0 -j ACCEPT

iptables -t nat -A POSTROUTING -o <external-device> -j MASQUERADE

```

Frankly, I don't understand the iptables stuff too much, it's all the forwarding stuff from the afforementioned home router guide with none of the firewall-type security stuff.  But it seems to work for me.  One thing i am particularly confused by is that the ipaddresses, as you can see, in the iptables commands do not have any particular correlation on my computer.  What this is all about i don't know, but i think maybe since the netmask is 255.255.0.0 and the ppp0 addresses are 192.168.xx.xx the setup is working.  I have been told on the web that CE has a particular affinity to the address shown to be assigned to it, something about it being hardcoded into some of the software.  

Thanks again for your continued attention, rcxAsh, even though the forum is somewhat old.

----------

