2

In the meanwhile, I bought two Raspberry Pi Ultimate GPS Hat. I thought the first GPS Hat might be broken, but both of them shows the same behaviour - the buffer received from the UART, is completely filled with 0 values (512 bytes)!

See processBuffer(byte[] buffer, int count) Method in the NmeaGpsModule class.

private void processBuffer(byte[] buffer, int count) {
    for (int i = 0; i < count; i++) {
        if (mParser.getFrameStart() == buffer[i]) {
            handleFrameStart();
        } else if (mParser.getFrameEnd() == buffer[i]) {
            handleFrameEnd();
        } else if (buffer[i] != 0){
            //Insert all other characters except '0's into the buffer
            mMessageBuffer.put(buffer[i]);
        }
    }
}

I use the GPS example with the following settings:

public static final int UART_BAUD = 9600;
public static final float ACCURACY = 2.5f; // From GPS datasheet

Any ideas? Whats wrong?

capke
  • 21
  • 1
  • Strangely I had a similar issue (all the buffer filled with 0s) when using a NEO-6M with an arduino mega. The problem turned out to be the wrong baud rate... Maybe it's worth trying other baud rates (4800, 19200, 57600, 115200) – frarugi87 Jan 27 '17 at 14:35
  • And... now I saw that you tagged it with raspberry-pi3, but the adafruit site you linked says "Does not work with the Pi 3 at this time" – frarugi87 Jan 27 '17 at 14:39
  • You are right, but on the [UART GPS sample for Android Things](https://github.com/androidthings/drivers-samples/tree/master/gps) Page the Raspberry Pi Ultimate GPS Hat is recommended. – capke Jan 27 '17 at 18:57

1 Answers1

0

Try to follow this post: UART peripherals on Android Things for Raspberry Pi 3

The console is flooding the serial with junk. Need to disable the output to clean that up.

Community
  • 1
  • 1
Distwo
  • 11,569
  • 8
  • 42
  • 65