xbee and ethernet shield problem

Hello, me and my friends are working on a school project but we are now stucked and need help. in our project we are transferring information from sensors (gas sensor MQ6 and temprature sensor TC74) which connected to one arduino to another arduino with xbee. and from the second arduino we are sending it to HTML page in the internet.
we are using Arduino UNO, XBee 2mW and Ethernet Shield 2
we managed to comunicate between the arduinos.the data from one arduino is wrriten in the serial of the other arduino, so the xbee works. and the ethernet shield also works.
bur the problem is that we can't transfer what is wrriten on the serial to the internet.

we believe the problem is in this part of the code:

if (Serial.available()>0)
{
delay(1000);
Serial.read();
q = Serial.readString();
if (Serial.peek()== '0 ')
{
Serial.read();
t = Serial.readString();
}
if (Serial.peek()=='gas level is ')
{
Serial.read();
g = Serial.readString();
}
while (Serial.available()>0)
{Serial.read();}
}

we tried to take the data in the serial and enter it to string type variables, but for some reason it didn't work and we don't know how to fix this problem.

 if (Serial.peek()=='gas level is ')

Explanation required, please.

Please use code tags when posting code.
Please post all your code.

it suppoused to enter what is wrriten in a line, with the sentence "gas level is ", into the variable g.

Does this help at all?

i wrote
g = Serial.peek('gas level is ');
but now it says there is an error.
i'm new in all the 'arduino programming' thing :sweat_smile:

Did you click on the link I posted for you?

yes. but i'm not that good in english and in programming so i don't think i really undersood it

OK, let's analyse your snippet.

if (Serial.available()>0)
          {
            delay(1000);

If there is a character available to read, delay long enough (one second) for the input buffer to overflow many times. (it hasn't started well)

            Serial.read();
            q = Serial.readString();

Read a character from the input buffer, and instantly forget it.
Then read a String into something called q. Let's hope q is a String.

           if (Serial.peek()== '0 ')
            {
              Serial.read(); 
              t = Serial.readString();
            }

More discarding stuff.
Some idea of what you hope to achieve would be useful, and what the incoming data looks like.

i'm not that good in english

Maybe there's a section of the forum that speaks your language.

i didn't see a section in hebrew

can you please help me in what i need to write in the code so i can enter into the variable what is writen in the serial?

Some idea of what you hope to achieve would be useful, and what the incoming data looks like.

ok, my target is to send information from sensors to the internet. At first, I sent the information from the sensors to Arduino and to the serial monitor. After that I sent the information in the serial to second Arduinio (through xbee). Now the second Arduino write in the serial monitor:
" temp is 20
gas level is Normal "
Example
My problem is that I don't success to remove the information which in the serial monitor to the internet. I tried to set the values 20 and Normal into a string and send them as a string variable, but I didn't success to set them into a variable.

My problem is that I don't success to remove the information which in the serial monitor to the internet. I tried to set the values 20 and Normal into a string and send them as a string variable, but I didn't success to set them into a variable.

The data in the Serial Monitor application came FROM the Arduino. There is NO reason to be trying to read anything from the Serial port.

If the data is coming from the XBee, and contains crap you don't want, make the sender stop sending the crap!

The data is coming from the Xbee, but in the HTML page it is written again and again like:
"temp is 20gas level is Normal temp is 20gas level is Norma temp is 20gas level is Norma temp is 20gas level is Norma temp is 20gas level is Norma"
because this is how it appers on the Serial Monitor.

The data is coming from the Xbee, but in the HTML page it is written again and again like:

I'm wondering if there is some part of "POST ALL OF YOUR CODE" that is beyond your reading comprehension?

If something something that simple is beyond your reading comprehension, then why would we assume that more difficult concepts won't be? If something that simple is not beyond your reading comprehension, then why should we take any time to read and/or respond to your posts when you won't do that?