arduino uno to ethernet shield code (need help)

hi everyone, I'm working on a project, everything almost working except one thing, I have 2 devices, one with arduino fio connected to a sensors (end device), and the other is Arduino uno connected to ethernet shield (coordinator device).
the reading of the sensors should be send from arduino fio to uno, then arduino uno send it the ethernet shield so i can display the reading on my website.
arduino fio communicate with arduino uno through the xbee using digital pins 0,1 (rx,tx), and arduino uno communicate with the ethernet shield using the digital pins 10,11,12,13 (SPI).
I need a code for the uno to send the received data from fio to the ethernet shield, I believe the code will be few lines only, but the problem im not tht gud in programming and im running out of time.
I connected the sensors direct to the uno using the following code, it worked well, but i need to make it work using the fio as explained.

any help is appreciated, and thanks to u all.

#include <SPI.h>
#include <Ethernet.h>

// ethernet configuration
byte mac[] = { 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF };
byte ip[] = { 192, 168, 0, 177 }; // P1 --> { 10, 1, 1, 5 };
EthernetServer server(80); // port 80 is default for HTTP

// initial
int LED = 3; // led is connected to digital pin 3
int PIR = 2; // PIR sensor is connected to digital pin 2
int LDR = 5; // LDR sensor is connected to analog in 5
int PIRstate = 0; // variable for PIR sensor status
float photocell = 0; // variable for photocell (LDR) analog value
char c = 0; // received data
char command[2] = "\0"; // command

void setup()
{
Ethernet.begin(mac, ip);
server.begin();
pinMode(LED, OUTPUT);
pinMode(PIR, INPUT);
}

void loop()
{
EthernetClient client = server.available();
// detect if current is the first line
boolean current_line_is_first = true;

if (client) {
// an http request ends with a blank line
boolean current_line_is_blank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
// if we've gotten to the end of the line (received a newline
// character) and the line is blank, the http request has ended,
// so we can send a reply
if (c == '\n' && current_line_is_blank) {
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();

// auto reload webpage every 10 second
client.println("<META HTTP-EQUIV=REFRESH CONTENT=10 URL=>");

// webpage title
client.println("

Room Web monitoring



");

// read analog pin 1 for the value of photocell
photocell = analogRead(LDR);
client.print("

Light reading = ");
client.println(photocell, 2);
client.println("

");

// read digital pin 13 for the state of PIR sensor
PIRstate = digitalRead(2);
if (PIRstate == HIGH) { // PIR sensor detected movement
client.println("

Motion Detected!

");
}
else { // No movement is detected
client.println("

No Movement

");
}

// button functions
client.println("");
client.println("LED On");
client.println("LED Off");
client.println("
");

// webpage footer

client.println("

P.S.: This page will automatically refresh every 10 seconds.

");

break;
}
if (c == '\n') {
// we're starting a new line
current_line_is_first = false;
current_line_is_blank = true;
}
else if (c != '\r') {
// we've gotten a character on the current line
current_line_is_blank = false;
}
// get the first http request
if (current_line_is_first && c == '=') {
for (int i = 0; i < 1; i++) {
c = client.read();
command = c;

  • }*
  • // LED control*
  • if (!strcmp(command, "1")) {*
  • digitalWrite(LED, HIGH);*
  • }*
  • else if (!strcmp(command, "2")) {*
  • digitalWrite(LED, LOW);*
  • }*
  • }*
  • }*
  • }*
  • // give the web browser time to receive the data*
  • delay(1);*
  • client.stop();*
  • }*
    }
    [/quote]

I need a code for the uno to send the received data from fio to the ethernet shield

The communication between the Arduino and the Ethernet shield is handled by the EthernetServer and EthernetClient classes. You don't have to do anything except use client.print() or server.print().

You do, on the other hand, have to read the serial data that the other device is sending.