This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
libGPS for TinkerBoard Android
#11
Hi Glidlock,

you don't need to compile. The library is already compiled, unzip it and you get a gps.default.so. This .so files are libraries on linux and android systems (like .dll on windows).
To copy to the TB need to execute this:

Code:
adb root
adb remount
adb push gps.default.so /system/lib/hw/
You need to have the adb driver installed on your system.
After reboot and connected usb gps sensor, you'll get the serial interface depending on model, /dev/ttyACMx or /dev/ttyUSBx.
But it will have root permission and this you can resolve with SuperSu installed. Look here, how to do this: https://tinkerboarding.co.uk/forum/thread-264.html
After you can edit the '/system/etc/install-recovery.sh' to change the permission.
Code:
#!/system/bin/sh

# If you're implementing this in a custom kernel/firmware,
# I suggest you use a different script name, and add a service
# to launch it from init.rc

# Launches SuperSU in daemon mode only on Android 4.3+.
# Nothing will happen on 4.2.x or older, unless SELinux+Enforcing.
# If you want to force loading the daemon, use "--daemon" instead

/system/xbin/daemonsu --auto-daemon &

# Some apps like to run stuff from this script as well, that will
# obviously break root - in your code, just search this file
# for "install-recovery-2.sh", and if present, write there instead.

chmod 666 /dev/ttyACM0
chown gps:gps /dev/ttyACM0


Assumed that your serial device is ttyACM0.

And if your device is not ttyACM0 you need to create a gps.conf in /system/etc/:

Code:
adb shell echo "'GPSPORT /dev/ttyUSB0\nGPSSPEED 115200' > /system/etc/gps.conf"

Without the library uses ttyACM0 and 9600baud.

Note that you need to reboot with connected gps receiver after that.

Once you managed this all, you will get nmea messages like this in logcat:
Code:
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 548, Found 13 tokens
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 551,  0: 'GPRMC'
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 551,  1: '173058.00'
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 551,  2: 'A'
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 551,  3: '5128.62643'
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 551,  4: 'N'
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 551,  5: '00704.80631'
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 551,  6: 'E'
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 551,  7: '0.056'
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 551,  8: ''
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 551,  9: '251117'
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 551, 10: ''
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 551, 11: ''
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 551, 12: 'A'
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 572, GPS satellites
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 637, in RMC, fixStatus=A
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_update_bearing: line = 469, nmea_reader_update_bearing()
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_update_bearing: line = 473, nmea_reader_update_bearing() return -1
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 726, r->fix.flags: 5
11-25 18:30:58.060   649  1137 D gps_zkw : nmea_reader_parse: line = 538, Received: '$GPVTG,,T,,M,0.056,N,0.103,K,A*22

This is a lot of spam in logcat and I will disable the debug messages once I found all bugs.
Reply
#12
thanks for your quick and detalied responce lobo,

i will try tonight.

give feedback soon.  

thanks one more time
Reply
#13
Lobo hi again,
I did everything that you wrote above.
1. Get a root access. 

[Image: 5013090b5f43a566365d860667e789e6-full.jpg]


2. Push your library
3. Reboot
4. Connect my USB GPS mouse 


But in logcat didn’t see nothing about “NMEA”
USB GPS didn’t connected like ttyACMx or ttyUSBx, it connected just like USB device. 


[Image: fffc8d60f8056b7287ebd30dbbd6016d-full.jpg]

Am I did something wrong or the problem with my hardware?
Reply
#14
That's because the driver for your serial usb device is not enabled in the kernel.
Need to compile a kernel with CONFIG_USB_SERIAL_CP210X=y.
I really don't understand that are a lot of not needed drivers are enabled in the config and the ones that are very common not.
Asus tinkerboard engineers, please enable these drivers for the next release:
CONFIG_USB_SERIAL_CP210X=y
CONFIG_USB_SERIAL_FTDI_SIO=y
CONFIG_USB_SERIAL_CH341=y
CONFIG_USB_SERIAL_PL2303=y

