I've found a cheap USB GPS dongle which works with OpenCPN on Mac OS X.

Andy_B

New member
Joined
19 Jun 2015
Messages
17
Visit site
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:

tLDorS7.jpg

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:
W53rgrU.png

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:

1yut0kr.png


(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:

u54amTM.png

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:

Tammany

Member
Joined
24 Oct 2015
Messages
694
Visit site
Ublox gps chips are good bits of kit, all my r/c plane & drone gps sets use ublox for GPS signals and they need accurate readings for autopilot functions.
 

Joost Kolloffel

New member
Joined
6 Jun 2017
Messages
1
Visit site
Dear Andy,

Although you posted this topic more than a year ago, you solved this problem for me. I have a MacBook Air on MacOS Sierra (10.12.5) with OpenCPN 4.6.1 installed. I have an external GPS that I attach with a USB cable. It is the Navilock NL-602U with an u-blox 6 chip set. With the command: 'ls /dev/tty.*' in Terminal I found that the name of the device is '/dev/tty.usbmodem1421'. I typed this in the OpenCPN-window under 'Settings'. Voila, it works!

I actually e-mailed with the product manager at Navilock last year to get this solved, and he does not know this solution. He advised me to get a GPS dongle that has Mac drivers.

You are s smart man Andy! I just love 'beating the system' and that sure happened here!

Greetings and many thanks from Holland! :)
 

Frankklose

Member
Joined
25 Nov 2001
Messages
189
Location
germany
Visit site
The Usb dongle "Vk-172 GPS/GLONASS Ublox7 " works under Windows also with Google Maps and no driver needed. Very good GPS receiver. It´s also used with the raspberry OPENPLOTTER project.
 

flo / snowflake

