NovaTel SUPERSTAR II GPS problem

Hi, I have problem with my GPS device. I have bought it few days before and tried to make it work, but unsuccesfull. The code i use under the topic.
The only thing i recieve in serial monitor is ribbon of decimals. Example:

1202357132160001602221277664611887000000000000000080000000000000000000000000000

Datasheet for my device is: http://www.satanslilchild.com/novatel/om-20000077.pdf
Default baud rate is 9600 or 19200, depending on model. I tried both. Some ideas?

#include <string.h>
 #include <ctype.h>
 int ledPin = 13;                  // LED test pin
 int rxPin = 0;                    // RX PIN 
 int txPin = 1;                    // TX PIN
 int txPin1 = 18;
 int rxPin1 = 19;
 
 int byteGPS=-1;
 char linea[300] = "";
 char comandoGPR[7] = "$GPRMC";
 int cont=0;
 int bien=0;
 int conta=0;
 int indices[13];
 void setup() {
   pinMode(ledPin, OUTPUT);       // Initialize LED pin
   pinMode(rxPin, INPUT);
   pinMode(txPin, OUTPUT);
   pinMode(txPin1, OUTPUT);
   pinMode(rxPin1, INPUT);
   Serial.begin(9600);
   Serial1.begin(9600);
   for (int i=0;i<300;i++){       // Initialize a buffer for received data
     linea[i]=' ';
   }   
 }
 void loop() {
   digitalWrite(ledPin, HIGH);
   byteGPS=Serial1.read();         // Read a byte of the serial port
   if (byteGPS == -1) {           // See if the port is empty yet
     delay(100); 
   } else {
     // note: there is a potential buffer overflow here!
     linea[conta]=byteGPS;        // If there is serial port data, it is put in the buffer
     conta++;                      
     Serial.print(byteGPS); 
     if (byteGPS==13){            // If the received byte is = to 13, end of transmission
       // note: the actual end of transmission is <CR><LF> (i.e. 0x13 0x10)
       digitalWrite(ledPin, LOW); 
       cont=0;
       bien=0;
       // The following for loop starts at 1, because this code is clowny and the first byte is the <LF> (0x10) from the previous transmission.
       for (int i=1;i<7;i++){     // Verifies if the received command starts with $GPR
         if (linea[i]==comandoGPR[i-1]){
           bien++;
         }
       }
       if(bien==6){               // If yes, continue and process the data
         for (int i=0;i<300;i++){
           if (linea[i]==','){    // check for the position of the  "," separator
             // note: again, there is a potential buffer overflow here!
             indices[cont]=i;
             cont++;
           }
           if (linea[i]=='*'){    // ... and the "*"
             indices[12]=i;
             cont++;
           }
         }
         Serial.println("");      // ... and write to the serial port
         Serial.println("");
         Serial.println("---------------");
         for (int i=0;i<12;i++){
           switch(i){
             case 0 :Serial.print("Time in UTC (HhMmSs): ");break;
             case 1 :Serial.print("Status (A=OK,V=KO): ");break;
             case 2 :Serial.print("Latitude: ");break;
             case 3 :Serial.print("Direction (N/S): ");break;
             case 4 :Serial.print("Longitude: ");break;
             case 5 :Serial.print("Direction (E/W): ");break;
             case 6 :Serial.print("Velocity in knots: ");break;
             case 7 :Serial.print("Heading in degrees: ");break;
             case 8 :Serial.print("Date UTC (DdMmAa): ");break;
             case 9 :Serial.print("Magnetic degrees: ");break;
             case 10 :Serial.print("(E/W): ");break;
             case 11 :Serial.print("Mode: ");break;
             case 12 :Serial.print("Checksum: ");break;
           }
           for (int j=indices[i];j<(indices[i+1]-1);j++){
             Serial.print(linea[j+1]); 
           }
           Serial.println("");
         }
         Serial.println("---------------");
       }
       conta=0;                    // Reset the buffer
       for (int i=0;i<300;i++){    //  
         linea[i]=' ';             
       }                 
     }
   }
 }
     Serial.print(byteGPS);

This prints the ASCII representation of that number (a string) to the serial interface. What you probably wanted was this:

Serial.write((uint8_t)byteGPS);

You should restructure your code. Reading from the serial interface without calling Serial.available() before to check if there is anything to read is bad practice. Your code should look more like this:

while (Serial.available()) {
  byte byteGPS = Serial.read();
  // do what you want to do with it
}

In this case you don't have to check for -1 (you cannot because the value is stored in an unsigned variable), you know that there is a vaild byte to read.

Thanks for fast reply, and sorry for my lag. I've changed the code, so it is as simple as possible.

What I code:

void loop() {
  while (Serial1.available()) {
    byte byteGPS = Serial1.read();
    Serial.println((uint8_t)byteGPS);
  }
}

What I get:

0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
8
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
128
0
66
184
51
53
7
1
20
235
71
32
11
0
0
0
96
164
254
7
64
6
1
188
7

And i do not understand why am i still getting such strange numbers. It even don't fit to ASCII - there is no character under 255.

My second code snippet uses the write() method but you're using the println() method. Did you notice that difference? That's probably why you're surprised.

And i do not understand why am i still getting such strange numbers. It even don't fit to ASCII - there is no character under 255.

All of them are below 255. You might have to explain what you mean by this sentence.

I've just compiled te code and uploaded to my Mega.
With

void setup()
{
  Serial.begin(9600);                       // PC serial
  Serial.println("Welcome, Master Steve!");
  Serial1.begin(9600); 
}
void loop() {
  while (Serial1.available()) {
    byte byteGPS = Serial1.read();
    Serial.write((uint8_t)byteGPS);
  }
}

I get some characters but still they don't make sense. The code is the simplest i can write.
Println instead of write - my fault, now it's corrected.

From section 3.4.2 of the datasheet:

COM1 and COM2 support communication using the binary protocol. Through specific binary messages, the ports are re-configurable to communicate with NovAtel’s PC-based user-interface StarView software (for
extensive monitoring of SV tracking, measurements and navigation status).

Is it possible that your module is in the binary mode?

Have you tried to pull GPIO7 to GND and change the baud rate to 4800? (section 3.5 of the datasheet)