freshollie / UsbGps4Droid

USB GPS Provider for android :artificial_satellite:. A maintained fork of hvb/USBGps4Droid
GNU General Public License v3.0
82 stars 34 forks source link

App doesn't work with ublox LEA M8P #7

Closed kalon33 closed 6 years ago

kalon33 commented 7 years ago

Using a USB GPS module based on a ublox LEA M8P, I got the error "too many connection problems". GPS is working properly with u-center on Windows 10.

kalon33 commented 7 years ago

screenshot_2017-08-24-22-57-14 screenshot_2017-08-24-22-56-33

freshollie commented 7 years ago

I see this device supports NMEA. Is it possible I could get a log? I have only been testing this on http://usglobalsat.com/p-688-bu-353-s4.aspx.

Do any other apps in the playstore work with this device?

kalon33 commented 7 years ago

Yes, it supports NMEA, outputting various versions of it, currently set as 4.1 version. Do you want an NMEA output log?

No, I couldn't find other app on the playstore working with USB devices, when this one is properly detecting the device and naming it.

Ublox GPS chips works with three protocols: NMEA, proprietary UBX one, and another one (RTCM if I remember well). Here are protocol specs for mine, M8 series, which supports notably GPS, Glonass, Beidu and Galileo: https://www.u-blox.com/sites/default/files/products/documents/u-blox8-M8_ReceiverDescrProtSpec_(UBX-13003221)_Public.pdf

----- Mail original -----

De: "Oliver Bell" notifications@github.com À: "freshollie/UsbGps4Droid" UsbGps4Droid@noreply.github.com Cc: "Nicolas Derive" kalon33@ubuntu.com, "Author" author@noreply.github.com Envoyé: Vendredi 25 Août 2017 10:33:43 Objet: Re: [freshollie/UsbGps4Droid] UsbGPS stopped: too many connection problems (#7)

I see this device supports NMEA. Is it possible I could get a log? I have only been testing this on http://usglobalsat.com/p-688-bu-353-s4.aspx .

Do any other apps in the playstore work with this device?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .

freshollie commented 7 years ago

For now I'm going to concede that I will not be able to make this device work due to it having a vast array of protocols which need to be selected and I have no way of testing.

If you want this app to work I suggest buying the GPS using I linked.

Other options are you edit the driver to work with your device and then send me a pull request once completed.

kalon33 commented 7 years ago

I don't think they really need to be selected: by default, and if you don't have any manner to store parameters on the chip (flash or battery to keep RAM on when chip is not On), which is the majority of the devices I've seen, device outputs NMEA.

That said, is that complex work to edit the driver to work with my device? If it is, I may have a look at sending a similar device to you to give you some way to test (if you want that? and have time to work on this).

----- Mail original -----

De: "Oliver Bell" notifications@github.com À: "freshollie/UsbGps4Droid" UsbGps4Droid@noreply.github.com Cc: "Nicolas Derive" kalon33@ubuntu.com, "Author" author@noreply.github.com Envoyé: Vendredi 25 Août 2017 14:03:44 Objet: Re: [freshollie/UsbGps4Droid] UsbGPS stopped: too many connection problems (#7)

For now I'm going to concede that I will not be able to make this device work due to it having a vast array of protocols which need to be selected and I have no way of testing.

If you want this app to work I suggest buying the GPS using I linked.

Other options are you edit the driver to work with your device and then send me a pull request once completed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .

freshollie commented 7 years ago

I mean yeah I could probably edit the driver if I had the device, but editing a driver for a device which I don't own would be nearly impossible.

Can you send me the android log file after you get the too many connection problems?

That error is raised when the device is not outputting any info at all. All this service does is literally read the data output directly strings, and it sounds like your device is sending none (Possibly waiting for the correct start signal)

I don't want you to send me anything expensive as I have no guarantee of this working. Though if you are still serious about sending me a device to work with then that can be arranged.

kalon33 commented 7 years ago

What kind of logfile do you need? adb logcat output? Anything else that would be useful for you? I will have a look to give you these over the weekend.

Apparently this device is detected as a USB serial one (creates a COM port on Windows, and equivalent /dev/tty*** on Ubuntu Linux).

If you think there's a way to get the device to work if you have it in hands, there's no problem for me to send mine or buy another one to send it to you. Supporting it would probably benefit to the community somehow so that's not wasted :)

----- Mail original -----

De: "Oliver Bell" notifications@github.com À: "freshollie/UsbGps4Droid" UsbGps4Droid@noreply.github.com Cc: "Nicolas Derive" kalon33@ubuntu.com, "Author" author@noreply.github.com Envoyé: Vendredi 25 Août 2017 14:22:04 Objet: Re: [freshollie/UsbGps4Droid] UsbGPS stopped: too many connection problems (#7)

I mean yeah I could probably edit the driver if I had the device, but editing a driver for a device which I don't own would be nearly impossible.

Can you send me the android log file after you get the too many connection problems?

That error is raised when the device is not outputting any info at all. All this service does is literally read the data output directly strings, and it sounds like your device is sending none (Possibly waiting for the correct start signal)

I don't want you to send me anything expensive as I have no guarantee of this working. Though if you are still serious about sending me a device to work with then that can be arranged.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub , or mute the thread .

freshollie commented 7 years ago

Android has its own USB wrapper which doesn't require access to /dev/tty***. As this cannot be done without root. See https://developer.android.com/reference/android/hardware/usb/package-summary.html

The logcat would be perfect. I have several debug lines which I can read from the output and maybe understand the problem.

Can you cat /dev/tty*** on your computer with the devices plugged in and also send me the output?

kalon33 commented 6 years ago

So here is the cat /dev/ttyACM0

adb logcat to come.

kalon33 commented 6 years ago

adb logcat -d

Is that the one you want?

freshollie commented 6 years ago

Perfect. The cat shows that the device is outputting the correct data, the logcat shows where the error is. I will look into fixing an release a test build today!

kalon33 commented 6 years ago

Side question, does the app parses all NMEA messages? Does it support all GNSS constellation messages (from GPS, but also from GLONASS, Beidu and Galileo systems)? This device supports them all (as stated in the pdf file I sent).

Thanks for the fix :)

freshollie commented 6 years ago

I will get back to you on that. Please download and install this apk and do another adb logcat. Notice the error message on screen has now changed.

freshollie commented 6 years ago

As per. NmeaParser the only information which is actually collected from the device is

These provide all the needed information to update the android GPS location.

All other information can be written to a file if specified (Enable/Disable NMEA log)

kalon33 commented 6 years ago

Indeed, message has changed: screenshot_2017-08-27-14-57-33

Here is the new logcat

Thanks

freshollie commented 6 years ago

Thanks, can you download the app from the same link and send me the logcat again :)

kalon33 commented 6 years ago

Here it is :)

