NRF24 + Neo 6m GPS

I have a problem with the comunication betwen the NRF24 and Neo 6m GPS, i am using 2 RF antennas and 1 Neo 6m GPS, it's All conected to arduino, i need to send information betwen the antennas, the information that is recibe from the Neo 6m Gps, the problem is that the antennas send information, but its not the info that i need, someone know what is happening?

Tengo un problema con la comunicacion entre el NRF24 y el Neo 6m GPS, estoy usando dos antenas de RF y 1 Neo 6m GPS, todo esta conectado a Arduino, necesito enviar la informacion de una antena a otra, esa informacion es la que recibe el Neo 6m GPS, el problema es que si envian informacion, pero no es la que ocupo, alguien me puede ayudar?

Transmisor
////////////GPS////////////////
#include <SoftwareSerial.h>
#include <TinyGPS++.h>
///////Antena RF//////////
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

//GPS
static const int RXPin = 4, TXPin = 3;
static const uint32_t GPSBaud = 9600;
//Objeto GPS
TinyGPSPlus gps;
//Coneccion serial
SoftwareSerial ss(RXPin, TXPin);

//
#define CE_PIN 9
#define CSN_PIN 10
//Canal a transmitir
byte direccion[5] ={'c','a','n','a','l'};
//Se crea radio con RF24
RF24 radio(CE_PIN, CSN_PIN);

float datos[2];

void setup() {
Serial.begin(9600);
ss.begin(GPSBaud);
radio.begin();

radio.openWritingPipe(direccion);
}

void loop() {
datos[0]=(gps.location.lat(),6);
datos[1]=(gps.location.lng(),6);

bool ok =radio.write(datos,sizeof(datos));
while (ss.available() > 0){
gps.encode(ss.read());
if(ok)
{
Serial.print("Datos enviados: ");
Serial.print(datos[0]);
Serial.print(" G° ");

Serial.print("Long: ");
Serial.print(datos[1]);
Serial.print(" G° ");

}
else{
Serial.println("no se ha podido enviar");

}
delay(1000);
}


Receiver

////////////GPS////////////////
#include <SoftwareSerial.h>
#include <TinyGPS++.h>
///////Antena RF//////////
#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

#define CE_PIN 9
#define CSN_PIN 10
byte direccion[5] ={'c','a','n','a','l'};
RF24 radio(CE_PIN, CSN_PIN);
float datos[2];

void setup() {
radio.begin();
Serial.begin(9600);
radio.openReadingPipe(1, direccion);
radio.startListening();
}

void loop() {
uint8_t numero_canal;

if ( radio.available() )
{
radio.read(datos,sizeof(datos));

Serial.print("Latitud: " );
Serial.print(datos[0]);
Serial.print(" G° ");
Serial.print("Longitud: " );
Serial.print(datos[1]);
Serial.print(" G° ");

}
else
{
Serial.println("No hay datos de radio disponibles");
}
delay(1000);
}

valenciatel:
I have a problem with the comunication betwen the NRF24 and Neo 6m GPS, i am using 2 RF antennas and 1 Neo 6m GPS, it's All conected to arduino, i need to send information betwen the antennas, the information that is recibe from the Neo 6m Gps, the problem is that the antennas send information, but its not the info that i need, someone know what is happening?

I can't make sense of that. It reads as if you have one Arduino with an nRF24 and a Neo 6m GPS connected to it and you want to send wireless data from the nRF24 to the GPS (or vice versa).

I suspect the reality is somewhat different but you will need to explain it more clearly. The nRF24 modules are designed to communicate with another nRF24 module and each nRF24 needs to be connected to its own Arduino.

Have a look at this Simple nRF24L01+ Tutorial.

Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.

The examples are as simple as I could make them and they have worked for other Forum members. If you get stuck it will be easier to help with code that I am familiar with. Start by getting the first example to work.

...R

valenciatel:
the problem is that the antennas send information, but its not the info that i need, someone know what is happening?

I would expect you receive a six for both values, don't you?

datos[0]=(gps.location.lat(),6);
datos[1]=(gps.location.lng(),6);

Get the latitude, throw it away, take a six and store it in the array.

So the program does exactly what you told it to do.