I have GPS, SONAR and two BLDC motors connected. I have to send data to my PC. I have radio-link. How can I send this data?

ericgibbs

Joined Jan 29, 2010
18,875
Serial.println(GPSmessage); // Use to Check raw message

Serial.print(GPSmessage); // Use to Check raw message


Or here.
Serial.println(GPSmessage.substring(31,42));
 

ericgibbs

Joined Jan 29, 2010
18,875
hi,
You are using the Depth print routine with a Function Call and also as an Event Call.

So you will get mixed Serial.print Depth messages.

The way the program is constructed is really awful!!

E

BTW: When surveying you should record every depth sounding taken between position fixes.
 

Attachments

Thread Starter

umerrai1

Joined Mar 29, 2021
246
I am getting data in this form as shown in the picture (GPS_Data). I am receiving three messages (GGA, VTG, ZDA) from GPS. I want to receive them one by one.
Like:
GGA
VTG
ZDA
The second picture (GPS_Data_TeraTerm) shows data of GPS I am getting directly from the serial port.
 

Attachments

ericgibbs

Joined Jan 29, 2010
18,875
hi,
You will have to add ID's for each message you want to display.
Example.
E
//--------------------------------------------------------------------------------------------------------------
void PrintGPS(void)
{
if (msgEOL) {
// Serial.println(GPSmessage); // Use to Check raw message
strID1=(GPSmessage.substring(4,6));
if (strID1 == "GG"){
Serial.print("$");
Serial.print(GPSmessage.substring(8,14));
Serial.print(",N");
Serial.print(GPSmessage.substring(18,28));
Serial.print(",E");
Serial.println(GPSmessage.substring(31,42));
}
GPSmessage = "";
strID1="";
msgEOL = false;
}

if (msgEOL) {
// Serial.println(GPSmessage); // Use to Check raw message
strID2=(GPSmessage.substring(4,6));
if (strID2 == "TG"){
Serial.print("$");
Serial.print(GPSmessage.substring(8,14)); // You will have to modify these substrings
Serial.print(",N");
Serial.print(GPSmessage.substring(18,28));
Serial.print(",E");
Serial.println(GPSmessage.substring(31,42));
}
GPSmessage = "";
strID2="";
msgEOL = false;
}

//--------------------------------------------------------------------------------------------------------------
 

ericgibbs

Joined Jan 29, 2010
18,875
hi,
If you want to use the same substring pair, it should be if (strID2 == "VT"){

ie: strID1=(GPSmessage.substring(4,6));

VT, GS,GL, RM etc.
 

Thread Starter

umerrai1

Joined Mar 29, 2021
246
I made a program according to your suggestions. But still, I am not getting messages in synchronized form. The screenshot is attached also the program is attached.
 

Attachments

ericgibbs

Joined Jan 29, 2010
18,875
Hi ume,
Regarding your survey and boat control project.

1. Why do you require all the 6 GPS messages to be displayed.?

2. In a marine survey it is usual to record echo soundings at about 10 sounds/second , in water depths down to about 70 metres

3. I would suggest if, possible, to increase the Baud rates from 4800 to 9600, this will give more time for depth data soundings.

4. If you have a design specification for the project, could you please post a copy, so that I can understand what you are trying to achieve.


E
 
Top