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

GPS NmeaParser & NmeaGpsModule VM Crash #106

Closed
FaznetSolutions opened this issue Jun 18, 2018 · 3 comments
Closed

GPS NmeaParser & NmeaGpsModule VM Crash #106

FaznetSolutions opened this issue Jun 18, 2018 · 3 comments
Assignees

Comments

@FaznetSolutions
Copy link

Hi,

I am using Android Things v1.0.1 on the Raspberry Pi 3 with a Adafruit Ultimate GPS Breakout v3 and getting the following after running the GPS for a few minutes:

06-18 07:30:15.677 1590-1590/com.google.android.things.contrib.driver.gps D/AndroidRuntime: Shutting down VM

--------- beginning of crash

06-18 07:30:15.685 1590-1590/com.google.android.things.contrib.driver.gps E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.google.android.things.contrib.driver.gps, PID: 1590
java.lang.ArrayIndexOutOfBoundsException: length=19; index=19
at com.google.android.things.contrib.driver.gps.NmeaParser.handleSatelliteData(NmeaParser.java:199)
at com.google.android.things.contrib.driver.gps.NmeaParser.processMessageFrame(NmeaParser.java:101)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.handleFrameEnd(NmeaGpsModule.java:206)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.processBuffer(NmeaGpsModule.java:175)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.readUartBuffer(NmeaGpsModule.java:160)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule.access$000(NmeaGpsModule.java:41)
at com.google.android.things.contrib.driver.gps.NmeaGpsModule$1.onUartDeviceDataAvailable(NmeaGpsModule.java:138)
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)
06-18 07:30:15.698 1590-1590/com.google.android.things.contrib.driver.gps I/Process: Sending signal. PID: 1590 SIG: 9

I do get the odd Invalid GSV Message logged but otherwise all messages are being received correctly and logged.

Any ideas?

Thank you,

Paul

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

This was most likely due to a parsing bug in the driver code, which will be addressed in the next release of the driver.

@FaznetSolutions
Copy link
Author

FaznetSolutions commented Jun 20, 2018

If I comment out sat.snr = parseSignal(nmea[i+3]); within:

        // Parse the satellites in this message
        for (int i = 4; i < 19; i += 4) {
            if (!nmea[i].isEmpty()) {
                Satellite sat = new Satellite();
                sat.svid = Integer.parseInt(nmea[i]);
                sat.elevation = parseTrackAngle(nmea[i+1]);
                sat.azimuth = parseTrackAngle(nmea[i+2]);

                // Next line commented out due to ArrayIndexOutOfBoundsException
//                sat.snr = parseSignal(nmea[i+3]);

then I can run it without the crash for a few hours.

@devunwired
Copy link
Contributor

v1.1 of the GPS driver fixes parsing for variable length GSV messages.

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

2 participants