0

Ultimate GPS Conflict
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Ultimate GPS Conflict

by adolfhack on Fri Jan 11, 2019 2:13 pm

Dear All,
is there a conflict between Ultimate GPS chip and HC-12 wireless module ?
im having troubles using the GPS when connecting HC-12

Thank you,

adolfhack
 
Posts: 4
Joined: Wed Nov 01, 2017 6:31 am

Re: Ultimate GPS Conflict

by franklin97355 on Fri Jan 11, 2019 4:23 pm

Can you post a link to the datasheet for your HC-12 module?

franklin97355
 
Posts: 20636
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Ultimate GPS Conflict

by adolfhack on Fri Jan 11, 2019 4:27 pm


adolfhack
 
Posts: 4
Joined: Wed Nov 01, 2017 6:31 am

Re: Ultimate GPS Conflict

by adolfhack on Fri Jan 11, 2019 4:44 pm

Here is a simple sketch im testing the modules on:

Code: Select all | TOGGLE FULL SIZE
#include<SoftwareSerial.h>
String NMEA="";
char c;
int flag = 0;
String UPDATE_1_sec=  "$PMTK220,1000*1F\r\n";
String GPRMC_ONLY= "$PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0*29\r\n" ;//Send only the GPRMC Sentence
SoftwareSerial GPSSerial(3,2);
SoftwareSerial HC12(10, 11);

void setup()
{
 
  GPSSerial.begin(9600);
  delay(500);

  GPSSerial.print("$PMTK251,57600*2C"); // 57600 Baudrate
  GPSSerial.end();
  delay(500);
  GPSSerial.begin(57600);
 
  GPSSerial.print(UPDATE_1_sec);
  delay(500);
  GPSSerial.print(GPRMC_ONLY);
  delay(500);
  HC12.begin(9600);
  delay(500);

}


void loop()
{
readGPS();
if (flag==1)
  {
  NMEA.trim();
  tone(7,1000,200);
  NMEA="";
  flag=0;
  }

}



void readGPS(){
 if (GPSSerial.available()>0){
  c=GPSSerial.read();
  NMEA.concat(c);
 }
  if(c=='\r')
  {
   flag=1;
  }
}

adolfhack
 
Posts: 4
Joined: Wed Nov 01, 2017 6:31 am

Re: Ultimate GPS Conflict

by franklin97355 on Fri Jan 11, 2019 5:15 pm

If you leave GPSserial at 9600 and the update rate default does it work?

franklin97355
 
Posts: 20636
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Re: Ultimate GPS Conflict

by adolfhack on Fri Jan 11, 2019 5:19 pm

for a reason i dont know why, when i started HC-12 serial first then the gps it worked !

i mean i moved HC12.begin(9600) above and made GPSSerial.begin(9600) comes later it worked.

adolfhack
 
Posts: 4
Joined: Wed Nov 01, 2017 6:31 am

Please be positive and constructive with your questions and comments.