GPS not sending data

Hello Everyone!
I hope you all are doing well, I am stuck on a problem in my code ( attached below ). I am using a thingspeak server to receive data, All other aspects are working fine, but I can't seem to make the GPS module work ( I am using ublox Neo 6m ). I receive 0.00 for both longitude and latitude values on the thingspeak Server, but the Gps Module seems to work fine as I see the Led Indicator. In my opinion, there is a problem with the if-else statement, but I Can't Figure it out. Please Help me to get it to work!

#include <SoftwareSerial.h>
SoftwareSerial gprsSerial(2,3);
#include "EmonLib.h"                  
#include <String.h>
#include <DHT.h> 
#include <TinyGPSPlus.h>
 int Rtxp = 9;
int Txp = 8;
TinyGPSPlus Gps;
SoftwareSerial ss(Rtxp,Txp);
#define DHTPIN A0
EnergyMonitor emon1; 
DHT dht(DHTPIN, DHT11);
float Lati;
float Longi;
float h;
float t;
double Irms;
void setup()
{
  gprsSerial.begin(19200);               // the GPRS baud rate   
  Serial.begin(19200);    // the GPRS baud rate 
  dht.begin();
 emon1.current(1, 111.1); 
  delay(1000);
}
 
void loop()
{

  if (ss.available()>0 && Gps.location.isValid() ){

      Lati = Gps.location.lat();
      Longi =Gps.location.lng();
    
       h = dht.readHumidity();
      t = dht.readTemperature(); 
     Irms = emon1.calcIrms(1480);
      delay(100);    
      Serial.print("Temperature = ");
      Serial.print(t);
      Serial.println(" °C");
      Serial.print("Humidity = ");
      Serial.print(h);
      Serial.println(" %");    
      Serial.println(Irms);
      Serial.println("Ampere");
  }
  else {

        Lati = 0.00;
      Longi =0.00;
    
       h = dht.readHumidity();
      t = dht.readTemperature(); 
     Irms = emon1.calcIrms(1480);
      delay(100);    
      Serial.print("Temperature = ");
      Serial.print(t);
      Serial.println(" °C");
      Serial.print("Humidity = ");
      Serial.print(h);
      Serial.println(" %");    
      Serial.println(Irms);
      Serial.println("Ampere");
    
  }
  if (gprsSerial.available())
    Serial.write(gprsSerial.read());
 
  gprsSerial.println("AT");
  delay(1000);
 
  gprsSerial.println("AT+CPIN?");
  delay(1000);
 
  gprsSerial.println("AT+CREG?");
  delay(1000);
 
  gprsSerial.println("AT+CGATT?");
  delay(1000);
 
  gprsSerial.println("AT+CIPSHUT");
  delay(1000);
 
  gprsSerial.println("AT+CIPSTATUS");
  delay(2000);
 
  gprsSerial.println("AT+CIPMUX=0");
  delay(2000);
 
  ShowSerialData();
 
  gprsSerial.println("AT+CSTT=\"ufone.pinternet\"");//start task and setting the APN,
  delay(1000);
 
  ShowSerialData();
 
  gprsSerial.println("AT+CIICR");//bring up wireless connection
  delay(3000);
 
  ShowSerialData();
 
  gprsSerial.println("AT+CIFSR");//get local IP adress
  delay(2000);
 
  ShowSerialData();
 
  gprsSerial.println("AT+CIPSPRT=0");
  delay(3000);
 
  ShowSerialData();
  
  gprsSerial.println("AT+CIPSTART=\"TCP\",\"api.thingspeak.com\",\"80\"");//start up the connection
  delay(6000);
 
  ShowSerialData();
 
  gprsSerial.println("AT+CIPSEND");//begin send data to remote server
  delay(4000);
  ShowSerialData();
  
  String str="GET https://api.thingspeak.com/update?api_key=MG7I0XOD86XQEPXJ&field1=" + String(t) +"&field2="+String(h)+"&field3=" + String(Irms) + "&field4=" + String(Lati) +"&field5=" + String(Longi);
  Serial.println(str);
  gprsSerial.println(str);//begin send data to remote server
  
  delay(4000);
  ShowSerialData();
 
  gprsSerial.println((char)26);//sending
  delay(5000);//waitting for reply, important! the time is base on the condition of internet 
  gprsSerial.println();
 
  ShowSerialData();
 
  gprsSerial.println("AT+CIPSHUT");//close the connection
  delay(100);
  ShowSerialData();
} 
void ShowSerialData()
{
  while(gprsSerial.available()!=0)
  Serial.write(gprsSerial.read());
  delay(5000); 
  
}

