From 7940417f1cb1fb412c437b1fd524af29cec74bb5 Mon Sep 17 00:00:00 2001 From: AvSquirrel Date: Thu, 19 May 2016 03:48:58 +0000 Subject: [PATCH] Add u-blox 8 to udev rules. Use generic descriptions for ublox 6/7. --- image/10-stratux.rules | 14 ++++++++++++-- main/ry835ai.go | 10 ++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/image/10-stratux.rules b/image/10-stratux.rules index e74fa512..74b046a2 100644 --- a/image/10-stratux.rules +++ b/image/10-stratux.rules @@ -1,8 +1,18 @@ # To be placed in /etc/udev/rules.d. # Auto-detect common USB stratux peripherals. -SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a7", SYMLINK+="vk172" -SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a6", SYMLINK+="vk162" +# u-blox devices. Known devices include +# ublox8: RY835AI, RY836AI +# ublox7: VK-172, RY725AI +# ublox6: VK-162 + +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a8", SYMLINK+="ublox8" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a7", SYMLINK+="ublox7" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a6", SYMLINK+="ublox6" +#SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a7", SYMLINK+="vk172" +#SUBSYSTEMS=="usb", ATTRS{idVendor}=="1546", ATTRS{idProduct}=="01a6", SYMLINK+="vk162" + + # pl2303 devices are indistinguishable using idVendor and idProduct. # Currently the BU-353-S4 and the TU-S9 (serialout) use the pl2303. diff --git a/main/ry835ai.go b/main/ry835ai.go index 7f9c5373..582d3a27 100644 --- a/main/ry835ai.go +++ b/main/ry835ai.go @@ -155,10 +155,12 @@ func initGPSSerial() bool { baudrate := int(9600) isSirfIV := bool(false) - if _, err := os.Stat("/dev/vk172"); err == nil { // u-blox 7. - device = "/dev/vk172" - } else if _, err := os.Stat("/dev/vk162"); err == nil { // u-blox 6. - device = "/dev/vk162" + if _, err := os.Stat("/dev/ublox8"); err == nil { // u-blox 8 (RY83xAI over USB). + device = "/dev/ublox8" + } else if _, err := os.Stat("/dev/ublox7"); err == nil { // u-blox 7 (VK-172, RY725AI over USB). + device = "/dev/ublox7" + } else if _, err := os.Stat("/dev/ublox6"); err == nil { // u-blox 6 (VK-162). + device = "/dev/ublox6" } else if _, err := os.Stat("/dev/prolific0"); err == nil { // Assume it's a BU-353-S4 SIRF IV. //TODO: Check a "serialout" flag and/or deal with multiple prolific devices. isSirfIV = true