Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NMEAgpsDriver #90

Closed
prasaanth-selvakumar opened this issue Feb 28, 2018 · 26 comments
Closed

NMEAgpsDriver #90

prasaanth-selvakumar opened this issue Feb 28, 2018 · 26 comments
Assignees

Comments

@prasaanth-selvakumar
Copy link

my program crashes when i try to register the nmeagpsdriver can someone please help me

@PaulTR
Copy link
Contributor

PaulTR commented Feb 28, 2018

Can you post the log message for how it's crashing?

@Fleker
Copy link
Contributor

Fleker commented Feb 28, 2018

Have you tried to reboot the device after installing your app? Maybe it is related to permissions.

@prasaanth-selvakumar
Copy link
Author

gps

that line corresponds to the UserDeviceDriver.register();

@prasaanth-selvakumar
Copy link
Author

@Fleker
Yes i tried it still crashes

@prasaanth-selvakumar
Copy link
Author

prasaanth-selvakumar commented Mar 1, 2018

The NmeaGpsModule works fine I'm having issues only with the NmeaGpsDriver

@Fleker
Copy link
Contributor

Fleker commented Mar 1, 2018

Do you have the permission <uses-permission android:name="com.google.android.things.permission.MANAGE_GPS_DRIVERS" />

@prasaanth-selvakumar
Copy link
Author

Yeah I have included that in the manifest file

@Fleker
Copy link
Contributor

Fleker commented Mar 1, 2018

I'm not sure what else it could be. Can you post your stacktrace error?

@prasaanth-selvakumar
Copy link
Author

java.lang.RuntimeException: Unable to create service com.example.acer.integrated.GpsService: java.lang.SecurityException: Caller lacks required permission com.google.android.things.permission.MANAGE_GPS_DRIVERS

@prasaanth-selvakumar
Copy link
Author

I'm getting this line in the error, but I have included that line in the manifest file, I.m sorry I don't know how to post the stacktrace error

@Fleker
Copy link
Contributor

Fleker commented Mar 1, 2018

Can you post the contents of your manifest file? The permission tag may be in the wrong spot.

@prasaanth-selvakumar
Copy link
Author







    <activity android:name=".MainActivity">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.IOT_LAUNCHER" />
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <!--
         The API key for Google Maps-based APIs is defined as a string resource.
         (See the file "res/values/google_maps_api.xml").
         Note that the API key is linked to the encryption key used to sign the APK.
         You need a different API key for each encryption key, including the release key that is used to
         sign the APK for publishing.
         You can define the keys for the debug and release targets in src/debug/ and src/release/. 
    -->
    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="@string/google_maps_key" />

    <activity
        android:name=".MapsActivity"
        android:label="@string/title_activity_maps"></activity>
    <service android:name=".GpsService"
        android:enabled="true"
        />
</application>

@prasaanth-selvakumar
Copy link
Author

image

@Fleker
Copy link
Contributor

Fleker commented Mar 1, 2018

So you have done the following, in this order:

  • Added the permission to your app
  • Installed/ran the app on your device
  • Rebooted the device
  • Reran the app on your device

And you're still seeing a security issue? What developer preview is running on the device, and what device is it?

@prasaanth-selvakumar
Copy link
Author

It worked, after I rebooted it, sorry and thank you, is there any way to do it without a reboot ??
it is 6

@Fleker
Copy link
Contributor

Fleker commented Mar 1, 2018

At the moment rebooting is the current way to solve this while in development mode.

@prasaanth-selvakumar
Copy link
Author

I tried connecting a GPS via USB, to the Pi. and I checked the available UART ports
onCreate: [MINIUART, UART0, USB1-1.5:1.0]
these were the available UART ports.
So I tried registering the third UART port as the NMEAGPSDriver's UART port("USB1-1.5:1.0"),
It returned a buffer overflow exception. Can I solve this somehow?

@prasaanth-selvakumar
Copy link
Author

