Reputation: 131
We have a solution where some hardware connects to a COM port on a Win 7 machine, and interacts with our Java app. The hardware wants to use a PPP Server to transparently connect to an other server over TCP/IP.
Does anyone have a suggestion on how to do this? Start an OS native PPP Server from the Java app, with a connection to the COM port? How is this done?
Upvotes: 13
Views: 12442
Reputation: 373
This is a workaround using VirtualBox. I can't figure out how to run PPP server natively on Win7.
pppd - Ubuntu ttyS0 - VirtualBox Port 1 - Win7 COM1 -- RS232 -- target's ppp client
Open a Ubuntu terminal
pppd options in effect:
nodetach # (from command line)
holdoff 1 # (from command line)
persist # (from command line)
maxfail 0 # (from command line)
dump # (from command line)
noauth # (from command line)
/dev/ttyS0 # (from command line)
115200 # (from command line)
lock # (from /etc/ppp/options)
nocrtscts # (from command line)
local # (from command line)
asyncmap 0 # (from /etc/ppp/options)
passive # (from command line)
lcp-echo-failure 4 # (from /etc/ppp/options)
lcp-echo-interval 30 # (from /etc/ppp/options)
hide-password # (from /etc/ppp/options)
proxyarp # (from command line)
192.168.17.1:192.168.17.2 # (from command line)
noipx # (from /etc/ppp/options)
Using interface ppp0
Connect: ppp0 <--> /dev/ttyS0
Cannot determine ethernet address for proxy ARP
local IP address 192.168.17.1
remote IP address 192.168.17.2
Upvotes: 1
Reputation: 340446
You may be surprised to find that Win7 still supports PPP natively.
Follow these steps (or something like them) and you should be mostly good to go. I haven't actually performed a PPP connection since probably Win98, maybe Win2k, but the steps look to be pretty similar to what they were back them. It's not straightforward, but these should get you 80 or 90% of the way (the last 10-20% will be the normal hair-pulling irritations of getting the serial connection properly configured - there are way too many options involved in serial communications and PPP for it to go right on the first connection attempt).
Now you need to set up the 'network adapter' for the PPP connection
Now configure various PPP settings on the new network adapter:
Once the hardware device establishes a PPP connection to the Win7 COM port, the Java application should be able to communicate over the PPP link as if it were a regular network adapter. Good Luck!
Upvotes: 13
Reputation: 12748
Using Google on the basis of @hari comment about javax.comm
I found a tutorial on TINI, which may be useful on your purposes: the guide takes a PPP connection through COM port with TINI library equally as you want to do.
Upvotes: 0