You never send anything to the gps object so it has no idea what lat and lon are. Look at the library examples.

1 Like
  1. You forgot to call ss.begin()
  2. You have two SoftwareSerial ports and only one can be listening for input at a time.
  3. You forgot to read any data from 'ss' and didn't call Gps.encode() with the characters from 'ss'.
1 Like

Hello saad_abdullaj

Can the GPS receiver see satellites or only the ceiling of the apartment?

Have a great day and enjoy programming in C++ and learning.
MIND THE GAP

1 Like

ss.begin(9600) works fine for me....

1 Like

No, It is in-fact reading satellites :slight_smile:

yes!
Thank you, these are silly mistakes at my end.

Hey John! I tried to update my code , by referencing an Example code from the Tiny GPs plus library. My code is still not functional :confused: , and I think I may have encountered another problem. I have attached the code and Serial Monitor below.

#include <SoftwareSerial.h>
SoftwareSerial gprsSerial(2,3);
#include "EmonLib.h"                  
#include <String.h>
#include <DHT.h> 
#include <TinyGPSPlus.h>
 int Rtxp = 9;
int Txp = 8;
TinyGPSPlus Gps;
SoftwareSerial ss(Rtxp,Txp);
#define DHTPIN A0
EnergyMonitor emon1; 
DHT dht(DHTPIN, DHT11);
float Lati;
float Longi;
float h;
float t;
double Irms;
void setup()
{
  gprsSerial.begin(19200);        
  Serial.begin(19200); 
    ss.begin(19200); 
  dht.begin();
 emon1.current(1, 111.1); 
  delay(1000);

}
 