03-27 07:23:14.741 2072-2072/? I/main: type=1400 audit(0.0:190): avc: denied { write } for name="trace_marker" dev="tracefs" ino=47 scontext=u:r:zygote:s0 tcontext=u:object_r:debugfs_tracing:s0 tclass=file permissive=1
03-27 07:23:14.751 2072-2072/? I/main: type=1400 audit(0.0:191): avc: denied { open } for path="/sys/kernel/debug/tracing/trace_marker" dev="tracefs" ino=47 scontext=u:r:zygote:s0 tcontext=u:object_r:debugfs_tracing:s0 tclass=file permissive=1
03-27 07:23:14.807 2072-2072/? I/zygote: Late-enabling -Xcheck:jni
03-27 07:23:15.329 2072-2072/com.example.acer.uart I/InstantRun: starting instant run server: is main process
03-27 07:23:15.571 2072-2072/com.example.acer.uart D/ContentValues: onCreate: [MINIUART, UART0, USB1-1.5:1.0]
03-27 07:23:15.748 2072-2072/com.example.acer.uart D/vndksupport: Loading /vendor/lib/hw/[email protected] from current namespace instead of sphal namespace.
03-27 07:23:16.089 2072-2072/com.example.acer.uart W/NmeaParser: Checksum missing from incoming message
03-27 07:23:16.133 2072-2072/com.example.acer.uart W/NmeaParser: Checksum missing from incoming message
03-27 07:23:16.133 2072-2072/com.example.acer.uart I/chatty: uid=10030(com.example.acer.uart) identical 2 lines
03-27 07:23:16.133 2072-2072/com.example.acer.uart W/NmeaParser: Checksum missing from incoming message
03-27 07:23:17.007 2072-2072/com.example.acer.uart D/AndroidRuntime: Shutting down VM
03-27 07:23:17.016 2072-2072/com.example.acer.uart E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.acer.uart, PID: 2072
java.lang.IllegalArgumentException: Invalid ASCII hex byte
at com.google.android.things.contrib.driver.gps.NmeaParser.getHexDigit(NmeaParser.java:424)
at com.google.android.things.contrib.driver.gps.NmeaParser.convertAsciiByte(NmeaParser.java:408)
at com.google.android.things.contrib.driver.gps.NmeaParser.validateChecksum(NmeaParser.java:122)
at com.google.android.things.contrib.driver.gps.NmeaParser.processMessageFrame(NmeaParser.java:75)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.handleFrameEnd(NmeaGpsModule.java:207)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.processBuffer(NmeaGpsModule.java:176)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.readUartBuffer(NmeaGpsModule.java:161)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.access$000(NmeaGpsModule.java:35)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule$1.onUartDeviceDataAvailable(NmeaGpsModule.java:139)
at com.google.android.things.pio.UartDeviceImpl$UartDeviceCallbackDispatch.dispatchInterruptEvent(UartDeviceImpl.java:250)
at com.google.android.things.pio.CallbackDispatch.onFileDescriptorEvents(CallbackDispatch.java:149)
at android.os.MessageQueue.dispatchEvents(MessageQueue.java:284)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:325)
at android.os.Looper.loop(Looper.java:142)
at android.app.ActivityThread.main(ActivityThread.java:6494)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
03-27 07:23:17.031 2072-2072/com.example.acer.uart I/Process: Sending signal. PID: 2072 SIG: 9
a

@Fleker
Copy link
Contributor

Fleker commented Mar 27, 2018

This is an unrelated issue relating to the usage of the driver.

java.lang.IllegalArgumentException: Invalid ASCII hex byte

@prasaanth-selvakumar
Copy link
Author

Do you have any idea what might be going wrong?/

@Fleker
Copy link
Contributor

Fleker commented Mar 28, 2018

I'm not sure immediately what's going on. What GPS module are you connecting? Is it an NmeaGpsModule?

@prasaanth-selvakumar
Copy link
Author

Yeah it is an NMEA Gps module , it connects via the USB

@Fleker
Copy link
Contributor

Fleker commented Mar 29, 2018

You may need to take a look at what bytes are being sent and log that to see if there's something happening there.

@prasaanth-selvakumar
Copy link
Author

What all NMEA 2.0 sentences does this driver use to figure out the location?
($GPRMC , $GPRMB... etc )

@devunwired devunwired self-assigned this Jun 19, 2018
@devunwired
Copy link
Contributor

Are you still experiencing issues with your GPS module? If so, please provide a link to the datasheet of the device you are using. The stack trace provided indicates it's not sending properly encoded NMEA data (or additional data the driver doesn't recognize).

@prasaanth-selvakumar
Copy link
Author

NO, I'm not facing the issue now, I was using a neo-8M GPS Module. But I think the driver was written for neo-6M GPS modules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants