4 emisores nrf24l01 a un receptor

Hola a todos, después de leer un montón, probar muchísimos sketch, librerías y demás, y no encontrar lo que busco, os pregunto a los entendidos si hay alguna manera de hacer lo que os voy a exponer.

Dispongo de un arduino DUE, que es el receptor y 4 arduinos nano que son los emisores, en cada nano tengo un nrf24l01 para que pueda comunicarse con el receptor, si he conseguido que se comunique pero no los 4 a la vez.

Os pongo el código ultimo que he probado a ver si alguno de vosotros me puede orientar.
De momento solo tengo 3 puestos

Emisor1

/*
 * Getting Started example sketch for nRF24L01+ radios
 * This is a very basic example of how to send data from one node to another
 * Updated: Dec 2014 by TMRh20
 */

#include <SPI.h>
#include "RF24.h"
/****************** User Config ***************************/
/* Hardware configuration: Set up nRF24L01 radio on SPI bus plus pins 7 & 8 */
RF24 radio(7,8);
/**********************************************************/
byte addresses[][6] = {"1Node","2Node","3Node","4Node"};
// Used to control whether this node is sending or receiving

struct LECTURA {
    byte id;
    byte angulo;
};

void setup() {
  Serial.begin(57600);
  Serial.println(F("Emisor 1"));
  radio.begin();
  // Set the PA Level low to prevent power supply related issues since this is a
  // getting_started sketch, and the likelihood of close proximity of the devices. RF24_PA_MAX is default.
  radio.setPALevel(RF24_PA_LOW);
  radio.setChannel (120);
  // Open a writing and reading pipe on each radio, with opposite addresses
  radio.openWritingPipe(addresses[0]);
}

void loop() {
  LECTURA enviar;
  enviar.id=1;
  enviar.angulo=10;
  
  Serial.println(F("Enviando 1..."));
  if (!radio.write( &enviar, sizeof(LECTURA) )){
    Serial.println(F("fallo al enviar"));
  }
  delay(1000);
} // Loop

Emisor2

/*
 * Getting Started example sketch for nRF24L01+ radios
 * This is a very basic example of how to send data from one node to another
 * Updated: Dec 2014 by TMRh20
 */

#include <SPI.h>
#include "RF24.h"
/****************** User Config ***************************/
/* Hardware configuration: Set up nRF24L01 radio on SPI bus plus pins 7 & 8 */
RF24 radio(7,8);
/**********************************************************/
byte addresses[][6] = {"1Node","2Node","3Node","4Node"};
// Used to control whether this node is sending or receiving

struct LECTURA {
    byte id;
    byte angulo;
};

void setup() {
  Serial.begin(57600);
  Serial.println(F("Emisor 2"));
  radio.begin();
  // Set the PA Level low to prevent power supply related issues since this is a
  // getting_started sketch, and the likelihood of close proximity of the devices. RF24_PA_MAX is default.
  radio.setPALevel(RF24_PA_LOW);
  radio.setChannel(121);
  // Open a writing and reading pipe on each radio, with opposite addresses
  radio.openWritingPipe(addresses[0]);
}
void loop() {
    LECTURA enviar;
    enviar.id=2;
    enviar.angulo=20;
   
    Serial.println(F("Enviando 2..."));
    if (!radio.write( &enviar, sizeof(LECTURA) )){
      Serial.println(F("fallo al enviar"));
    }
    delay(1000);
} // Loop

Emisor3

/*
 * Getting Started example sketch for nRF24L01+ radios
 * This is a very basic example of how to send data from one node to another
 * Updated: Dec 2014 by TMRh20
 */

#include <SPI.h>
#include "RF24.h"
/****************** User Config ***************************/
/* Hardware configuration: Set up nRF24L01 radio on SPI bus plus pins 7 & 8 */
RF24 radio(7,8);
/**********************************************************/
byte addresses[][6] = {"1Node","2Node","3Node","4Node"};

struct LECTURA {
    byte id;
    byte angulo;
};