void loop()
{


  
 if (ss.available() >0 && Gps.encode(ss.read()) && Gps.location.isValid())
 {

      Lati = Gps.location.lat();
      Longi = Gps.location.lng();
    
       h = dht.readHumidity();
      t = dht.readTemperature(); 
     Irms = emon1.calcIrms(1480);
      delay(100);    
      Serial.print("Temperature = ");
      Serial.print(t);
      Serial.println(" °C");
      Serial.print("Humidity = ");
      Serial.print(h);
      Serial.println(" %");    
      Serial.println(Irms);
      Serial.println("Ampere");
  }
  else {

     Lati = 0.00;
     Longi =0.00; 
     h = dht.readHumidity();
     t = dht.readTemperature(); 
     Irms = emon1.calcIrms(1480);
      delay(100);    
      Serial.print("Temperature = ");
      Serial.print(t);
      Serial.println(" °C");
      Serial.print("Humidity = ");
      Serial.print(h);
      Serial.println(" %");    
      Serial.println(Irms);
      Serial.println("Ampere");
    
  }

  if (gprsSerial.available())
    Serial.write(gprsSerial.read());
 
  gprsSerial.println("AT");
  delay(1000);
 
  gprsSerial.println("AT+CPIN?");
  delay(1000);
 
  gprsSerial.println("AT+CREG?");
  delay(1000);
 
  gprsSerial.println("AT+CGATT?");
  delay(1000);
 
  gprsSerial.println("AT+CIPSHUT");
  delay(1000);
 
  gprsSerial.println("AT+CIPSTATUS");
  delay(2000);
 
  gprsSerial.println("AT+CIPMUX=0");
  delay(2000);
 
  ShowSerialData();
 
  gprsSerial.println("AT+CSTT=\"ufone.pinternet\"");//start task and setting the APN,
  delay(1000);
 
  ShowSerialData();
 
  gprsSerial.println("AT+CIICR");//bring up wireless connection
  delay(3000);
 
  ShowSerialData();
 
  gprsSerial.println("AT+CIFSR");//get local IP adress
  delay(2000);
 
  ShowSerialData();
 
  gprsSerial.println("AT+CIPSPRT=0");
  delay(3000);
 
  ShowSerialData();
  
  gprsSerial.println("AT+CIPSTART=\"TCP\",\"api.thingspeak.com\",\"80\"");//start up the connection
  delay(6000);
 
  ShowSerialData();
 
  gprsSerial.println("AT+CIPSEND");//begin send data to remote server
  delay(4000);
  ShowSerialData();
  
  String str="GET https://api.thingspeak.com/update?api_key=MG7I0XOD86XQEPXJ&field1=" + String(t) +"&field2="+String(h)+"&field3=" + String(Irms) + "&field4=" + String(Lati) +"&field5=" + String(Longi);
  Serial.println(str);
  gprsSerial.println(str);//begin send data to remote server
  
  delay(4000);
  ShowSerialData();
 
  gprsSerial.println((char)26);//sending
  delay(5000);//waitting for reply, important! the time is base on the condition of internet 
  gprsSerial.println();
 
  ShowSerialData();
 
  gprsSerial.println("AT+CIPSHUT");//close the connection
  delay(100);
  ShowSerialData();
} 
void ShowSerialData()
{
  while(gprsSerial.available()!=0)
  Serial.write(gprsSerial.read());
  delay(5000); 
  
}



Serial Monitor.

7.06
Ampere
GET https://api.thingspeak.com/update?api_key=MG7I0XOD86XQEPXJ&field1=34.10&field2=59.00&field3=7.06&field4=0.00&field5=0.00
Temperature = 34.10 °C
Humidity = 60.00 %
3.31
Ampere
GET https://api.thingspeak.com/update?api_key=MG7I0XOD86XQEPXJ&field1=34.10&field2=60.00&field3=3.31&field4=0.00&field5=0.00
Temperature = 34.20 °C
Humidity = 60.00 %
2.19
Ampere
GET https://api.thingspeak.com/update?api_key=MG7I0XOD86XQEPXJ&field1=34.20&field2=60.00&field3=2.19&field4=0.00&field5=0.00
Temperature = nan °C
Humidity = nan %
2.06
Ampere
GET https://api.thingspeak.com/update?api_key=MG7I0XOD86XQEPXJ&field1= NAN&field2= NAN&field3=2.06&field4=0.00&field5=0.00
Temperature = nan °C
Humidity = nan %
1.93
Ampere
GET https://api.thingspeak.com/update?api_key=MG7I0XOD86XQEPXJ&field1= NAN&field2= NAN&field3=1.93&field4=0.00&field5=0.00
Temperature = nan °C
Humidity = nan %
2.01
Ampere
GET https://api.thingspeak.com/update?api_key=MG7I0XOD86XQEPXJ&field1= NAN&field2= NAN&field3=2.01&field4=0.00&field5=0.00

Looks like you are not receiving any data from either SoftwareSerial port. What I would do is set the GPS port (ss) to listen, read until a location is received or 30 seconds elapses, then tell the GPRS port (gprsSerial) to listen and try to send the messages.

#include "EmonLib.h"
//#include <String.h>
#include <DHT.h>
#include <TinyGPSPlus.h>
#include <SoftwareSerial.h>

int Rtxp = 9;
int Txp = 8;

SoftwareSerial gprsSerial(2, 3);
SoftwareSerial ss(Rtxp, Txp);

TinyGPSPlus Gps;

