NEO-M8N No feedback

Hello,I built up the setup and tried it(From serial only). The code seems to be working but no feedback from serial.
Here is the code ;

#include <Wire.h>
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal.h>
#include <EEPROM.h>
TinyGPSPlus gps;



//EEPROM
int address = 0 ;
int kontrol ;
int addresscounter ;
int addresswrite ;

///////// Playground



//////////


//LCD
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 9, d7 = 8;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

//GPS
int RXPin = 6;
int TXPin = 7;
int GPSBaud = 9600;

SoftwareSerial gpsSerial(7, 6);

//Haversine
double Radius = 6371e3;
double lat1, lat2;
double long1, long2;
double latitude1, latitude2;
double longitude1, longitude2;
double rad;
double del_lat, del_long;
double var_a;
double var_c;
double var_d;

double c_dist1, t_dist1 = 0;
double c_dist2, t_dist2 = 0;

double lat_conv1, lat_conv2, long_conv1, long_conv2;

double curr_speed, avg_speed, pre_speed = 0, speed_counter = 1;

int count = 1;
void setup()
{
  Serial.begin(9600);
  delay(10);
  gpsSerial.begin(GPSBaud);
  lcd.begin(20, 4);
  lcd.clear();
  pinMode(2, INPUT_PULLUP); // Trip 1 Reset Button
  pinMode(3, INPUT_PULLUP); // Trip 2 Reset Button
  pinMode(10, INPUT_PULLUP); // Trip 2 hafızaya yaz
}

void loop()
{

  while (gpsSerial.available() > 0)
  {


    if (gps.encode(gpsSerial.read()))
    {
      //code here

      if (gps.location.isValid() && gps.speed.isValid())
      { delay(10);
        Serial.println(gps.satellites.value());
        if (count == 1)
        { delay(10);
          lat1 = gps.location.lat();
          long1 = gps.location.lng();
          Serial.println(lat1);
          Serial.println(long1);
          count++;
        }
        if (digitalRead(2) == 1)
        { delay(10);

          t_dist1 = 0;
        }
        if (digitalRead(3) == 1)
        { delay(10);
          lcd.setCursor(0, 5);
          lcd.print(t_dist2 = 0);
          delay(1000);
          t_dist2 = 0;
        }

        delay(10);

        curr_speed = gps.speed.kmph();

        delay(10);
        lat2 = gps.location.lat();
        long2 = gps.location.lng();

        Serial.print("lat2: ");
        Serial.println(lat2);
        Serial.print("long2: ");
        Serial.println(long2);
        delay(10);
        haversine();

        Serial.println(var_d);
        delay(10);
        c_dist1 = var_d;
        c_dist2 = var_d;

        if (c_dist1 <= 2.0)
        { delay(10);
          c_dist1 = 0;
        }
        if (c_dist1 > 2.0)
        { delay(10);
          c_dist1 = var_d;
        }

        if (c_dist2 <= 2.0)
        { delay(10);
          c_dist2 = 0;
        }
        if (c_dist2 > 2.0)
        { delay(10);
          c_dist2 = var_d;
        }

        if (curr_speed <= 2.0)
        { delay(10);
          curr_speed = 0;
        }
        if (curr_speed > 2.0)
        { delay(10);
          avg_speed = (pre_speed + curr_speed) / speed_counter;
          pre_speed  = (pre_speed + curr_speed);
          kontrol = avg_speed ;
          speed_counter++;
        }

        delay(10);
        lat1 = lat2;
        long1 = long2;

        t_dist1 = t_dist1 + c_dist1;
        t_dist2 = t_dist2 + c_dist2;
        delay(10);
        lcd.setCursor(0, 0);
        lcd.print("Trip 1: ");
        lcd.print(t_dist1, 6);
        delay(10);
        lcd.setCursor(0, 1);
        lcd.print("Trip 2: ");
        lcd.print(t_dist2, 6);
        delay(10);
        lcd.setCursor(0, 2);
        lcd.print("Speed : ");
        lcd.print(gps.speed.kmph(), 6);
        delay(10);
        lcd.setCursor(0, 3);
        lcd.print("AVG_Speed : ");
        lcd.print(avg_speed, 3);
        delay(10);
        Serial.print("Distance 1:");
        Serial.println(t_dist1);
        Serial.print("Distance 2:");
        Serial.println(t_dist2);
        delay(10);
        lcd.setCursor(0, 4);
        lcd.print("Connected Sat:");
        lcd.print(gps.satellites.value());
        delay(10);

      }

      // Button 3 pin active
      if (digitalRead(4) == 1)
      { int tripno = address ;
        EEPROM.write(address, kontrol) ;
        addresswrite = EEPROM.read(address);
        Serial.write("Older Trip" + tripno);
        Serial.write(":" + addresswrite);
        Serial.write("\n");
        delay(300);
        address++;

        if (address = 10)
        {
          address == 0 ;
        }
      }


    }
  }
  if (millis() > 5000 && gps.charsProcessed() < 10)
  {
    Serial.println("No GPS detected");
    while (true);
  }
}