void setup() {
  Serial.begin(57600);
  Serial.println(F("Emisor 3"));
  radio.begin();
  // Set the PA Level low to prevent power supply related issues since this is a
  // getting_started sketch, and the likelihood of close proximity of the devices. RF24_PA_MAX is default.
  radio.setPALevel(RF24_PA_LOW);
  radio.setChannel (122);
  
  // Open a writing and reading pipe on each radio, with opposite addresses
  radio.openWritingPipe(addresses[0]);
  
}
void loop() {
    LECTURA enviar;
    enviar.id=3;
    enviar.angulo=30;
  
    Serial.println(F("Enviando 3..."));
    if (!radio.write( &enviar, sizeof(LECTURA) )){
      Serial.println(F("fallo al enviar"));
    }
    delay(1000);
} // Loop

Receptor

//Lee de 3 sensores distintos, cada uno debe enviar un byte con su id (1 2 3) en ASCII
#include <SPI.h>
#include "RF24.h"

/****************** User Config ***************************/
/* Hardware configuration: Set up nRF24L01 radio on SPI bus plus pins 7 & 8 */
RF24 radio(7,8);
/**********************************************************/
byte addresses[][6] = {"1Node","2Node","3Node","4Node"};

struct LECTURA {
    byte id;
    byte angulo;
};

void setup() {
  Serial.begin(57600);
  radio.begin();
  // Set the PA Level low to prevent power supply related issues since this is a
  radio.setPALevel(RF24_PA_LOW);
  // getting_started sketch, and the likelihood of close proximity of the devices. RF24_PA_MAX is default.
}

void loop() {
  LECTURA recibido;
  uint8_t canal=0;
  
  for (canal=120;canal < 123;canal++){
    radio.setChannel (canal);
    radio.openReadingPipe(1,addresses[0]);
    radio.startListening();
  
    Serial.print("Leyendo en canal "); Serial.print(canal); Serial.println();
    if( radio.available()){
      radio.read( &recibido, sizeof(LECTURA) ); // Get the payload
      Serial.print("Recibido id "); Serial.print(recibido.id); Serial.print("Recibido angulo "); Serial.print(recibido.angulo); Serial.println();     
    }
    radio.stopListening(); // First, stop listening so we can talk
  }
  delay (300);
} // Loop

Quizá haya alguna manera mejor de hacerlo, solo necesito que cada emisor envié al receptor 4 variables diferentes.

Un saludo.

Prueba con las librerías que expliqué en esa guía: http://forum.arduino.cc/index.php?topic=325087.0

Muchas gracias GEPD, lo probare a ver si lo consigo, ya te contare.

Un saludo.

He estado mirando toda la guía y el problema es que no se como separar los datos de diferente emisores, con un emisor no tengo ningún problema funciona perfectamente, pero cuando intento poner mas de uno la cosa se complica, ya que se mezclan los datos, supongo es por que no lo hago bien.
Y no encuentro ningún ejemplo que lo haga con varios emisores para poder hacerme una idea.

Un saludo.

En el mismo ejemplo del "Master" aparece una forma de poder separar la información que llega para eso hace uso de un switch case:

switch(header.type){
  // Display the incoming millis() values from the sensor nodes
  case 'M': network.read(header,&dat,sizeof(dat)); Serial.println(dat); break;
  default: network.read(header,0,0); Serial.println(header.type);break;
}

y en el Nodo envías la información de este modo

