ESP8266 and Xbee frequency clash

Hello,
I am using Series 2 xbee radio and esp8266 wifi module to transmit data from a transmitter Arduino(Mega 2560). I am receiving the data at other end Xbee and arduino uno ard interfaced to display the received data on LCD. ESP8266 to monitor data from smart phone. But my xbee receives the data which is sent by ESP8266 also. Is it due to the frequency clash ?
I have attached screen shot of serial monitor in this post. Please help me to solve this.

tx.jpg

rx.jpg

Yes they both use the same frequency band. The band is also used by wi-fi.
You have to arrange a protocol so that one system ignores the messages from another. You can make up anything to do this.

I would have thought that using the Xbee in the mesh network mode would do it for one end at least.

You mean transmitter in AT mode and receiver in API mode?

sachin88:
But my xbee receives the data which is sent by ESP8266 also. Is it due to the frequency clash ?

I would be amazed if that was the reason. The most impact I can imagine is that a frequency clash might cause garbage to be received. And I think that is unlikely. Lots of devices share the 2.4GHz band without bothering each other.

IMHO it is far more likely that your program is incorrect. But you have not posted your code.

...R

IMHO it is far more likely that your program is incorrect.

Well for the record I think you are right too.
But the OP seems sure that

But my xbee receives the data which is sent by ESP8266 also.

I have attached my code. Please help me to solve the problem.

code_tx.txt (13.3 KB)

If you are having problems with wireless systems start with a program that does as little as possible - for example send and receive "Hello World" and display it on the Serial Monitor.

The program you have posted has all sorts of irrelevant and confusing stuff.

...R

sachin88:
But my xbee receives the data which is sent by ESP8266 also. Is it due to the frequency clash ?

This behaviour is definitively not caused by a 'frequency clash'.

The data you are seeing is not the data sent by the ESP via WiFi, but the responses of the ESP to its serial connection.

A 'frequency clash' would disturb or block communication, not add data to a different channel.

You would need a promiscuous WiFi device to read the ESP messages and session keys to decode them.
Then you would have to look into the TCP Stream to extract the content.