I’m using a Grove Air530 GPS module. When I upload this code using the Arduino IDE it works correctly.
Code:
#include <SoftwareSerial.h>
SoftwareSerial ss;
void setup()
{
ss.begin(9600, SWSERIAL_8N1, 23, 22, false, 256); Serial.begin(9600);
}
void loop()
{
if (ss.available()) {
while (ss.available()) { Serial.write((uint8_t)ss.read()); }
}
}
And I get the correct output:
$GNGGA,220005.000,0,N,0,E,1,10,2.2,24.1,M,42.3,M,78
$GNGLL,0,N,0,E,220005.000,A,A4E
$GNGSA,A,3,13,14,17,19,30,3.3,2.2,2.5,13C
$GNGSA,A,3,10,19,27,30,46,3.3,2.2,2.5,43E
$GPGSV,3,1,12,05,12,203,10,09,328,12,15,218,13,62,139,18,06A
$GPGSV,3,2,12,14,34,052,26,15,73,251,19,17,33,092,20,19,26,126,24,068
$GPGSV,3,3,12,23,25,301,24,41,286,28,31,30,10,086,24,05F
$BDGSV,2,1,05,10,28,051,13,19,24,181,14,27,16,072,25,30,12,122,19,075
$BDGSV,2,2,05,46,36,064,25,043
$GNRMC,220005.000,A,0,N,0,E,3.19,276.28,070822,A,V0E
$GNVTG,276.28,T,M,3.19,N,5.91,K,A2C
$GNZDA,220005.000,07,08,2022,00,0040
$GPTXT,01,01,01,ANTENNA OK*35
If I upload the same code using Platformio (Adding the Arduino.h library) the serial output becomes like this:
$GNGS3,⸮b⸮⸮b⸮⸮b⸮⸮b⸮⸮bb,3.1,2.1,2.3,1⸮&H9M,3,10,19,27,30,46,<⸮,<3.⸮r⸮,2.3,⸮*
$GPG_V,3,1,1⸮,05,10,202,10,10,32?,⸮12,16,219<,13⸮b⸮⸮⸮b⸮⸮b⸮R⸮⸮
$GPGSV⸮b⸮b12,14⸮32,051,28,15,b⸮⸮⸮bb⸮⸮b⸮⸮b⸮ʂ~⸮b⸮9,28,12⸮,0%⸮
$⸮Y,3,⸮,12,>3,2⸮⸮bb⸮b⸮⸮b⸮ºb~⸮⸮bb,31,30,09,087⸮b⸮51⸮
$B⸮e⸮b⸮b⸮⸮b⸮⸮b⸮⸮~⸮⸮⸮b⸮⸮b⸮⸮b⸮⸮b⸮b⸮⸮Ⓔb⸮⸮b⸮⸮⸮b⸮⸮b⸮⸮b⸮⸮b⸮⸮⸮b⸮⸮b⸮r⸮⸮
$BDGSVb⸮b⸮⸮b⸮⸮,35,0⸮4⸮⸮R⸮⸮
⸮G
220350.000,A,4<50.⸮⸮⸮⸮b0⸮045.7⸮⸮50.00<281.<6,070822,⸮V02
$GE⸮r⸮⸮b<M,r⸮⸮b0>00,K,A:2A
$GNZDA,220350.00b⸮⸮b⸮⸮b⸮⸮⸮⸮b⸮⸮b⸮⸮R⸮
$GP⸮⸮⸮⸮b⸮⸮b⸮⸮bANTENNA O{35
$GNG⸮A,220351.000,4450.8?164,N,01045.?0957,},1⸮b⸮.1,?1.8,M,42.3,M,
I’ve tried everything I could think and google gave me nothing so now I’m here.