Using this library bdw

http://arduiniana.org/libraries/tinygpsplus/

Thanks for the help!

If you read the "General Guidance and How to use the Forum" post at the top of the forum it points you to some advice;

  1. Tips for getting the most out of your post
    Mention which Arduino you have. Is it a Uno? Leonardo? Due? Mini? Mega? The problem might be specific to a certain model.

Ah sorry its Uno.

In which case run this code;

/*
   This is a very simple program that will read characters from the GPS and put them on the serial monitor
   If your ever having problems with a GPS (or just think you are) use this program first.

   If you get no data disaplayed on the serial monitor, the most likley cause is that you dont have the RX
   pin connected properly.

   If the data displayed on the serial terminal appears to be random text its very likley you have the GPS
   serial baud rate set incorrectly.
*/

#define GPSBAUD 9600          //this is the serial baud rate that will be used for the GPS
#define MONITORBAUD 115200    //this is the serial baud rate that will be used for the serial monitor 

#define RXPin 2               //this is the pin that the Arduino will use to receive data from the GPS
#define TXPin 3               //this is the pin that the Arduino can use to send data (commands) to the GPS

#include <SoftwareSerial.h>

SoftwareSerial GPS(7, 6);

void loop()
{
  while (GPS.available())
  {
    Serial.write(GPS.read());
  }
}


void setup()
{
  GPS.begin(GPSBAUD);
  Serial.begin(MONITORBAUD);
  Serial.println("Simple GPS Echo Starting");
}

And post what the ouput in the Serial monitor looks like.

I tried I get "?????". So is it because of the wrong baudrate? I tried 19200,38400,76800 too but still question marks

Corrupt characters, in serial monitor, are normally caused by the Serial monitor (in the Arduino IDE) being set to the wrong baud rate, you should at least have seen;

'Simple GPS Echo Starting'

Okay now I see;

18:09:25.263 → ⸮Simple GPS Echo Starting

It seems my M8N uses 9600 after all. Still, no logical feedback from my main code :confused: Only Lat & alt is corrent I think. No number of satellites or speed values(tested on open field).

If the GPS is using 9600 baud, then after the 'Simple GPS Echo Starting' there should be a series of readable characters ......... so can we see them ?

19:51:52.811 -> $GNRMC,165152.00,A,4103.06272,N,02900.31678,E,0.372,,010320,,,A6B
19:51:52.880 -> $GNVTG,,T,,M,0.372,N,0.689,K,A
3C
19:51:52.916 -> $GNGGA,165152.00,4103.06272,N,02900.31678,E,1,04,4.87,94.5,M,37.4,M,,76
19:51:52.982 -> $GNGSA,A,3,25,12,29,31,,,,,,,,,6.09,4.87,3.66
16
19:51:53.016 -> $GNGSA,A,3,,,,,,,,,,,,,6.09,4.87,3.661B
19:51:53.059 -> $GPGSV,3,1,09,02,17,045,15,05,27,082,35,12,30,124,34,21,38,213,31
75
19:51:53.117 -> $GPGSV,3,2,09,25,67,126,42,26,14,310,32,29,71,342,22,31,38,287,33*7A
19:51:53.185 -> $GPGSV,3,3,09,39,31,133,*49

goes like that

only those are defined in the library,could it be because of it?

#define _GPRMCterm “GPRMC”
#define _GPGGAterm “GPGGA”
#define _GNRMCterm “GNRMC”
#define _GNGGAterm “GNGGA”
#define _GPGSVterm “GPGSV”

saronmec:
only those are defined in the library,could it be because of it?

#define _GPRMCterm "GPRMC"
#define _GPGGAterm "GPGGA"
#define _GNRMCterm "GNRMC"
#define _GNGGAterm "GNGGA"
#define _GPGSVterm "GPGSV"

Newer versions of TinyGPS++ support both the GP and GN formats of the 2 sentences needs for a position, i.e the GGA and RMC.

Either that or use NEOGPS, it's a bit more set-up to do but it does pack a powerful punch!