Multiple arduino comm via xbee on multi level use

Good day!

I'll be working on multi level temperature monitoring via xbee. It will be my first time working on mesh connection.

I did peer-to-peer connection following this youtube tutorial which can pass analog and digital value without the slave having an extra controller. It was really good.

Anyway, I want to test the xbee power on a larger scale. I currently have 4 xbees--XBee PRO S2B-- connected to 3 arduino unos and 1 arduino mega because I'm out of unos. I'll be connecting ds18b20 for temperature monitoring.

I'm using XBee with Product family XBP24BZ7

I'm using this shield

The first problem I have is what should be the xbee configuration?

Right now all I changed is:

  Zigbee Coordinator API (21A7)
  PAN ID 1234
  AP 2
  Zigbee Router API (23A7)
  PAN ID 1234
  AP 2
  Zigbee Router API (23A7)
  PAN ID 1234
  AP 2
  Zigbee Router API (23A7)
  PAN ID 1234
  AP 2

Sorry I can't upload the profile. I don't know how.

This should be the setup: |500x500

xbees2,3&4 will send temp reading every 30 seconds to xbee1. Should I configure the 2 devices in room 3&4 as end devices or is it ok that xbees 2,3&4 are routers?

I want the nearest xbee from the coordinator to send temp data to the coordinator. Is this based on xbee configuration or code?

Right now I’m having problems connecting 1 router to the coordinator.
I can’t receive the message from the router.

This is the Coordinator code:

#define SOP '<'
#define EOP '>'

bool started = false;
bool ended = false;

void setup() {
  Serial.println("XBee Coordinator");

void loop(){  

void xbee_rx() {
  char inData[80];
  int index;
  while(Serial1.available() > 0) {
    char inChar =;
    if (inChar == SOP) {
      index = 0;
      inData[index] = '\0';
      started = true;
      ended = false;
    } else if (inChar == EOP) {
      ended = true;
    } else{
      if(index < 79){
        inData[index] = inChar;
        inData[index] = '\0';

  if (started && ended) {
    //float temp = atof(inData);

    // Reset for the next packet
    started = false;
    ended = false;
    index = 0;
    inData[index] = '\0';

This is the Router Code:

#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 7
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);

long previousMillis = 0;
long txInterval = 5000;
String temp_id = "40c82352";

float myTemp;
float myHighTemp;
float myLowTemp = 50;

void setup() {
  //Serial.println("XBee1 Router");
void loop() {
  unsigned long currentMillis = millis();
  if (currentMillis - previousMillis > txInterval) {
    previousMillis = currentMillis;
void readtemp() {
  sensors.requestTemperatures(); // Send the command to get temperatures
  myTemp = (sensors.getTempCByIndex(0));
void serialPrint() {
  char t[10];
  String reading;
  reading = "<" + temp_id + "," + dtostrf(myTemp, 5, 2, t) + ">";  

I’m using XBee with Product family XBP24BZ7
I’m using this shield

The RSSI is not blinking :frowning: