Andy_B
New member
Cheap USB dongles were mentioned on another thread here 2 or 3 weeks ago, so I thought I'd buy one and try it on my Mac.
I bought the cheapest one I could find on eBay, which was £8 including postage from the seller "jk_parts store": http://www.ebay.co.uk/itm/272190165001
It is advertised as "Vk-172 GPS/GLONASS Ublox7", and there seem to be many similar ones on eBay and Amazon.co.uk
I am very impressed with this dongle. Within 5 or 6 seconds the green light starts to flash, and it's already got a fix. It seems to be several meters more accurate than Google Maps on my phone, even inside my flat.
I don't know if it was that quick to find my position the first time it started up - the seller did not advertise that this dongle works with Mac, but I figured that it likely would. I was right about that, but I was naive in assuming that it would plug and play or that getting it to work would be obvious to a man of my abilities. The following is to save anyone else the same difficulties.
Packet of gum for scale:
U-blox is the manufacturer of the chipset; U-box 7 the version of their product they released in, I think, 2013.
After Googling various spellings of "ublox", "u-blox", "u-blox7" and so on, combined with "Mac OS X", I found this StackOverflow comment by the handsome Miquel Garcia: http://stackoverflow.com/a/32779003
I'm not sure if Mr Garcia is right in suggesting that the number of the device node relates to the Receiver@… number in the `ioreg` output. Right now they don't match up for me on my system, but maybe that's because I've been plugging and unplugging. What he did put me onto, however, is that the device node is named in the format /dev/tty.usbmodem12345 (ending in a 3-figure number, as far as I've seen). I don't know why this USB GPS dongle has "usb modem" in its name, but that's what it's called.
So if you buy one of these, and you want to use it on your Mac, the icon for Terminal.app looks like this:
Then in Terminal.app you need to `ls /dev/tty*usbmodem*` - the `ls` stands for "list files" and the shell expands the asterisks in the second part to all files named "tty-anything-usbmodem-anything" in the /dev directory:
(I think Terminal's default colours are the opposite way around, black letters on a white background, but it's the text that's important)
Thus the only /dev/tty node on my system with "usbmodem" in the name is currently /dev/tty.usbmodem621
This is the "secret code" you put for the DataPort, adding a "new connection" in OpenCPN's preferences:
The other part of the secret sauce is that the baud rate is 9600 - the dongle didn't work until I changed that. Then OpenCPN's map immediately jumped to my location.
I think the syntax to query the baud rate of the serial port on Mac is `stty -f /dev/tty*usbmodem*`, but my path to getting this working was a little convoluted, and I actually established this under Linux, where the command is `sudo stty -F /dev/ttyACM0` (the device node is named differently on Linux, ttyACM-whatever, instead of tty.usbmodem-whatever on Mac).
I'm not sure how prone the name of the device node is to change. On my Macbook right now it seems to show as /dev/tty.usbmodem621 on one USB port, and /dev/tty.usbmodem421 on the other. Presumably I could just add both dev nodes in OpenCPN and then it would always work, irrespective of which port the dongle is plugged into; but presumably the device node would then change again to something else if it was connected via a USB hub (perhaps this explains why Miquel Garcia's one has a 5-digit number at the end). You could easily write a script (in Bash or Applescript) to search and replace the correct device node name in ~/Library/Preferences/opencpn/opencpn.ini before launching OpenCPN.
On Linux I can `sudo cat /dev/ttyACM0` and get a bunch of text scrolling up the screen, the serial data that the GPS dongle is sending to the computer (NMEA sentences?). On Mac I cannot do this, for some reason.
I'm sorry I'm so wordy, but I hope these comments may be helpful to others in the future. I'm using Mac OS X "El Capitan" (10.11), which is the latest version of OS X at the time of writing. Since the dongle seems just to be spitting plain-text down the USB cable, I don't soon expect incompatibilities with future versions of OS X.
I bought the cheapest one I could find on eBay, which was £8 including postage from the seller "jk_parts store": http://www.ebay.co.uk/itm/272190165001
It is advertised as "Vk-172 GPS/GLONASS Ublox7", and there seem to be many similar ones on eBay and Amazon.co.uk
I am very impressed with this dongle. Within 5 or 6 seconds the green light starts to flash, and it's already got a fix. It seems to be several meters more accurate than Google Maps on my phone, even inside my flat.
I don't know if it was that quick to find my position the first time it started up - the seller did not advertise that this dongle works with Mac, but I figured that it likely would. I was right about that, but I was naive in assuming that it would plug and play or that getting it to work would be obvious to a man of my abilities. The following is to save anyone else the same difficulties.
Packet of gum for scale:
U-blox is the manufacturer of the chipset; U-box 7 the version of their product they released in, I think, 2013.
After Googling various spellings of "ublox", "u-blox", "u-blox7" and so on, combined with "Mac OS X", I found this StackOverflow comment by the handsome Miquel Garcia: http://stackoverflow.com/a/32779003
I'm not sure if Mr Garcia is right in suggesting that the number of the device node relates to the Receiver@… number in the `ioreg` output. Right now they don't match up for me on my system, but maybe that's because I've been plugging and unplugging. What he did put me onto, however, is that the device node is named in the format /dev/tty.usbmodem12345 (ending in a 3-figure number, as far as I've seen). I don't know why this USB GPS dongle has "usb modem" in its name, but that's what it's called.
So if you buy one of these, and you want to use it on your Mac, the icon for Terminal.app looks like this:
Then in Terminal.app you need to `ls /dev/tty*usbmodem*` - the `ls` stands for "list files" and the shell expands the asterisks in the second part to all files named "tty-anything-usbmodem-anything" in the /dev directory:
(I think Terminal's default colours are the opposite way around, black letters on a white background, but it's the text that's important)
Thus the only /dev/tty node on my system with "usbmodem" in the name is currently /dev/tty.usbmodem621
This is the "secret code" you put for the DataPort, adding a "new connection" in OpenCPN's preferences:
The other part of the secret sauce is that the baud rate is 9600 - the dongle didn't work until I changed that. Then OpenCPN's map immediately jumped to my location.
I think the syntax to query the baud rate of the serial port on Mac is `stty -f /dev/tty*usbmodem*`, but my path to getting this working was a little convoluted, and I actually established this under Linux, where the command is `sudo stty -F /dev/ttyACM0` (the device node is named differently on Linux, ttyACM-whatever, instead of tty.usbmodem-whatever on Mac).
I'm not sure how prone the name of the device node is to change. On my Macbook right now it seems to show as /dev/tty.usbmodem621 on one USB port, and /dev/tty.usbmodem421 on the other. Presumably I could just add both dev nodes in OpenCPN and then it would always work, irrespective of which port the dongle is plugged into; but presumably the device node would then change again to something else if it was connected via a USB hub (perhaps this explains why Miquel Garcia's one has a 5-digit number at the end). You could easily write a script (in Bash or Applescript) to search and replace the correct device node name in ~/Library/Preferences/opencpn/opencpn.ini before launching OpenCPN.
On Linux I can `sudo cat /dev/ttyACM0` and get a bunch of text scrolling up the screen, the serial data that the GPS dongle is sending to the computer (NMEA sentences?). On Mac I cannot do this, for some reason.
I'm sorry I'm so wordy, but I hope these comments may be helpful to others in the future. I'm using Mac OS X "El Capitan" (10.11), which is the latest version of OS X at the time of writing. Since the dongle seems just to be spitting plain-text down the USB cable, I don't soon expect incompatibilities with future versions of OS X.
Last edited: