Time sync Rasp3 usb gps

edited March 2019 in Supported devices

Hi all!

Yesterday i did install the latest emteria OS. It works great! My plan is to use it stand alone without any wifi connection.
The problem is that de rasp pi3 will loose its tike. I have a clock module for the Pi but dont know how to install it on the OS. Somebody that knows if that will work? Otherwise is have a gnss usb receiver but tried it to connect it with https://github.com/freshollie/UsbGps4Droid . Enable mock service is a problem. I enabled the mock location trough developer option, but the gps4droid app will keep saying the mock location service is off. Do i something wrong?
Btw, can i use the usb gso receiver for time? Or will it not work whatever what?



  • edited February 2019

    Hi Koen, last two Emteria versions contain USB GPS driver with time-sync functionality, but this is GPS driver and I don't know if it works with GNSS receivers. Look at https://forum.emteria.com/discussion/53/gps-module/p2.

    BTW, Emteria is able to read USB GPS receivers by default, so you don't need any mock apps.

  • There are other discussions about RTC modules for Pi, which may be helpful for you. If you are able to read the time from GPS, you can go ahead and update the system time (either from a script or from an app).

  • Current version of USB GPS driver updates system time if property "ro.kernel.android.gps.time_sync" is set to some nonzero value (I recomend 20 or 30).

  • Hello All. Thank you for your support.
    @ Martin. I can check your option by typing the command in terminal? Or how can i check this?

  • edited February 2019

    You must edit file build.prop probably located in the /system folder and reboot. Use total commander, for example.

  • HI Martin,
    The line says: ro.kernel.android.gps=ttyACMO
    What do i have to change in this line?

  • No, you should add new line:

    But at first, try if your receiver is compatible by some application, e.g. GPS Status.

  • Your Right. I add the new line, rebooted. When checking with gps status it keeps looking for GPS location. Strange.

  • edited February 2019

    So you could try to install and run "Serial USB Terminal" (https://play.google.com/store/apps/details?id=de.kai_morich.serial_usb_terminal&hl=en). In the menu, choose your attached USB receiver according to vendor and product IDs (google them for your device, e.g. http://www.linux-usb.org/usb.ids). As terminal type choose CDC. Touch "connect" and you should see received NMEA sentences. Copy and send them to this thread.

  • Sorry, I forgot to say - If you want to see anything in GPS Status, your device must see some satellites - it must be in the FIX state. Some buildings effectively prevent reception of the signal, so you can try to push the receiver out of the window.

  • Good Evening. I extracted this for gps serial:
    19:57:06.493 $GPGSV,4,2,13,13,06,017,,15,12,048,22,16,52,195,22,18,15,245,2376
    19:57:06.493 $GPGSV,4,3,13,20,53,092,41,21,31,067,32,26,27,178,33,27,76,298,28
    19:57:06.494 $GPGSV,4,4,13,30,09,332,184A
    19:57:06.494 $GPGLL,5152.63069,N,00533.24180,E,231842.00,A,A
    19:57:07.492 $GPRMC,231843.00,A,5152.63072,N,00533.24174,E,0.147,,070219,,,A72
    19:57:07.492 $GPVTG,,T,,M,0.147,N,0.272,K,A
    19:57:07.493 $GPGGA,231843.00,5152.63072,N,00533.24174,E,1,08,1.10,-4.9,M,46.1,M,,7A
    19:57:07.493 $GPGSA,A,3,21,20,27,10,08,18,26,16,,,,,2.08,1.10,1.76
    19:57:07.493 $GPGSV,4,1,13,07,16,301,,08,42,293,21,10,49,139,24,11,02,263,2778
    19:57:07.495 $GPGSV,4,2,13,13,06,017,,15,12,048,23,16,52,195,22,18,15,245,23
    19:57:07.496 $GPGSV,4,3,13,20,53,092,41,21,31,067,32,26,27,178,33,27,76,298,2875
    19:57:07.496 $GPGSV,4,4,13,30,09,332,19
    19:57:07.496 $GPGLL,5152.63072,N,00533.24174,E,231843.00,A,A64
    19:57:08.494 $GPRMC,231844.00,A,5152.63072,N,00533.24179,E,0.105,,070219,,,A
    19:57:08.494 $GPVTG,,T,,M,0.105,N,0.194,K,A2B
    19:57:08.496 $GPGGA,231844.00,5152.63072,N,00533.24179,E,1,08,1.10,-4.8,M,46.1,M,,
    19:57:08.497 $GPGSA,A,3,21,20,27,10,08,18,26,16,,,,,2.08,1.10,1.760F
    19:57:08.499 $GPGSV,4,1,13,07,16,301,,08,42,293,21,10,49,139,24,11,02,263,28
    19:57:08.499 $GPGSV,4,2,13,13,06,017,,15,12,048,23,16,52,195,22,18,15,245,2377
    19:57:08.500 $GPGSV,4,3,13,20,53,092,41,21,31,067,32,26,27,178,33,27,76,298,28
    19:57:08.500 $GPGSV,4,4,13,30,09,332,194B
    19:57:08.500 $GPGLL,5152.63072,N,00533.24179,E,231844.00,A,A
    19:57:09.491 $GPRMC,231845.00,A,5152.63073,N,00533.24178,E,0.043,,070219,,,A7C
    19:57:09.492 $GPVTG,,T,,M,0.043,N,0.079,K,A
    19:57:09.493 $GPGGA,231845.00,5152.63073,N,00533.24178,E,1,08,1.10,-4.9,M,46.1,M,,71
    19:57:09.494 $GPGSA,A,3,21,20,27,10,08,18,26,16,,,,,2.08,1.10,1.76
    19:57:09.494 $GPGSV,4,1,13,07,16,301,,08,42,293,21,10,49,139,23,11,02,263,2870
    19:57:09.495 $GPGSV,4,2,13,13,06,017,,15,12,048,23,16,52,195,22,18,15,245,24
    19:57:09.495 $GPGSV,4,3,13,20,53,092,41,21,31,067,32,26,27,178,33,27,76,298,2875
    19:57:09.496 $GPGSV,4,4,13,30,09,332,19
    19:57:09.496 $GPGLL,5152.63073,N,00533.24178,E,231845.00,A,A6F
    19:57:10.493 $GPRMC,231846.00,A,5152.63073,N,00533.24177,E,0.034,,070219,,,A
    19:57:10.494 $GPVTG,,T,,M,0.034,N,0.063,K,A21
    19:57:10.494 $GPGGA,231846.00,5152.63073,N,00533.24177,E,1,08,1.10,-5.0,M,46.1,M,,
    19:57:10.494 $GPGSA,A,3,21,20,27,10,08,18,26,16,,,,,2.08,1.10,1.760F
    19:57:10.496 $GPGSV,4,1,13,07,16,301,,08,42,293,21,10,49,139,23,11,02,263,28
    19:57:10.497 $GPGSV,4,2,13,13,06,017,,15,12,048,23,16,52,195,21,18,15,245,2374
    19:57:10.499 $GPGSV,4,3,13,20,53,092,42,21,31,067,32,26,27,178,33,27,76,298,28
    19:57:10.499 $GPGSV,4,4,13,30,09,332,184A
    19:57:10.499 $GPGLL,5152.63073,N,00533.24177,E,231846.00,A,A
    19:57:11.486 $GPRMC,231847.00,A,5152.63068,N,00533.24183,E,0.131,,070219,,,A74
    19:57:11.486 $GPVTG,,T,,M,0.131,N,0.243,K,A
    19:57:11.488 $GPGGA,231847.00,5152.63068,N,00533.24183,E,1,08,1.10,-4.9,M,46.1,M,,7D
    19:57:11.488 $GPGSA,A,3,21,20,27,10,08,18,26,16,,,,,2.08,1.10,1.76
    19:57:11.490 $GPGSV,4,1,13,07,16,301,,08,42,293,20,10,49,139,23,11,02,263,2871
    19:57:11.491 $GPGSV,4,2,13,13,06,017,,15,12,048,23,16,52,195,22,18,15,245,24
    19:57:11.492 $GPGSV,4,3,13,20,53,092,42,21,31,067,32,26,27,178,33,27,76,298,2876
    19:57:11.493 $GPGSV,4,4,13,30,09,332,19

    Looks like Gps to me?!

  • The device is a u-blox 7 usb receiver i found out. It is working with u-center windows 10.

  • edited February 2019

    Yes, your data are correct. If I send them to the current GPS driver then it works. There is only one small problem - your GPRMC sentences don't contain "Bearing" parameter but it couldn't be reason of your issue.

    Have you turned on the Position in the settings? And How version of Emteria do you have?

  • Hi Martin, I installed emteria v0.6.2. with a personal licence.
    Location in on. Mode Device only. GPS status has permission it says.

  • edited February 2019

    So this is very strange. So I see only two possibilities what could be wrong.
    1) Measure rate management built in driver is not working properly on u-blox 7
    2) Android core needs Bearing parameter

    I would send you modified driver with deactivated MRM and fake bearing parameter. Copy it to /system/lib/hw and don't forget set owner and permissions to original values (same as other drivers in hw folder). And reboot device.

  • @Martin, it looks to me that we should start using the same repository for a better collaboration. I'll check if we can replace our own code by a direct link to https://github.com/kconger/android-serial-gps-driver, which would include your future updates automatically.

  • Hi @kalkov, It would be great.

    Hi @Koen, I forgot for third possible source of your problems. How many devices do you have connected to USB ports? It's possible that your GPS device have different name than ttyACM0. You can see all tty devices in e.g. Total commander in the /dev folder.

  • Hi Martin,
    It is getting strange.
    I did film the boot so i can playback what the boot was saying:
    It found the Ublox 7 gps receiver. ACM0 cdc_acm 1-1.4:1.0
    binder 164:164 transactoin failed 29189.
    I changed the ACM to 1. Dont know why, and back to AMC0. Now the GPS status app is working. I can read the exact time from it.
    Android is not using the time that is picked up by the receiver, so thats the only problem i think. Tried location High Accuracy, Battey savind and Device only. Time is on network provided.
    We are getting there!

  • Martin.
    I want to thank you for your great help. I just made a very stupid mistake. ro.kernal is not working;-) ro.kernel is better!
    Many thanks!

  • You are welcome @Koen. @kalkov, please tale a look at Koen's post. Mysterious "binder transaction failed" issue is here again.

  • @Koen, you wrote that you are using version 0.6.2. Did you make clean install or update from some older version? Because I have suspicion that binder errors are invoked by system update or recovering.

  • edited February 2019

    Hi Martin,
    This is a clean install.

Sign In or Register to comment.