#define DHTPIN A0
EnergyMonitor emon1;
DHT dht(DHTPIN, DHT11);
float Lati;
float Longi;
float h;
float t;
double Irms;

void setup()
{
  Serial.begin(19200);
  
  gprsSerial.begin(19200);
  ss.begin(19200);
  
  dht.begin();
  emon1.current(1, 111.1);
  delay(1000);
}

void loop()
{
  unsigned long GPSStart = millis();

  // Set defaults in case no GPS input arrives.
  Lati = 0.0;
  Longi = 0.0;

  ss.listen();

  // Repeat for up to 30 seconds.
  while (millis() - GPSStart < 30000)
  {
    if (ss.available() && Gps.encode(ss.read()) && Gps.location.isValid())
    {
      Lati = Gps.location.lat();
      Longi = Gps.location.lng();

      Serial.print("Received location: ");
      Serial.print(Lati);
      Serial.print(", ");
      Serial.println(Longi);

      break; // Break out of 'while'
    }
  }

  h = dht.readHumidity();
  t = dht.readTemperature();
  Irms = emon1.calcIrms(1480);

  Serial.print("Temperature = ");
  Serial.print(t);
  Serial.println(" °C");
  Serial.print("Humidity = ");
  Serial.print(h);
  Serial.println(" %");
  Serial.print("Irms = ");
  Serial.println(Irms);
  Serial.println("Ampere");

  // Now try and send the data to ThinkSpeak
  gprsSerial.listen();

  if (gprsSerial.available())
    Serial.write(gprsSerial.read());

  gprsSerial.println("AT");
  delay(1000);

  gprsSerial.println("AT+CPIN?");
  delay(1000);

  gprsSerial.println("AT+CREG?");
  delay(1000);

  gprsSerial.println("AT+CGATT?");
  delay(1000);

  gprsSerial.println("AT+CIPSHUT");
  delay(1000);

  gprsSerial.println("AT+CIPSTATUS");
  delay(2000);

  gprsSerial.println("AT+CIPMUX=0");
  delay(2000);

  ShowSerialData();

  gprsSerial.println("AT+CSTT=\"ufone.pinternet\"");//start task and setting the APN,
  delay(1000);

  ShowSerialData();

  gprsSerial.println("AT+CIICR");//bring up wireless connection
  delay(3000);

  ShowSerialData();

  gprsSerial.println("AT+CIFSR");//get local IP adress
  delay(2000);

  ShowSerialData();

  gprsSerial.println("AT+CIPSPRT=0");
  delay(3000);

  ShowSerialData();

  gprsSerial.println("AT+CIPSTART=\"TCP\",\"api.thingspeak.com\",\"80\"");//start up the connection
  delay(6000);

  ShowSerialData();

  gprsSerial.println("AT+CIPSEND");//begin send data to remote server
  delay(4000);
  ShowSerialData();

  String str = "GET https://api.thingspeak.com/update?api_key=MG7I0XOD86XQEPXJ&field1=" + String(t) + "&field2=" + String(h) + "&field3=" + String(Irms) + "&field4=" + String(Lati) + "&field5=" + String(Longi);
  Serial.println(str);
  gprsSerial.println(str);//begin send data to remote server

  delay(4000);
  ShowSerialData();

  gprsSerial.println((char)26);//sending
  delay(5000);//waitting for reply, important! the time is base on the condition of internet
  gprsSerial.println();

  ShowSerialData();

  gprsSerial.println("AT+CIPSHUT");//close the connection
  delay(100);
  ShowSerialData();
}

void ShowSerialData()
{
  while (gprsSerial.available() != 0)
    Serial.write(gprsSerial.read());
  delay(5000);
}

Hey John I hope you are having a great day!
I ran the code you posted earlier, But still, the Gps module does not write the location. I have double-checked my circuits/connections and if I run the example code from the Ting Gps library it runs fine.

Serial Monitor.

Temperature = 37.90 °C
Humidity = 51.00 %
Irms = 10.03
Ampere
AT

