Setting up Wireless Temp/Humid sensor network

Hello everyone,

I am making a project where i have two arduino duemilanove boards. One acting as a server connected to a nrf24l01 transciever (ce= 9, csn=8) and the other acting as a client connected to a nrf24l01 transciever (ce= 9 , csn=8) and a dht11 temp/humid sensor. My goal is to gather data on the client end and transmit it to the server. Then display the data on the server port monitor i.e values of temperature and humidity that is detected by the client arduino. The second step of the project is to reduce power consumption by the client and make it run on 3v batteries . I am stuck on the phase where i need to display the data recieved from the client end on the server port monitor. Below is the code for my client. Can anyone help me with the server code. as to what i need to do in order to get the server monitor display the humidity and temperature values. thank you

//client
#include <SPI.h>
#include <Mirf.h>
#include <nRF24L01.h>
#include <MirfHardwareSpiDriver.h>
#include "DHT.h"
#define DHTPIN 4
#define DHTTYPE DHT11 
DHT dht(DHTPIN, DHTTYPE);
int powerpin = 5;
int datapin = 4;
int gndpin = 2;
void setup(){
 Serial.begin(9600); 
 digitalWrite(powerpin, HIGH);
 digitalWrite(gndpin, LOW);
 pinMode(gndpin, OUTPUT);
 pinMode(powerpin, OUTPUT);
 pinMode(datapin, INPUT);
  Serial.println("DHT11 Gathering information!");
  dht.begin();
  Mirf.csnPin = 8;
  Mirf.cePin = 9;
  Mirf.spi = &MirfHardwareSpi;
  Mirf.init();
  Mirf.setRADDR((byte *)"Clynt");
  Mirf.setTADDR((byte *)"Servr");
  Mirf.payload = sizeof(unsigned long);
  Mirf.config();
  Serial.println("Beginning ... "); 
}
void loop()               
{
  float h = dht.readHumidity();
  float t = dht.readTemperature();
  if (isnan(t) || isnan(h)) {
    Serial.println("Failed to read from DHT");
  } else {
    Serial.print("Humidity: "); 
    Serial.print(h);
    Serial.print(" %\t");
    Serial.print("Temperature: "); 
    Serial.print(t);
    Serial.println(" *C");
  }
  
  Mirf.send((byte *) &h);
  Mirf.send((byte *) &t);
  while(Mirf.isSending()){
  }
  Serial.println("Finished sending");
  delay(5000);
}

I see you're using the Mirf library. I'm not familiar with it, but I'm sure it comes with examples showing how to send and receive messages. You server will need to receive messages and print them to the hardware serial port, which will result in them being sent to the PC where the serial monitor can display them.

I got it to work . I can receive the data and print it on my serial port monitor on the server end. I also used jeelib for power saving function on my client end. I want to ask about scheduling . From server end .. If i want to change the sleeptime on the client end through the server because i will be pulling the atmega328 chip from the client and solder it autonomously on another board for minimal power consumption so as it only uses required components. in that case i cannot make changes to it once i do that. Also is there a way to create a communication protocol using which i can request the voltage on the battery (3v battery attached to the client t/h sensor unit) in order to know when it needs to be changed . In short a communication protocol i can use from server end in order to request data or put the client to sleep .. or know about how much long the remote node will last.