Jeremy W. Langston

Personal Website

Tag: windows

PDAnet and Internet Connection Sharing without DHCP – Step by Step

I recently wanted to share my Android phone’s internet connection to two Windows computers.  After some doing, here is the solution (naming might differ on different versions of Windows, I’m using XP):

  1. Download and install PDAnet for your Android phone and on one of the Windows computers, referred to as Computer1.
  2. Once installed, follow the directions for connecting Computer1 to the internet.  PDAnet includes these instructions, but basically you turn on the PDAnet app on the phone and click “Turn on PDAnet” or something like that.  (You also need to have USB debugging enabled, see instructions.)  You need to install the software on Computer1 before you connect to your phone via USB.  If your phone prompts you with four choices, such as Charge, USB Mass Storage, etc., select Charge.
  3. Now in the system tray on Computer1, right-click the PDAnet icon and select “Connect”.  After this, Computer1 should have internet access.
  4. Next connect Computer1 and Computer2 with an ethernet cable.  Older network adapters require a cross-over cable.
  5. On Computer1, go to the properties of the ethernet connection (e.g. “Local Area Connection” -> r-click -> “Properties”).  Double-click “Internet Protocol (TCP/IP)”.  Set the IP address to “192.168.0.1” and subnet mask to “255.255.255.0” and click “Ok” out of all of that.
  6. On Computer1, go to the properties of the PdaNet Modem.  Click the “Advanced” tab.  I disabled my firewall to make things easy.  Click the box “Allow other network users to connect through this computer’s Internet connection”.  In the drop-down box, select the ethernet connection you configured in Step 5.  Unselect the other two boxes.  Click “Ok”.
  7. Still on Computer1, click “Start”->”Run” (or hold the Windows keyboard button and press “R” at the same time).  In the box, type “cmd” and press “Ok”.  In the black command window type “ipconfig /all”.  Look for the PdaNet connection “PPP adapter for PdaNet Modem”.  Under that should be “DNS Servers . . . . “.  Write down that number, as it will be used on Computer2.
  8. On Computer2, set up the ethernet connection using the same procedure as in Step 5, except use the IP address “192.168.0.2” and for the Default Gateway put “192.168.0.1”.  While you are there, click “Use the following DNS server addresses” and put the number you wrote down in Step 7 under “Preferred DNS server”.
  9. You should have internet access on both computers now!

If you are having problems, try this:  back on Computer1, type “ping 192.168.0.2”.  If it says “Reply from 192.168.0.2…” then you are most of the way there.  Otherwise go back and check the steps.  Type “ping 74.125.229.16” to see if you can access Google without DNS name resolution.  If it doesn’t reply, then PDAnet isn’t connected or a step was skipped.  Finally type “ping www.google.com” to see if the DNS configuration is correct.  If it doesn’t reply, then look at the settings seen in Steps 7 and 8.

Installing and Using NTP with a Garmin 18 GPS (with PPS)

I recently needed to synchronize a Windows XP machine with GPS time.  One of the requirements was sub-millisecond accuracy, which is no small thing for non-RTOS computers.  David Hart to the rescue!  He has written an driver for the NTP (network time protocol) service to incorporate a PPS (pulse per second) signal.  The PPS signal, coming from a GPS, is highly accurate after sufficient time has elapsed for the GPS to sync with the satellites.  I’ve received a lot of help from David Taylor; thanks again, David!  So, without further ado, here’s an example of how to proceed with the installation:

[UPDATE:  from David Hart – “I’ve posted a new serialpps-20091228.zip which should correct that [install.bat bug]. The (huge) debug build of serialpps-ppsapi-provider.dll is also added, along with a tiny bit of instructions in install.bat regarding PPSAPI_DLLS.”]

1.  Configure hardware.
Connect the PPS signal to the DCD pin on the RS232 connector.

2.  Install Meinberg NTP software.
Keep all defaults.
Create and use a special NTP account. (I always had problems using anything else)
Account name:  ntp (use whatever you want)
Account pass:  ntpntp

3.  Stop NTP.
Run “C:\Program Files\NTP\bin\stopntp.bat”.   There are alot of useful utils in the \bin directory.

4.  Replace ntpd.exe with altered version.
Extract “ntpd.exe” from “ntp-4.2.4p6-DLH-QPC-20090315-bin.zip
Copy to “C:\Program Files\NTP\bin”, replacing previous ntpd.exe.

5.  Install SerialPPS.
Extract all from “serialpps-20090606.zip“.
Edit “install.bat”
On line 6, remove ‘if “x86″==”%PROCESSOR_ARCHITECTURE” ‘
Remove line 7 and 8 (you can just put “REM ” in front and they will be ignored, almost like a comment)
Run “install.bat”
Ensure that “serialpps.sys” was copied to “C:\Windows\system32\drivers”
Copy “serialpps-ppsapi-provider\x86\serialpps-ppsapi-provider.dll” to “C:\”
Right-click “My Computer”, go to properties.
Click “Advanced” tab
Click “Environment Variables” button
Under “System variables”, Click “New” button
Name:  PPSAPI_DLLS
Value: C:\serialpps-ppsapi-provider.dll

6.  Configure GPS (for Garmin)
Run “SNSRCFG.exe
Connect to GPS
Configure
Set baud rate to 4800
Enable “Pulse Per Second”
Press F7
Enable GPRMC, disable others
Send config to GPS

7.  Configure NTP
Edit “C:\Program Files\NTP\etc\ntp.conf”
Remove all entries, add the following
driftfile “C:\Program Files\NTP\etc\ntp.drift”
enable stats
statsdir “C:\Program Files\NTP\etc\”
statistics loopstats
server 127.127.22.1 minpoll 4 #PPS
server 127.127.20.1 iburst prefer minpoll 4 maxpoll 7 #GPS
#fudge 127.127.20.1 time1 0.4 refid GPS #uncomment and change time1 as needed

8.  Ensure GPS is connected to serial port 1

9.  Restart computer

10. Unplug GPS and disable Microsoft Ball-mouse (if listed)
Go to device manager: My Computer->Properties->Hardware->Device Manager
Under “Mice and other pointing devices”, right-click and disable “Microsoft Serial BallPoint”

11. Reconnect GPS Restart computer

12. Start NTP server
Run “C:\Program Files\NTP\bin\startntp.bat”

13. Monitor NTP server
Run “C:\Program Files\NTP\bin\ntpstatus.bat”
Both GPS and PPS should show up.  After the GPS gets a lock, NTP should sync to the servers.
Refer to online documentation for help.
Alternatively, use “NTP Time Server Monitor” from Meinberg

To Uninstall PPS driver, run “uninstall.bat”.

© 2024 Jeremy W. Langston

Theme by Anders NorenUp ↑