Use grep to write in file gpspipe data

48 Views Asked by At

I am trying to use the gpspipe tool to create a file output of latitude and longitude data. All I am interested only "GPRMC" NMEA messages so I have constructed the current line of code isolating the GPPA lines (which have this info).

gpspipe -r -t -o test.txt | grep "GPRMC"

I can see the correct output in monitor when I run gpspipe -r -t |grep "GPRMC" and I save output in file when I run gpspipe -r -t > gpsoutput.txt.After the command: gpspipe -r -t > gpsoutput.txt the file gpsoutput.txt is 2024-03-25 08:21:10: {"class":"VERSION","release":"3.20","rev":"3.20","proto_major":3,"proto_minor":14} 2024-03-25 08:21:10: {"class":"DEVICES","devices":[{"class":"DEVICE","path":"/dev/ttyACM0","driver":"u-blox","subtype":"SW EXT CORE 1.00 (0fa0ae),HW 00190000","subtype1":",ROM BASE 0x118B2060,FWVER=HPG 1.32,PROTVER=27.31,MOD=ZED-F9P,GPS;GLO;GAL;BDS,SBAS;QZSS","activated":"2024-03-25T08:21:10.000Z","flags":1,"native":1,"bps":9600,"parity":"N","stopbits":1,"cycle":1.00,"mincycle":0.25}]} 2024-03-25 08:21:10: {"class":"WATCH","enable":true,"json":false,"nmea":true,"raw":0,"scaled":false,"timing":false,"split24":false,"pps":false} 2024-03-25 08:21:11: $GPZDA,082110.00,25,03,2024,00,00*6C 2024-03-25 08:21:11: $GPGGA,082110.00,4601.0178,N,01154.2363,E,1,24,0.72,268.29,M,42.674,M,,*69 2024-03-25 08:21:11: $GPRMC,082110.00,A,4601.0178,N,01154.2363,E,0.1147,61.965,250324,3.3,E*56

. When I run gpspipe -r -t |grep "GPRMC" > gpsoutput.txt the file is empty... Why? How do I do?

0

There are 0 best solutions below