if (!mesh.write(&displayTimer, 'M', sizeof(displayTimer))) {

Si cambias esa "M" podrás luego en el master saber que es lo que estás recibiendo. En un nodo envía A en otro B y otro C, luego en el master solo tienes que agregar más casos al switch

switch(header.type){
  case 'A': network.read(header,&dat,sizeof(dat));
  	// Acciones en caso A
  	break;
  case 'B': network.read(header,&dat,sizeof(dat));
  	// Acciones en caso B
  	break;
  case 'C': network.read(header,&dat,sizeof(dat)); 
  	// Acciones en caso C
  	break;
  default: network.read(header,0,0);
  	Serial.println(header.type);
  	break;
}

Creele esta librería es muy buena, ya probé varias, pero esta que te dice gepd es más estable, lo único q quiero.saber es cual es la dirección de cada emisor y llamarla en el receptor

stazlad, fíjate en la linea (83):

if (mesh.addrList[i].nodeID == 1) {

En el ejemplo RF24Mesh_Example_Master_To_Nodes, el 1 corresponde al ID del nodo

Muchísimas gracias GEPD, lo probare y te cuento, gracias también stazlad por el apoyo.

Un saludo.

Hola GEPD, parece que funciona perfectamente, pero la recepción osea en el receptor no hace leer de A, B y C, si no que lee sin control, puede leer 10 veces la C y una la B, luego 5 de nuevo la C y 2 de la A, esto podria hacerse para que lo hiciera en orden?

Pongo el codigo de uno de los emisores y del receptor

Emisor1

/** RF24Mesh_Example.ino by TMRh20
 *
 * This example sketch shows how to manually configure a node via RF24Mesh, and send data to the
 * master node.
 * The nodes will refresh their network address as soon as a single write fails. This allows the
 * nodes to change position in relation to each other and the master node.
 */


#include "RF24.h"
#include "RF24Network.h"
#include "RF24Mesh.h"
#include <SPI.h>
//#include <EEPROM.h>
//#include <printf.h>


/**** Configure the nrf24l01 CE and CS pins ****/
RF24 radio(7, 8);
RF24Network network(radio);
RF24Mesh mesh(radio, network);

/**
 * User Configuration: nodeID - A unique identifier for each radio. Allows addressing
 * to change dynamically with physical changes to the mesh.
 *
 * In this example, configuration takes place below, prior to uploading the sketch to the device
 * A unique value from 1-255 must be configured for each node.
 * This will be stored in EEPROM on AVR devices, so remains persistent between further uploads, loss of power, etc.
 *
 **/
#define nodeID 1


uint32_t displayTimer = 0;

struct payload_t {
  unsigned long ms;
  unsigned long counter;
};

void setup() {

  Serial.begin(115200);
  //printf_begin();
  // Set the nodeID manually
  mesh.setNodeID(nodeID);
  // Connect to the mesh
  Serial.println(F("Connecting to the mesh..."));
  mesh.begin();
}



void loop() {

  mesh.update();

  // Send to the master node every second
  if (millis() - displayTimer >= 1000) {
    displayTimer = millis();

    // Send an 'M' type message containing the current millis()
    if (!mesh.write(&displayTimer, 'A', sizeof(displayTimer))) {

      // If a write fails, check connectivity to the mesh network
      if ( ! mesh.checkConnection() ) {
        //refresh the network address
        Serial.println("Renewing Address");
        mesh.renewAddress();
      } else {
        Serial.println("Send fail, Test OK");
      }
    } else {
      Serial.print("Send OK: "); Serial.println(displayTimer);
    }
  }

  while (network.available()) {
    RF24NetworkHeader header;
    payload_t payload;
    network.read(header, &payload, sizeof(payload));
    Serial.print("Received packet #");
    Serial.print(payload.counter);
    Serial.print(" at ");
    Serial.println(payload.ms);
  }
}

Receptor

 /** RF24Mesh_Example_Master.ino by TMRh20
  * 
  *
  * This example sketch shows how to manually configure a node via RF24Mesh as a master node, which
  * will receive all data from sensor nodes.
  *
  * The nodes can change physical or logical position in the network, and reconnect through different
  * routing nodes as required. The master node manages the address assignments for the individual nodes
  * in a manner similar to DHCP.
  *
  */
  
  
#include "RF24Network.h"
#include "RF24.h"
#include "RF24Mesh.h"
#include <SPI.h>
//Include eeprom.h for AVR (Uno, Nano) etc. except ATTiny
//#include <EEPROM.h>

/***** Configure the chosen CE,CS pins *****/
RF24 radio(7,8);
RF24Network network(radio);
RF24Mesh mesh(radio,network);

uint32_t displayTimer = 0;

void setup() {
  Serial.begin(115200);

  // Set the nodeID to 0 for the master node
  mesh.setNodeID(0);
  Serial.println(mesh.getNodeID());
  // Connect to the mesh
  mesh.begin();

}


void loop() {    

  // Call mesh.update to keep the network updated
  mesh.update();
  
  // In addition, keep the 'DHCP service' running on the master node so addresses will
  // be assigned to the sensor nodes
  mesh.DHCP();
  
  
  // Check for incoming data from the sensors
  if(network.available()){
    RF24NetworkHeader header;
    network.peek(header);
    
    uint32_t dat=0;        
    switch(header.type){
      // Display the incoming millis() values from the sensor nodes
    case 'A':
      network.read(header,&dat,sizeof(dat));
      Serial.print("Caso envio, A "); Serial.println(dat);
      break;
    case 'B':
      network.read(header,&dat,sizeof(dat));
      Serial.print("Caso envio, B "); Serial.println(dat);
      break;
    case 'C':
      network.read(header,&dat,sizeof(dat));
      Serial.print("Caso envio, C "); Serial.println(dat);
      break;
    case 'D':
      network.read(header,&dat,sizeof(dat)); Serial.println(dat);
      Serial.print("Caso envio, D ");
      break;
    case 'E':
      network.read(header,&dat,sizeof(dat)); Serial.println(dat);
      Serial.print("Caso envio, E ");
      break;
      
    default:
      Serial.println("Caso por defecto");
      network.read(header,0,0);
      Serial.println(header.type);
      break;
    }
  }
  
  if(millis() - displayTimer > 5000){
    displayTimer = millis();
    Serial.println(" ");
    Serial.println(F("********Assigned Addresses********"));
     for(int i=0; i<mesh.addrListTop; i++){
       Serial.print("NodeID: ");
       Serial.print(mesh.addrList[i].nodeID);
       Serial.print(" RF24Network Address: 0");
       Serial.println(mesh.addrList[i].address,OCT);
     }
    Serial.println(F("**********************************"));
  }
}

Un saludo.

Se me olvidaba ademas en cada emisor tengo que enviar 5 variables con dos decimales, como puedo hacerlo para que tampoco se mezclen los datos, uno de ellos sera la carga de la batería que creo que se puede monitorizar por software, otro de ellos sera la temperatura del sensor, a si pues seria algo así:

datos1[5]
datos2[5]
datos3[5]
datos4[5]
datos5[5]

Tampoco me hagáis mucho caso ya que estoy muy pez en esto.

Un saludo.

Según entiendo lo que quieres es recibir cierta información x cantidades de veces en un orden.

Una de las formas que lo haría sería así

switch(header.type){
  // Display the incoming millis() values from the sensor nodes
  case 'A':
    if(contador < 11){ // si el contador es menor a 11 permite la recepción de la información
      network.read(header,&dat,sizeof(dat));
      Serial.print("Caso envio, A "); Serial.println(dat);        
      contador++; // agrega uno al contador
    }
    break;
  case 'B':
    if(contador > 10 and contador < 14){ // si el contador es mayor que 10 y menor que catorce permite la recepción de la información
      network.read(header,&dat,sizeof(dat));
      Serial.print("Caso envio, B "); Serial.println(dat);
      contador++; // agrega uno al contador
    }
    break;
  case 'C':
    if(contador > 15 and contador < 21){ // otro criterio para filtrar
      network.read(header,&dat,sizeof(dat));
      Serial.print("Caso envio, C "); Serial.println(dat);
      contador++;
    }
    break;
    
  default:      
    Serial.println("Caso por defecto");
    network.read(header,0,0);
    Serial.println(header.type);
    break;
}

if(contador == 25) // si el contador ha llegado a por ejemplo 25, se resetea el conteo para comenzar nuevamente.
  contador = 0;

el contador serviría para saber la cantidad de veces que se ha recibido un valor y además para saber el orden, así evitas tener un contador para cada caso.

Al final, el contador vuelve a cero, el número 25 es el número final que te indique que has recibido todos los datos que querías.

No lo he probado pero creo que debería funcionar.

Recuerda de asignar la variable contador antes del setup();

int contador = 0;

Referente al envío de múltiple información nunca lo he probado, buscaré información y realizaré algunas pruebas para ver cuál es la forma de hacerlo, a penas sepa algo lo escribo aquí

Muchas gracias gepd, voy a probarlo y te digo.

Un saludo.

Bueno, lo he probado y no funciona, de todas maneras quizá eso no tenga importancia, lo que si he probado de que lea de los dos sensores pero parece que solo lee de uno, pongo el código a ver que te parece.

Emisor1

#include "RF24.h"
#include "RF24Network.h"
#include "RF24Mesh.h"
#include <SPI.h>
//#include <EEPROM.h>
//#include <printf.h>

//  float anguloX;
//  float anguloY;
//  float temperatura;
//  float bateria;
  float datos[4];


/**** Configure the nrf24l01 CE and CS pins ****/
RF24 radio(7, 8);
RF24Network network(radio);
RF24Mesh mesh(radio, network);

//  int anguloX = 23.33;
//  int anguloY = 25.55;
//  int temperatura = 36.36;
//  int bateria = 08.25;
  
/**
 * User Configuration: nodeID - A unique identifier for each radio. Allows addressing
 * to change dynamically with physical changes to the mesh.
 *
 * In this example, configuration takes place below, prior to uploading the sketch to the device
 * A unique value from 1-255 must be configured for each node.
 * This will be stored in EEPROM on AVR devices, so remains persistent between further uploads, loss of power, etc.
 *
 **/
#define nodeID 1


uint32_t displayTimer = 0;

struct payload_t {
  unsigned long ms;
  unsigned long counter;
};

void setup() {

  Serial.begin(115200);
  //printf_begin();
  // Set the nodeID manually
  mesh.setNodeID(nodeID);
  // Connect to the mesh
  Serial.println(F("Connecting to the mesh..."));
  mesh.begin();
}



void loop() {
  
  datos[0]=23.23;
  datos[1]=33.33;
  datos[2]=36.00;
  datos[3]=08.08;
  
  mesh.update();

  // Send to the master node every second
  if (millis() - displayTimer >= 100) {
    displayTimer = millis();

    // Send an 'M' type message containing the current millis()
    if (!mesh.write(&datos, 'M', sizeof(datos))) {

      // If a write fails, check connectivity to the mesh network
      if ( ! mesh.checkConnection() ) {
        //refresh the network address
        Serial.println("Renewing Address");
        mesh.renewAddress();
      } else {
        Serial.println("Send fail, Test OK");
      }
    } else {
      Serial.print("AngX: "); Serial.print(datos[0]); Serial.print(" AngY: "); Serial.print(datos[1]); Serial.print(" Temp: "); Serial.print(datos[2]); Serial.print(" Bat: "); Serial.println(datos[3]);
    }
  }

  while (network.available()) {
    RF24NetworkHeader header;
    payload_t payload;
    network.read(header, &payload, sizeof(payload));
    Serial.print("Received packet #");
    Serial.print(payload.counter);
    Serial.print(" at ");
    Serial.println(payload.ms);
  }
}

Emisor2

#include "RF24.h"
#include "RF24Network.h"
#include "RF24Mesh.h"
#include <SPI.h>
//#include <EEPROM.h>
//#include <printf.h>

float datos1[4];


/**** Configure the nrf24l01 CE and CS pins ****/
RF24 radio(7, 8);
RF24Network network(radio);
RF24Mesh mesh(radio, network);

/**
 * User Configuration: nodeID - A unique identifier for each radio. Allows addressing
 * to change dynamically with physical changes to the mesh.
 *
 * In this example, configuration takes place below, prior to uploading the sketch to the device
 * A unique value from 1-255 must be configured for each node.
 * This will be stored in EEPROM on AVR devices, so remains persistent between further uploads, loss of power, etc.
 *
 **/
#define nodeID 2


uint32_t displayTimer = 0;

struct payload_t {
  unsigned long ms;
  unsigned long counter;
};

void setup() {

  Serial.begin(115200);
  //printf_begin();
  // Set the nodeID manually
  mesh.setNodeID(nodeID);
  // Connect to the mesh
  Serial.println(F("Connecting to the mesh..."));
  mesh.begin();
}



void loop() {
  
  datos1[0]=20.20;
  datos1[1]=30.30;
  datos1[2]=18.08;
  datos1[3]=05.77;

  mesh.update();

  // Send to the master node every second
  if (millis() - displayTimer >= 100) {
    displayTimer = millis();

    // Send an 'M' type message containing the current millis()
    if (!mesh.write(&datos1, 'N', sizeof(datos1))) {

      // If a write fails, check connectivity to the mesh network
      if ( ! mesh.checkConnection() ) {
        //refresh the network address
        Serial.println("Renewing Address");
        mesh.renewAddress();
      } else {
        Serial.println("Send fail, Test OK");
      }
    } else {
      Serial.print("AngX: "); Serial.print(datos1[0]); Serial.print(" AngY: "); Serial.print(datos1[1]); Serial.print(" Temp: "); Serial.print(datos1[2]); Serial.print(" Bat: "); Serial.println(datos1[3]);

    }
  }

  while (network.available()) {
    RF24NetworkHeader header;
    payload_t payload;
    network.read(header, &payload, sizeof(payload));
    Serial.print("Received packet #");
    Serial.print(payload.counter);
    Serial.print(" at ");
    Serial.println(payload.ms);
  }
}

Receptor

#include "RF24Network.h"
#include "RF24.h"
#include "RF24Mesh.h"
#include <SPI.h>
//Include eeprom.h for AVR (Uno, Nano) etc. except ATTiny
//#include <EEPROM.h>

/***** Configure the chosen CE,CS pins *****/
RF24 radio(7,8);
RF24Network network(radio);
RF24Mesh mesh(radio,network);

uint32_t displayTimer = 0;

float datos[4];
float datos1[4];

//int contador = 0;

void setup() {
  Serial.begin(115200);

  // Set the nodeID to 0 for the master node
  mesh.setNodeID(0);
  Serial.println(mesh.getNodeID());
  // Connect to the mesh
  mesh.begin();

}


void loop() {    

  // Call mesh.update to keep the network updated
  mesh.update();
  
  // In addition, keep the 'DHCP service' running on the master node so addresses will
  // be assigned to the sensor nodes
  mesh.DHCP();
  
  
  // Check for incoming data from the sensors
  if(network.available()){
    RF24NetworkHeader header;
    network.peek(header);
//    Serial.print("Contador "); Serial.println(contador);
    uint32_t dat=0;        
    switch(header.type){
      // Display the incoming millis() values from the sensor nodes
    case 'M':
      //if(contador < 11){
      network.read(header,&datos,sizeof(datos));
      Serial.print("Caso envio, M "); Serial.print("AngX: "); Serial.print(datos[0]); Serial.print(" AngY: "); Serial.print(datos[1]); Serial.print(" Temp: "); Serial.print(datos[2]); Serial.print(" Bat: "); Serial.println(datos[3]);

//      contador++;
//      }
      break;
    case 'N':
      //if(contador >10 and contador < 14){
      network.read(header,&datos1,sizeof(datos1));
      Serial.print("Caso envio, N "); Serial.print("AngX: "); Serial.print(datos[0]); Serial.print(" AngY: "); Serial.print(datos[1]); Serial.print(" Temp: "); Serial.print(datos[2]); Serial.print(" Bat: "); Serial.println(datos[3]);

//      contador++;
//      }
      break;
    case 'O':
      //if(contador > 15 and contador < 21){
      network.read(header,&dat,sizeof(dat));
      Serial.print("Caso envio, O "); Serial.println(dat);
//      contador++;
//      }
      break;
    case 'P':
      //if(contador > 20 and contador < 26){
      network.read(header,&dat,sizeof(dat)); Serial.println(dat);
      Serial.print("Caso envio, P ");
//      contador++;
//      }
      break;
    case 'Q':
//      if(contador > 25 and contador < 31){
      network.read(header,&dat,sizeof(dat)); Serial.println(dat);
      Serial.print("Caso envio, Q ");
//      contador++;
//      }
      break;
      
    default:
      Serial.println("Caso por defecto");
      network.read(header,0,0);
      Serial.println(header.type);
      break;
    }
  }
//  if(contador == 30){
//    contador = 0;
//    }
  
  if(millis() - displayTimer > 5000){
    displayTimer = millis();
    Serial.println(" ");
    Serial.println(F("********Assigned Addresses********"));
     for(int i=0; i<mesh.addrListTop; i++){
       Serial.print("NodeID: ");
       Serial.print(mesh.addrList[i].nodeID);
       Serial.print(" RF24Network Address: 0");
       Serial.println(mesh.addrList[i].address,OCT);
     }
    Serial.println(F("**********************************"));
  }
}

Y una imagen del monitor serie, como puedes ver solo lee del emisor1
http://demo.chevereto.com/images/2015/11/02/wr1.jpg

Un saludo.

Hice una prueba rápida con tus dos emisores y pude recibir datos de ambos nodos utilizando el código del receptor que viene en los ejemplos.

Te recomiendo volver a probar con los códigos de ejemplo en todo los nodos para descartar que sea algo con tus módulos

Hola de nuevo, por una parte tuve un error puse las mismas variables a los dos nodos en el receptor, viendo esto he probado lo que decías y efectivamente a lo primero funciono perfectamente, pero al poco, se cambio todo, las lecturas no eran correctas, se paraba la lectura, osea no funciona como debiera.

Yo lo que creo que se mezclan los datos o los nodos y por eso no se aclaran y hay estos errores, a si que probare el Network a ver si hay mas suerte, ya que con lo que he leído y lo menos que entiendo parece ser que puedes manejar hasta 6000 nodos, yo no necesito tantos pero a ver si va mejor la cosa.

Un saludo.

Mesh debe funcionar no tengo dudas porque Tmrh20 es una librería excelente pero Network funciona perfecto.
Asi lo uso yo.
Pero si tuviera la necesidad de usar Mesh no dudaria en probarlo.

Si, es bien raro lo que te sucede, yo estoy usando Mesh con dos nodos y un master, hasta ahora no me ha dado problemas.

Faltaría que pruebes con Network, yo no la he probado, aunque sé para usar mesh se necesita de Network, por lo tanto yo lo veo como si Mesh fuese una simplificación de Network.

Muchas gracias surbyte y gepd, yo no entiendo casi nada pero como dije primero funcionaba bien y luego se cambio la cosa, los 4 sensores enviaban creo que bien pero el receptor para mi se hacia un lío, quizá el receptor tendría que pedir al emisor1 que le envíe los datos, después el emisor2, y a si sucesivamente para no tener conflictos pero al llegar todo a al vez, puede que sea eso.

Como no entiendo no puedo aseguraros nada, pero eso si lo comprobé, puede como dice gepd que con dos emisores no haya esos conflictos, pero con los cuatro la verdad que no hay manera.

También deciros que hay muchos ejemplos de un emisor y receptor, pero muy poca o nada información de múltiples emisores y una cosa que me choca que por ejemplo en domotica tendría mucha importancia el hecho de tener sensores por toda la casa inalambricos, quizá se utiliza mas el tipo con cable.

Seguimos con las pruebas, os seguiré informando.

Un saludo.

Reviendo tu consulta inicial, te comento, jamás de los jamases (o va con C) podrá un receptor recibir 4 operaciones simultáneas. Será siempre 1 a la vez, atiende 1, luego otra, etc.
Entonces para que generar colisiones?
Yo pondria el master a polear como siempre se hizo. No te darás cuenta.
No me percaté hasta ahora de tu problema, por no leer bien la consulta inicial.
Cual es la necesidad de que 4 emisores esten permanentemente enviando datos?
No es el criterior habitual.

Puedes explicarte?

Ayer mientras hacía las pruebas con las librerías también se me vino a la mente este proyecto, sobre todo porque hay formas más optimas de manejar la información. Habrá que ver por qué quiere los 4 a la vez, y también pensé que la forma de mejorarlo es.

Emisor 1 envía información, receptor avisa que llegó todo OK, emisor 1 deja de enviar.
Emisor 2 envía información, receptor avisa que llegó todo OK, emisor 2 deja de enviar.

y así...

En caso de que uno de los emisores no recibe el mensaje que llegó todo bien, puede esperar 1 segundo y re-intentarlo.