Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm trying to create a pair of virtual serial ports on my mac. This is fairly easy to do with many shareware programs on a PC. I figured there would be some uber-powerful shell command to do this in one line, but I can't find it.

I want to send NMEA data into one port, and have Google earth read the data out of the other.

Any tips?

EDIT

MrDaniel's /dev/ptypx comment seemed to be interesting - I can pull it out of /dev/ttypx just fine in terminal.
But Google earth seems to be reading cu.deviceName instead of the /ttypx deveices..

specifically (Old Pro):

When trying to import the current location using a GPS (or NMEA stream piped through our virtual serial port), we go: Tools > GPS > Realtime to get to the import screen.
After selecting the NMEA option, and enabling realtime tracking, it looks for connected devices, and seems to look at:

  • usb:
  • /dev/cu.Bluetooth-PDA-Sync
  • /dev/cu.Bluetooth-Modem
  • /dev/cu.iPhone-WirelessAP

Even with our ttypx serial port operating ok, it doesn't look for it.
I would like to get the data from that device into Google Earth.

share|improve this question
    
+1, as I also would like to do this for device development. Might also be ServerFault, SuperUser or StackOverflow. –  Max Ried Apr 3 '12 at 6:02
    
Have you considered using Google Latitude instead? If that is not acceptable, then please provide more details about what Google Earth is doing. –  Old Pro Jun 4 '12 at 9:32
add comment

4 Answers

Google has an extremely useful tool for Arduino developers and it simulates serial ports very well on OS X for testing purposes.

http://code.google.com/p/macosxvirtualserialport/

Might this help you?

share|improve this answer
1  
Forgive my undeleting this and editing it - I'd rather you got the credit for bringing google's awesome virtual serial port software to light. You may of course delete it again and I'll leave it alone if that is your preference. –  bmike Jun 4 '12 at 23:08
add comment

I think what you are looking for is a Pseudo Terminal as noted in Text-Terminal-HOWTO, it looks like Mac OS X has built in in /dev and it seems like this can do what you want to do e.g. two programs talking together via a "virtual" serial port.

Pseudo terminals are pairs of devices such as /dev/ptyp3 and /dev/ttyp3. There is no physical device directly associated with either of them, not even a serial port connector. But if a program treats ttyp3 like it was a serial port, what is read and written to that port appears on the other member of the pair ptyp3 which another program uses to read and write to. Thus two programs talk to each other via this method and one program on ttyp3 thinks it's talking to a serial port. It's something like a "pipe" between these two tty's.

Additonally, the screen program my by useful to you as well.

share|improve this answer
add comment

There are several angles to your question here:

  • Do you just want to convert NMEA tracks etc. into something Google Earth can read (and display)? GPSBabel is the tool of choice for these kind of things.
  • Do you want to attach your GPS and read its content via a serial port? Macs don't have serial ports, you will need something like Keyspan USA-19HS to connect serial devices via USB.
  • Do you want to create virtual serial devices out of curiosity? That's definitively possible but beyond my knowledge...
share|improve this answer
    
Option 3. I have the NMEA data (in realtime), and want to display it in realtime. Google Earth reads from a serial port, so I just need to figure out how to set up the ports, and pipe it into one of them. –  DefenestrationDay Nov 2 '11 at 3:40
    
Where is the NMEA data coming from? GPSBabel is able to act as a real-time converter, see gpsbabel.org/htmldoc-1.4.2/tracking.html –  patrix Nov 2 '11 at 18:03
    
It's streamed from an iPhone. I don't need conversion into anything (particularly kml), I just need a virtual serial port to throw the nmea data into, and suck it out the other end by Google Earth. –  DefenestrationDay Nov 2 '11 at 23:42
    
Every time I get to use my Keyspan I just grin ear to ear. Especially on my new 11 inch Air - so much new and old working together ;-) –  bmike Jun 4 '12 at 23:06
add comment

It's not clear you can fake out the built in serial port detection but I would start with a named pipe (mkfifo) in /dev/cu.fake.ttypx and have some data ready to be read when you enable the realtime.

My copy of Google Earth appears to poll each potential source in order and continues to do nothing but scan since I have no NMEA data being provided.

You'll of course need a small [shell|perl|python] script to read from /dev/ttypx and write to your "fake" fifo file.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.