OK
AT+CPIN?

+CPIN: READY

OK
AT+CREG?

+CREG: 2,AT+CSTT="jazzconnect.mobilinkworld.com"

OK
AT+CIICR

OK
AT+CIFSR

10.41.207.190
AT+CIPSPRT=0

OK
AT+CIPSTART="TCP","api.thingspeak.com","80"

OK

CONNECT OKAT+CIPSEND
GET https://api.thingspeak.com/update?api_key=MG7I0XOD86XQEPXJ&field1=37.90&field2=51.00&field3=10.03&field4=0.00&field5=0.00
GET https://api.thingspeak.com/update?api_key=MG7I0XOD86XQEPXJ&

SEND OK
40

CLOSED
AT+CIPSHUT

SHUT OK
Temperature = 37.50 °C
Humidity = 52.00 %
Irms = 3.60
Ampere
AT

OK
AT+CPIN?

+CPIN: READY

OK
AT+CREG?

+CREG: 2,AT+CSTT="jazzconnect.mobilinkworld.com"

OK
AT+CIICR

OK
AT+CIFSR

10.75.200.216
AT+CIPSPRT=0

OK
AT+CIPSTART="TCP","api.thingspeak.com","80"

OK

CONNECT OKAT+CIPSEND
GET https://api.thingspeak.com/update?api_key=MG7I0XOD86XQEPXJ&field1=37.50&field2=52.00&field3=3.60&field4=0.00&field5=0.00
GET https://api.thingspeak.com/update?api_key=MG7I0XOD86XQEPXJ&

Try logging the characters from the GPS to see what you are receiving:

  ss.listen();
  Serial.println("Looking for GPS input.");

  // Repeat for up to 30 seconds.
  while (millis() - GPSStart < 30000)
  {
    if (ss.available())
    {
      char GPSchar = ss.read();
      Serial.write(GPSchar);

      if (Gps.encode(ss.read()))
      {
        Serial.println("Received GPS message.");

        if (Gps.location.isValid())
        {
          Serial.println("Location is valid.");

          Lati = Gps.location.lat();
          Longi = Gps.location.lng();

          Serial.print("Received location: ");
          Serial.print(Lati);
          Serial.print(", ");
          Serial.println(Longi);

          break; // Break out of 'while'
        } // End 'if Gps.loction.isValid'
      } // End 'if Gps.encode'
    } // End 'if ss.available'
  } // End 'while millis'

Hey john, I changed the pins of the module to both the pins which are capable of analog reading, ( the ones with '~' mark)
Now I receive this
These symbols don't fully appear here, There are rows of symbols that the serial monitor keeps printing for a while.