freshollie commented 6 years ago

Same again please, what I am trying to do is work out what interface the device requires.

kalon33 commented 6 years ago

Here it is again :)

freshollie commented 6 years ago

Hey that was working! Leave it going!

freshollie commented 6 years ago

The log shows that you disconnected the device.

kalon33 commented 6 years ago

Android disconnected itself, asking me again if I authorize usbgps to use it. Meanwhile (a few seconds after the message, before I choosed OK, I got an error). I launched it again after the logcat, left it running. I have NMEA data in the log, but N/A for everything: number of satellites, accuracy, location, altitude and Gps Time.

kalon33 commented 6 years ago

Other android apps that are normally giving satellites list with internal GPS doesn't provide any info now.

freshollie commented 6 years ago

Reading the log, it looks like the NMEA protocol being read back has not been implemented into the driver.

Other android apps that are normally giving satellites list with internal GPS doesn't provide any info now.

I don't understand what you mean this.

freshollie commented 6 years ago

I've built an APK at the same link to work for added NMEA set, try that. Leave the GPS somewhere where it can get a fix. The log showed no GPS fix.

kalon33 commented 6 years ago

In some other android GPS apps (for internal GPS devices), you can get a list of current satellites used, and various info about GPS. For now I don't have them with the external one. Is that expected?

Now I have proper position fix, with altitude and number of satellites used in UsbGPS (the latter one not outside UsbGPS)

freshollie commented 6 years ago

Yes, that is expected due to the driver not interpreting the list of satellites from the device, only the number.

So the device is now working perfectly?! :))

freshollie commented 6 years ago

If you want an interpretation of the satellite positions, please make a separate issue. It will take much longer for me to produce, though it is a long term goal.

kalon33 commented 6 years ago

yep, that's now working :)

Is that expected that GPS time is a long integer, not usual time format? I'll create this issue, and, if you mind, another one to have some basic options like the ones available for sirf devices :)

freshollie commented 6 years ago

"Gps Time" should be the same length as "Sys Time" as can be seen from the screenshots. That's great this is now working, I am surprised.

kalon33 commented 6 years ago

so this is OK, both strings look like the same kind of thing. What's the difference between altitude (MSL) and altitude? I get both from my internal chip and only MSL one from external device (but not labeled as such).

kalon33 commented 6 years ago

I don't have fix type info neither. Is that expected?

kalon33 commented 6 years ago

neither VDOP/HDOP/PDOP...

freshollie commented 6 years ago

Do the altitude numbers differ? I just read what comes from the nmea and add it to a location object.

https://developer.android.com/reference/android/location/Location.html

Notice this object does not have the ability to set satellites or any of that info. I am pretty sure this is a limitation of android.