Adafruit GPS&arduino Yun ->what would be the reason?

I am not good at English :sob: :sob: :sob: :sob: :sob: :sob:

after releaseing the disconnection of device gps
'yunclient' worls well
but when I connect the gps to Arduino
'yunclient does not work at all... ㅠㅠㅠㅠㅠㅠ
what would be the reason?
Please help me
I would like to combined the two sources.

arduino yun board ...AdafruitGPS.....

Adafruit_GPS

#include <Adafruit_GPS.h>
#include <SoftwareSerial.h>

Adafruit_GPS GPS(&Serial1);
//The Arduino Leonardo board uses Serial1 to communicate via TTL (5V) serial on pins 0 (RX) and 1 (TX)
HardwareSerial mySerial = Serial1;


// Set GPSECHO to 'false' to turn off echoing the GPS data to the Serial console
// Set to 'true' if you want to debug and listen to the raw GPS sentences
#define GPSECHO  true

void setup() {
  Serial.begin(115200);
  //Serial.begin(9600);
  delay(5000);
  Serial.println("Adafruit GPS library basic test!");
  GPS.begin(9600);
  GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_1HZ);   // 1 Hz update rate
  GPS.sendCommand(PGCMD_ANTENNA);
  delay(1000);
  mySerial.println(PMTK_Q_RELEASE);
}

uint32_t timer = millis();

void loop() {
  char c = GPS.read();
  if ((c) && (GPSECHO)) {
    // Serial.write(c);
  }
  if (GPS.newNMEAreceived()) {
    if (!GPS.parse(GPS.lastNMEA()))
      return;
  }

  if (timer > millis())  timer = millis();

  if (millis() - timer > 2000) {
    timer = millis();
    //    Serial.print("Fix: "); Serial.print((int)GPS.fix);
    if (GPS.fix) {
      Serial.print("Location: ");
      Serial.print(GPS.latitude, 4); Serial.print(GPS.lat);
      Serial.print(", ");
      Serial.print(GPS.longitude, 4); Serial.println(GPS.lon);

      Serial.print("convertDegMinToDecDeg / Location: ");
      Serial.print(convertDegMinToDecDeg(GPS.latitude), 7);
      Serial.print(", ");
      Serial.println(convertDegMinToDecDeg(GPS.longitude), 7);

      Serial.print("conv_coords / Location: ");
      Serial.print(conv_coords(GPS.latitude), 8);
      Serial.print(", ");
      Serial.println(conv_coords(GPS.longitude), 8);
    }
  }
}

double convertDegMinToDecDeg (float degMin) {
  double min = 0.0;
  double decDeg = 0.0;

  //get the minutes, fmod() requires double
  min = fmod((double)degMin, 100.0);

  //rebuild coordinates in decimal degrees
  degMin = (int) ( degMin / 100 );
  decDeg = degMin + ( min / 60 );

  return decDeg;
}

float conv_coords(float in_coords) {
  float f = in_coords;
  int firsttwodigits = ((int)f) / 100;
  float nexttwodigits = f - ((float)firsttwodigits * 100.0);
  float theFinalAnswer = (float)(firsttwodigits + nexttwodigits / 60.0);
  return theFinalAnswer;
}

YunClient

#include <Bridge.h>
#include <HttpClient.h>
#include <YunClient.h>
#include <SPI.h>

YunClient client;
IPAddress server(~~~~~~~); //my ip Address<<
//74,125,227,16 google

int port = 8080;
int temp = 64;
String parametri = "";

void setup() {
  Bridge.begin();
  Serial.begin(9600);
  delay(5000);
  Serial.println("setup");
}

void loop() {
  Serial.println("loop");
  parametri = "";
  if (client.available()) {
    char c = client.read();
    Serial.print(c);
  }
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
  }
  connect();
}
void connect() {
  Serial.println("connect");
  parametri = "";
  if (client.connect(server, port))  {
    Serial.println("connected");
    delay(3000);
    parametri = "rem_temp=" + String(temp);

    client.println("POST /test?gpsid=bus1111 HTTP/1.1");
    client.print("Content-length:");
    client.println(parametri.length());
    Serial.println(parametri.length());
    Serial.println(parametri);
    client.println("Connection: Close");
    client.println("Host:19~~~~~);
    client.println("Content-Type: application/x-www-form-urlencoded");
    client.println();
    client.println(parametri);
  }
  else  {
    Serial.println("connection failed");
  }
}

Your problem is here:

haney:

//The Arduino Leonardo board uses Serial1 to communicate via TTL (5V) serial on pins 0 (RX) and 1 (TX)

HardwareSerial mySerial = Serial1;

While that is true of the Leonardo, and also the Yun, the Yun also uses Serial1 and pins 0 (RX) and 1 (TX) to talk to the Linux processor using the Bridge library. The Bridge library is required for the YunClient to work properly. You cannot use that same serial interface to talk to the GPS module and the Bridge in the same sketch, they need to have their own independent communications channels.

If you want to use both the GPS and the Bridge at the same time, you will have to move the GPS to another set of pins using SoftwareSerial (you can't move the Bridge, as that is using on-board hardware with fixed connections.) Keep in mind that the Leonardo's pin limitations mentioned on the SoftwareSerial reference page also apply to the Yun since it has the same processor.

My current project involves using two instances of SoftwareSerial and the Bridge at the same time, so it can be done. The only question is how well the GPS library will work with SoftwareSerial, but I have no experience with that library.

I am not good at English :sob: :sob: :sob: :sob: :sob: :sob:

That's OK, you got your point across. I'm sure I couldn't do the same in your native language.

ShapeShifter
Thank you so much*^^*
Thanks to the answer so I can solve the problem
The answer's in the nearest place, but I didn't find it (:D)

Adafruit_GPS GPS(&Serial1);
HardwareSerial mySerial = Serial1;
↓(change)
SoftwareSerial mySerial(8, 7);
Adafruit_GPS GPS(&mySerial);

Yes,that should do it. Good luck!