⸮` %
Irms = 9.73
Ampere

The values of current, humidity, and temperature are still being read, but latitude and longitude are still 0.00.

Sounds like the GPS module is not set for 19200 Baud. Try different values in ss.begin(19200);. According to a Google search, 9600 is the default for a ublox Neo 6M. If the rate has been changed it can be set as low as 4800.

I did change the GPS baud rate to 9600 as you said, Now the Serial Monitor shows the NMEA Sentences, but it still forwards 0.0 in the latitude fields and longitude fields

Serial Monitor:

$GPRMC,142015.00,A,2923.55422,N,07142.22252,E,0.937,,310822,,,A7F
$GPVTG,,T,,M,0.937,N,1.735,K,A
2E
$GPGGA,142015.00,2923.55422,N,07142.22252,E,1,04,4.32,120.1,M,-39.8,M,,78
$GPGSA,A,3,03,16,07,22,,,,,,,,,4.57,4.32,1.49
0E
$GPGSV,4,1,13,01,05,208,,03,65,209,48,04,57,345,10,06,02,306,73
$GPGSV,4,2,13,07,16,256,30,08,03,166,,09,27,313,08,16,63,094,20
7D
$GPGSV,4,3,13,22,10,103,30,26,44,053,,27,11,133,20,31,11,055,0973
$GPGSV,4,4,13,39,29,245,44
49
$GPGLL,2923.55422,N,07142.22252,E,142015.00,A,A61
$GPRMC,142016.00,A,2923.55458,N,07142.22258,E,0.670,,310822,,,A
77
$GPVTG,,T,,M,0.670,N,1.240,K,A25
$GPGGA,142016.00,2923.55458,N,07142.22258,E,1,04,4.32,120.2,M,-39.8,M,,7F
$GPGSA,A,3,03,16,07,22,,,,,,,,,4.57,4.32,1.49
0E
$GPGSV,4,1,13,01,05,208,,03,65,209,48,04,57,345,09,06,02,306,7B
$GPGSV,4,2,13,07,16,256,30,08,03,166,,09,27,313,08,16,63,094,20
7D
$GPGSV,4,3,13,22,10,103,30,26,44,053,,27,11,133,20,31,11,055,08
72
$GPGSV,4,4,13,39,29,245,4449
$GPGLL,2923.55458,N,07142.22258,E,142016.00,A,A
65
$GPRMC,142017.00,A,2923.55478,N,07142.22260,E,0.552,,310822,,,A7C
$GPVTG,,T,,M,0.552,N,1.022,K,A
20
$GPGGA,142017.00,2923.55478,N,07142.22260,E,1,04,4.31,120.3,M,-39.8,M,,*75
Temperature = 34.70 °C
Humidity = 60.00 %
Irms = 1.89
Ampere
AT

Sounds like the GPS can't get a lock, which is often because you're trying to use it indoors.

1 Like

It looks like you are getting plenty of valid position messages so I don't know why the library is not reporting them. Maybe the library doesn't like something about the messages, like the line endings? Try printing the data in HEX to see what characters are arriving:

    if (ss.available())
    {
      char GPSchar = ss.read();
      Serial.write(GPSchar, HEX);
      Serial.print(' '); // Separate the bytes.
      if (GPSchar == '\n')
        Serial.println(); // Separate the lines.

Hey Bill!
I just ran the Device Example In Tiny Gps Plus Library, on the same setup and on the same place
following is the Output of the Serial Monitor:

⸮z⸮⸮⸮DeviceExample.ino
A simple demonstration of TinyGPSPlus with an attached GPS module
Testing TinyGPSPlus library v. 1.0.2
by Mikal Hart

Location: INVALID Date/Time: INVALID INVALID
Location: INVALID Date/Time: INVALID INVALID
Location: INVALID Date/Time: INVALID INVALID
Location: INVALID Date/Time: INVALID INVALID
Location: INVALID Date/Time: INVALID INVALID
Location: 29.392761,71.703704 Date/Time: 8/31/2022 14:42:02.00
Location: 29.392761,71.703704 Date/Time: 8/31/2022 14:42:02.00
Location: 29.392761,71.703704 Date/Time: 8/31/2022 14:42:02.00
Location: 29.392761,71.703704 Date/Time: 8/31/2022 14:42:02.00
Location: 29.392761,71.703704 Date/Time: 8/31/2022 14:42:02.00
Location: 29.392761,71.703704 Date/Time: 8/31/2022 14:42:02.00
Location: 29.392761,71.703704 Date/Time: 8/31/2022 14:42:02.00
Location: 29.392761,71.703697 Date/Time: 8/31/2022 14:42:03.00
Location: 29.392761,71.703697 Date/Time: 8/31/2022 14:42:03.00

What do you say?

It gives multiple errors, regarding this chunk of the code

Arduino: 1.8.13 (Windows 10), Board: "Arduino Uno"

C:\Users\NITRO\Desktop\lih\lih.ino: In function 'void loop()':

lih:53:32: error: no matching function for call to 'write(char&, int)'

   Serial.write(GPSchar, HEX);

                            ^

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,

             from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,

             from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:233,

             from sketch\lih.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:57:12: note: candidate: size_t Print::write(const char*, size_t)

 size_t write(const char *buffer, size_t size) {

        ^~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:57:12: note: conversion of argument 1 would be ill-formed:

C:\Users\NITRO\Desktop\lih\lih.ino:53:32: warning: invalid conversion from 'char' to 'const char*' [-fpermissive]

   Serial.write(GPSchar, HEX);

                            ^

In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,

             from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,

             from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:233,

             from sketch\lih.ino.cpp:1:

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:56:20: note: candidate: virtual size_t Print::write(const uint8_t*, size_t)

 virtual size_t write(const uint8_t *buffer, size_t size);

                ^~~~~

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:56:20: note: conversion of argument 1 would be ill-formed:

C:\Users\NITRO\Desktop\lih\lih.ino:53:32: warning: invalid conversion from 'char' to 'const uint8_t* {aka const unsigned char*}' [-fpermissive]

   Serial.write(GPSchar, HEX);

                            ^

Multiple libraries were found for "TinyGPSPlus.h"

Used: C:\Users\NITRO\Documents\Arduino\libraries\TinyGPSPlus

Not used: C:\Users\NITRO\Documents\Arduino\libraries\TinyGPSPlus-ESP32

exit status 1

no matching function for call to 'write(char&, int)'

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Sorry. The "HEX" works with .print() but not with .write(). Change Serial.write(GPSchar, HEX); to Serial.print((int)GPSchar, HEX);

1 Like

47 47 56 33 33 31 2C 37 32 2C 31 2C 33 2C 30 30 35 2C 39 32 2C 34 2C 35 35 2C 36 30 38 33 2A 37 A
47 47 4C 32 32 2E 36 36 2C 2C 37 34 2E 32 37 2C 2C 34 36 37 30 2C 2C 2A 33 A
24 50 4D 2C 34 36 38 30 2C 2C 39 33 35 36 33 4E 30 31 32 32 37 36 45 30 30 38 2C 31 38 32 2C 41 37 D 24 50 54 2C 54 2C 2C 2E 38 2C 2C 2E 36 2C 2C 2A 36 A
47 47 41 31 35 34 2E 30 32 32 2E 36 36 2C 2C 37 34 2E 32 37 2C 2C 2C 36 32 33 2C 30 2E 2C 2C 33 2E 2C 2C 2A 33 A
47 47 41 41 33 30 2C 36 30 2C 36 30 2C 37 2C 2C 2C 36 34 2C 2E 39 35 39 2A 41 A
47 47 56 33 31 31 2C 33 34 2C 39 2C 36 30 2C 38 30 33 32 2C 37 32 2C 37 2C 38 30 2C 33 31 35 2A 45 A
47 47 56 33 32 31 2C 39 34 2C 32 2C 34 31 2C 36 30 39 32 2C 32 30 2C 31 2C 32 2C 31 30 34 31 2A 37 A
47 47 56 33 33 31 2C 37 32 2C 31 2C 33 2C 30 30 35 2C 39 32 2C 34 2C 35 35 2C 36 30 38 33 2A 37 A
47 47 4C 32 32 2E 36 36 2C 2C 37 34 2E 32 37 2C 2C 34 36 38 30 2C 2C 2A 46 A
24 50 4D 2C 34 36 39 30 2C 2C 39 33 35 36 39 4E 30 31 32 32 38 35 45 30 31 36 2C 31 38 32 2C 41 37 D 24 50 54 2C 54 2C 2C 2E 38 2C 2C 2E 34 2C 2C 2A 46 A
47 47 41 31 35 34 2E 30 32 32 2E 36 35 2C 2C 37 34 2E 32 32 2C 2C 2C 36 31 33 2C 30 2E 2C 2C 33 2E 2C 2C 2A 38 A
47 Temperature = 34.90 °C
Humidity = 59.00 %
Irms = 1.74
Ampere

This is the output I got. I don't understand what possibly is happening wrong.