New member
Joined
5 Apr 2018
Messages
10
Visit site
dear andy and friends,
i am sitting on my sailing catamaran in trinidad with my family an cannot find the correct name of my gps dongle to put it into the data port field of my open cpn, thus not getting coordinates.
it is a different device than yours (globalsat bu-353 gps receiver prodice by "prolific") but i have the same problem as you (-:
so, following your advice in this blog and not being a computer expert i got as far as checking my "ioreg". BUT i cannot identify any name here that i could then look for when listing files in terminal. maybe you guys can help me? see below the contents of my "ioreg" results and and the device listing in my system profiler, sorry it`s in german. would be stoked if someone could give me a hint.
thanks, flo (s/v snowflake, https://orleyflo.wixsite.com/sailawayfamily)

USB-Serial Controller:

Produkt-ID: 0x2303
Hersteller-ID: 0x067b (Prolific Technology, Inc.)
Version: 3.00
Geschwindigkeit: Bis zu 12 MBit/s
Hersteller: Prolific Technology Inc.
Standort-ID: 0xfa130000 / 5
Verfügbare Stromstärke (mA): 500
Erforderliche Stromstärke (mA): 100
Zusätzlicher Betriebsstrom (mA): 0




| | }
| |
| +-o USB-Serial Controller@fa130000 <class AppleUSBDevice, id 0x1000025bc, registered, matched, active, busy 0 (21 ms), retain 11>
| {
| "sessionID" = 9997787875158
| "iManufacturer" = 1
| "bNumConfigurations" = 1
| "idProduct" = 8963
| "bcdDevice" = 768
| "Bus Power Available" = 250
| "USB Address" = 5
| "bMaxPacketSize0" = 64
| "iProduct" = 2
| "iSerialNumber" = 0
| "bDeviceClass" = 0
| "Built-In" = No
| "locationID" = 18446744073610133504
| "bDeviceSubClass" = 0
| "bcdUSB" = 272
| "USB Product Name" = "USB-Serial Controller"
| "PortNum" = 3
| "non-removable" = "no"
| "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
| "bDeviceProtocol" = 0
| "IOUserClientClass" = "IOUSBDeviceUserClientV2"
| "IOPowerManagement" = {"DevicePowerState"=0,"CurrentPowerState"=3,"CapabilityFlags"=65536,"MaxPowerState"=4,"DriverPowerState"=3}
| "kUSBCurrentConfiguration" = 1
| "Device Speed" = 1
| "USB Vendor Name" = "Prolific Technology Inc."
| "idVendor" = 1659
| "IOGeneralInterest" = "IOCommand is not serializable"
| "IOClassNameOverride" = "IOUSBDevice"
| }
 

prv

Well-known member
Joined
29 Nov 2009
Messages
37,363
Location
Southampton
Visit site
The thread is 3 months old. The new post does not refer to an OS so it could well be Windows. :rolleyes:

Two years, and the new post is indisputably about a Mac.

I'm just waiting for Flo to get back with that /dev listing so I can help him. Trinidad timezone, of course, plus I guess as a new user it's also going to need Mod approval which will slow things down.

Pete
 
Last edited:

flo / snowflake

New member
Joined
5 Apr 2018
Messages
10
Visit site
hi pete,
thanks for coming back on this, well appreciated!

see below the output in terminal for "ls /dev/tty*"

you might be on the right path, since "bluetooth" and the "floiphone" are the EAXT and ONLY options which the gps-included utility app as well as open cpn do actually offer me in their drop-down menues for chosing a serial port for the incoming signal.

how to proceed? can i create a serial port manually?

thx,
flo




Last login: Sat Apr 7 15:35:30 on console
Flos-MBP:~ Flo$ ls /dev/tty*
/dev/tty /dev/ttyse
/dev/tty.Bluetooth-Incoming-Port /dev/ttysf
/dev/tty.FlosiPhone-WirelessiAPv2 /dev/ttyt0
/dev/ttyp0 /dev/ttyt1
/dev/ttyp1 /dev/ttyt2
/dev/ttyp2 /dev/ttyt3
/dev/ttyp3 /dev/ttyt4
/dev/ttyp4 /dev/ttyt5
/dev/ttyp5 /dev/ttyt6
/dev/ttyp6 /dev/ttyt7
/dev/ttyp7 /dev/ttyt8
/dev/ttyp8 /dev/ttyt9
/dev/ttyp9 /dev/ttyta
/dev/ttypa /dev/ttytb
/dev/ttypb /dev/ttytc
/dev/ttypc /dev/ttytd
/dev/ttypd /dev/ttyte
/dev/ttype /dev/ttytf
/dev/ttypf /dev/ttyu0
/dev/ttyq0 /dev/ttyu1
/dev/ttyq1 /dev/ttyu2
/dev/ttyq2 /dev/ttyu3
/dev/ttyq3 /dev/ttyu4
/dev/ttyq4 /dev/ttyu5
/dev/ttyq5 /dev/ttyu6
/dev/ttyq6 /dev/ttyu7
/dev/ttyq7 /dev/ttyu8
/dev/ttyq8 /dev/ttyu9
/dev/ttyq9 /dev/ttyua
/dev/ttyqa /dev/ttyub
/dev/ttyqb /dev/ttyuc
/dev/ttyqc /dev/ttyud
/dev/ttyqd /dev/ttyue
/dev/ttyqe /dev/ttyuf
/dev/ttyqf /dev/ttyv0
/dev/ttyr0 /dev/ttyv1
/dev/ttyr1 /dev/ttyv2
/dev/ttyr2 /dev/ttyv3
/dev/ttyr3 /dev/ttyv4
/dev/ttyr4 /dev/ttyv5
/dev/ttyr5 /dev/ttyv6
/dev/ttyr6 /dev/ttyv7
/dev/ttyr7 /dev/ttyv8
/dev/ttyr8 /dev/ttyv9
/dev/ttyr9 /dev/ttyva
/dev/ttyra /dev/ttyvb
/dev/ttyrb /dev/ttyvc
/dev/ttyrc /dev/ttyvd
/dev/ttyrd /dev/ttyve
/dev/ttyre /dev/ttyvf
/dev/ttyrf /dev/ttyw0
/dev/ttys0 /dev/ttyw1
/dev/ttys000 /dev/ttyw2
/dev/ttys1 /dev/ttyw3
/dev/ttys2 /dev/ttyw4
/dev/ttys3 /dev/ttyw5
/dev/ttys4 /dev/ttyw6
/dev/ttys5 /dev/ttyw7
/dev/ttys6 /dev/ttyw8
/dev/ttys7 /dev/ttyw9
/dev/ttys8 /dev/ttywa
/dev/ttys9 /dev/ttywb
/dev/ttysa /dev/ttywc
/dev/ttysb /dev/ttywd
/dev/ttysc /dev/ttywe
/dev/ttysd /dev/ttywf
Flos-MBP:~ Flo$
 

prv

Well-known member
Joined
29 Nov 2009
Messages
37,363
Location
Southampton
Visit site
Ok, so there is no serial device created.

I must admit I'm a little hazy on how this part of things works in OSX, what happens in order for the devices to show up in /dev. However, I do vaguely recollect there being an issue with Prolific USB-serial chips, which is what your receiver appears to use to convert from the GPS output to USB.

It might be worth trying the Prolific drivers from this site: http://www.prolific.com.tw/US/ShowProduct.aspx?p_id=229&pcid=41

Failing that, there's a third-party driver here although it does require paying for.

Pete
 

prv

Well-known member
Joined
29 Nov 2009
Messages
37,363
Location
Southampton
Visit site
Last post before thread revival = 5th January 2018. :encouragement:

Are you going to contribute anything useful at any point?

Good luck with the drivers Flo, let us know how it goes. If it works (either one) you should get a /dev/tty<something> that wasn't there before. From that point it's just a question of putting the right settings in the right places - I can help with that if needs be though it sounds like the software you're using is able to discover things on its own.

Pete
 

flo / snowflake

New member
Joined
5 Apr 2018
Messages
10
Visit site
i am on it right now.
but dinner time = time with the kids is coming up as well here soon.
if i do not manage within the next half hour you read me tomorow (-:

:cool:
flo
 
Top