Hi all, I am unable to succesfully send commands to my Grove GPS (Air530)
I am working on a GPS tracking device, using:
MKR 1500 NB - Arduino MKR NB 1500 — Arduino Official Store
MKR Connector Carrier - Arduino MKR Connector Carrier (Grove compatible) — Arduino Official Store
Grove AIR530 GPS - Grove - GPS (Air530) | Seeed Studio Wiki
Some slight changes to their example code (replacing SoftSerial by Serial1), gave the desired data output.
I am however unable to send commands to the Shield (I only want the GGA Data for Example)
The command should be:
$PGKC242,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*37
Full documentation (in chinese only :/) is available for the sensor
I tried sending it via the Serial monitor, as well as addding a write command in the setup section.
unsigned char buffer[64]; // buffer array for data receive over serial port
int count=0; // counter for buffer array
void setup()
{
Serial1.begin(9600); // the Sensor Serial1 baud rate
Serial.begin(9600); // the Serial port of Arduino baud rate.
}
void loop()
{
if (Serial1.available()) // if date is coming from software serial port ==> data is coming from Serial1 shield
{
while(Serial1.available()) // reading data into char array
{
buffer[count++]=Serial1.read(); // writing data into array
if(count == 64)break;
}
Serial.write(buffer,count); // if no data transmission ends, write buffer to hardware serial port
clearBufferArray(); // call clearBufferArray function to clear the stored data from the array
count = 0; // set counter of while loop to zero
}
if (Serial.available()) // if data is available on hardware serial port ==> data is coming from PC or notebook
Serial1.write(Serial.read()); // write it to the Serial1 shield
}
void clearBufferArray() // function to clear buffer array
{
for (int i=0; i<count;i++)
{
buffer[i]=NULL;
} // clear all index of array with command NULL
}
Is there anyone with experience in sending commands over serial1, or sending commands to this shield that can help me out?
The given output is as expected, with the correct position, however need to be able to send commands as well.
Thank you for any feedback you can give.