But Glidlock, if you are able to compile a kernel you can do it by yourself.
Reply
#15
(12-27-2017, 02:06 PM)lobo Wrote: That's because the driver for your serial usb device is not enabled in the kernel.
Need to compile a kernel with CONFIG_USB_SERIAL_CP210X=y.
I really don't understand that are a lot of not needed drivers are enabled in the config and the ones that are very common not.
Asus tinkerboard engineers, please enable these drivers for the next release:
CONFIG_USB_SERIAL_CP210X=y
CONFIG_USB_SERIAL_FTDI_SIO=y
CONFIG_USB_SERIAL_CH341=y
CONFIG_USB_SERIAL_PL2303=y

But Glidlock, if you are able to compile a kernel you can do it by yourself.

Thank for response, i'll trying to try.
Reply
#16
Lobo, hi again.

Thank you all is working now. 

I red that you install TB in your car. 

What else, except GPS you connect to your TB? 

Maybe radio or encoders or stiring wheel buttons?
Reply
#17
Do you have a Linux PC to check your GPS mouse with? If yes connect it to your PC and check in the terminal with dmesg what port is created and do a cat to that port. I think it would be also a /dev/ttyUSB0 or 1, 2...
Normaly, if it is created a /dev/ttyUSB0 when your mouse is connected, then there should be some noise like NMEA messages there. You can also do a dmesg at the Android terminal (adb shell) after you connected the usb mouse. Please copy the log here. There should be some messages that the port is created with the cp210x driver.
Reply
#18
(01-15-2018, 07:41 PM)lobo Wrote: Do you have a Linux PC to check your GPS mouse with? If yes connect it to your PC and check in the terminal with dmesg what port is created and do a cat to that port. I think it would be also a /dev/ttyUSB0 or 1, 2...
Normaly, if it is created a /dev/ttyUSB0 when your mouse is connected, then there should be some noise like NMEA messages there. You can also do a dmesg at the Android terminal (adb shell) after you connected the usb mouse. Please copy the log here. There should be some messages that the port is created with the cp210x driver.

I'm sorry I edited prewious post, because right now all works good.

Problem was in baud rate. My rate is 4800.

I little bit edit build.prop and insert script to init.d like described in link below 

https://github.com/dipcore/gps-glonass-android-driver.



I red that you install TB in your car. 

What else, except GPS you connect to your TB? 

Maybe radio or encoders or stiring wheel buttons?
Reply
#19
Fine that you managed it.
But need to let all users know that the library make some trouble. I havn't found yet why I have often messages 'waiting for GPS' in the app HereWeGo. It's hard to find, always when it happens, I am driving, need to start a logcat. I have made a homescreen widget, that show me speed, bearing and the state and this is working without drop outs. When I touch it it starts a logcat process. Hopefully I can find root cause soon.
But I will remove the TB from my car soon to use an Odroid C2. The reason is that the TB don't work well with my multitouch screen that I bought years ago from Chalk-Elec. There are drop outs in the usb subsystem that cause very often missing events button down and button up. Nearly impossible to write a street name in the navigation app. I know that it works flawlessly with a C2 as it worked also flawlessly with my former C1. The TB runs well with my VU7+ screen, but this has different dimension as my Chalk-Elec. To change the screen in my car would mean a big work, so I will return to a Hardkernel product. The TB I will use for a different project.

And Glidlock, back to your question: I use it only for navigation and listening music. I was not able to use the steering wheel buttons, because my Volvo uses fibre optic based Medialink, no chance to intercept. But I heard that with other cars it is possible to snoop the can bus messages to receive button events.
Reply
#20
Thanks Lobo,

I have your gps driver working nicely (using this device https://www.sparkfun.com/products/11058 wired directly to serial port)

Only issue I seem to have is the massive amounts of logging coming from the driver. I compiled the latest from github ( with #define GPS_DEBUG 0 ), no more logging, but it seems buggy. Does the source code on github match the V3 binary you posted?

Thanks again, nice work!
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)