OpenMarine
Difficulty Receiving NMEA Messages Via USB - Printable Version

+- OpenMarine (http://forum.openmarine.net)
+-- Forum: Pypilot (http://forum.openmarine.net/forumdisplay.php?fid=17)
+--- Forum: General discussion (http://forum.openmarine.net/forumdisplay.php?fid=18)
+--- Thread: Difficulty Receiving NMEA Messages Via USB (/showthread.php?tid=2596)



Difficulty Receiving NMEA Messages Via USB - bobmor99 - 05-21-2020

Navigation setup:
A Quark-A027 acquires AIS, GPS, and SeaTalk wind messages, then transmits that muxed info in NMEA 0183 messages via WiFi and USB.
https://www.quark-elec.com/product/qk-a027-wireless-ais-gps-receiver-with-seatalk-converter/

I am having trouble getting tinypilot to receive the NMEA messages via USB.

No "G" appears on the Nokia display when connecting the Quark output to tinypilot with a micro USB to micro USB cable.
https://www.amazon.com/gp/product/B076HGJGPK/ref=ppx_od_dt_b_asin_title_s00?ie=UTF8&psc=1

-----------------

Quark data stream as seen on standalone desktop:

bob@bob-OptiPlex-580:~$ sudo cat /dev/ttyACM0 
$GPRMC,201826.00,A,3005.64953,N,08136.94975,W,0.179,,210520,,,D*79
$GPGLL,3005.65166,N,08136.94977,W,201947.00,A,D*7B
$GPRMC,201948.00,A,3005.65152,N,08136.94981,W,0.012,,210520,,,D*64
...

bob@bob-OptiPlex-580:~$ sudo od -ta /dev/ttyACM0
0000000   $   G   P   G   S   V   ,   3   ,   3   ,   1   1   ,   2   8
0000020   ,   4   6   ,   1   4   4   ,   4   1   ,   4   6   ,   2   8
0000040   ,   2   4   5   ,   ,   5   1   ,   4   5   ,   2   2   3   ,
0000060   3   2   *   4   9  cr  nl   $   G   P   G   S   V   ,   3   ,
0000100   2   ,   1   2   ,   0   9   ,   0   1   ,   1   1   5   ,   ,
0000120   1   2   ,   1   2   ,   3   2   0   ,   3   1   ,   1   7   ,
0000140   5   0   ,   0   4   9   ,   3   2   ,   1   9   ,   5   7   ,
0000160   0   1   1   ,   3   5   *   7   6  cr  nl   $   G   P   G   S
...

---------------------------
---------------------------
tinypilot sporadically shows message activity. 

Nothing on this cat attempt:

tc@box:~$ sudo cat /dev/ttyACM0

tc@box:~$
-----
One message showed on the next try:

tc@box:~$ sudo cat /dev/ttyACM0
$GPGLL,3005.64979,N,08136.94626,W,203346.00,A,D*7E
tc@box:~$ 
------------
Similar results with od -ta:

tc@box:~$ sudo od -ta /dev/ttyACM0
0000000
tc@box:~$ 
-----------
tc@box:~$ sudo od -ta /dev/ttyACM0

0000000   $   G   P   R   M   C   ,   2   0   3   0   5   2   .   0   0
0000020   ,   A   ,   3   0   0   5   .   6   4   8   3   1   ,   N   ,
0000040   0   8   1   3   6   .   9   4   3   6   7   ,   W   ,   0   .
0000060   0   9   6   ,   ,   2   1   0   5   2   0   ,   ,   ,   D   *
0000100   6   7  cr  nl
0000104
------------
One time I saw a set of GPGSV messages:

tc@box:~$ sudo tail -f /dev/ttyACM0
$GPGSV,3,1,12,02,47,266,32,03,08,037,25,05,11,197,34,06,69,322,44*75
$GPGSV,3,1,12,02,47,266,32,03,08,037,24,05,11,197,34,06,69,322,44*74
$GPGSV,3,1,12,02,47,266,32,03,08,037,24,05,11,197,34,06,69,322,44*74
$GPGSV,3,1,12,02,47,266,32,03,08,037,25,05,11,197,34,06,69,322,43*72
$GPGSV,3,1,12,02,47,266,33,03,08,037,25,05,11,197,34,06,69,322,43*73
$GPGSV,3,1,12,02,47,266,33,03,08,037,25,05,11,197,34,06,69,322,43*73
$GPGSV,3,1,12,02,47,266,32,03,08,037,26,05,11,197,34,06,69,322,43*71
$GPGSV,3,1,12,02,47,266,32,03,08,037,26,05,11,197,34,06,69,322,43*71
$GPGSV,3,1,12,02,47,266,32,03,08,037,26,05,11,197,34,06,69,322,43*71
Odd that it's just GPGSV messages.

-------------------
The tail of dmesg:

[ 1701.542471] Indeed it is in host mode hprt0 = 00021501
[ 1701.742314] usb 1-1: new full-speed USB device number 4 using dwc_otg
[ 1701.742646] Indeed it is in host mode hprt0 = 00021501
[ 1701.973910] usb 1-1: New USB device found, idVendor=0483, idProduct=5742
[ 1701.973925] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1701.973932] usb 1-1: Product: STM32 Virtual ComPort
[ 1701.973938] usb 1-1: Manufacturer: STMicroelectronics
[ 1701.973945] usb 1-1: SerialNumber: 00000000003A
[ 1701.978290] cdc_acm 1-1:1.0: ttyACM0: USB ACM device

---------------------
tc@box:~$ sudo stty -F /dev/ttyACM0
speed 38400 baud; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>;
swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V;
flush = ^O; min = 0; time = 0;
-brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
tc@box:~$ 

-----------------
Earlier today, doing initial testing on the boat, the Quark had all three inputs, i.e. AIS, GPS, and wind. tinypilot occasionally showed a "W", but never a "G" on the Nokia display when connected to the Quark. On a standalone linux box, I observed all three types of NMEA messages coming out of the Quark.
(I'm now at home bench testing the USB connection and just have GPS messages to work with.)

---------------------

One more observation:
When I connect a BU353 GPS puck to the tinypilot, a "G" appears next to the "C" at the bottom of Nokia display.

Lastly, dmesg and stty for the BU353GPS usb puck:

[ 7714.792483] Indeed it is in host mode hprt0 = 00021501
[ 7715.002273] usb 1-1: new full-speed USB device number 5 using dwc_otg
[ 7715.002608] Indeed it is in host mode hprt0 = 00021501
[ 7715.243645] usb 1-1: New USB device found, idVendor=067b, idProduct=2303
[ 7715.243668] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 7715.243679] usb 1-1: Product: USB-Serial Controller D
[ 7715.243688] usb 1-1: Manufacturer: Prolific Technology Inc. 
[ 7715.249358] pl2303 1-1:1.0: pl2303 converter detected
[ 7715.252277] usb 1-1: pl2303 converter now attached to ttyUSB0

---------------------

tc@box:~$ sudo stty -F /dev/ttyUSB0
speed 4800 baud; line = 0;
intr = <undef>; quit = <undef>; erase = <undef>; kill = <undef>; eof = <undef>; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = <undef>; stop = <undef>; susp = <undef>;
rprnt = <undef>; werase = <undef>; lnext = <undef>; flush = <undef>; min = 0; time = 0;
-brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok -echoctl -echoke
tc@box:~$
 
-------------

Before going further, might the problem have anything to do with the cr lf message terminators?
Or with the baud rate?

Many thanks in advance for any suggestions

--Bob M
Cal 31


RE: Difficulty Receiving NMEA Messages Via USB -- Solved - bobmor99 - 05-22-2020

My apologies. User headspace.
I needed to create a route in Android OpenCPN in order for tinypilot to present the "G" option.
There goes my 0 reputation.
--Bob M


RE: Difficulty Receiving NMEA Messages Via USB - seandepagnier - 05-24-2020

The "G" option is for gps and does not require a route, but you do need gps mode to follow routes.

I suggest getting gpsd to read from your gps, and pypilot will automatically detect gpsd. The bu353 works automatically and is probably also used in binary mode by gpsd.