user29142: I'm currently working on a Home Automation project where I have a Raspberry Pi on Windows IoT which communicates with multiple arduinos running on FreeRTOS (I need multi-tasking). 
At the moment the communication is through the serial port using Xbees, the Pi sends a command, and the arduino send's back a string in JSON format.
For cost optimisation reasons, I want to try to switch the Xbees with ESP8266 modules. Is it possible to get the same kind of serial communication over WIFI?Thanks.

user4143: 
Is it possible to get the same kind of serial communication over WIFI?

Not precisely, no - but TCP sockets are a similar concept.
You would be best programming the ESP8266 directly to implement a simple TCP to UART bridge firmware instead of fighting with the crummy AT firmware that comes with them. 

user10394: Its possible to do something similar, but you could reduce the cost even more and drop the Arduinos if you can get FreeRTOS to work on ESP-8266.  
These links gives you a brief guide to using the ESP8266 shield for serial over WIFI and how to program the ESP8266 directly.
https://learn.sparkfun.com/tutorials/esp8266-wifi-shield-hookup-guide
https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide
Of course you could also look at an ESP32s which is a dual core microprocessor with loads of networking stuff baked into the chip, its about £7/$8 at the moment.

29142: <p>I'm currently working on a Home Automation project where I have a Raspberry Pi on Windows IoT which communicates with multiple arduinos running on FreeRTOS (I need multi-tasking). 
At the moment the communication is through the serial port using Xbees, the Pi sends a command, and the arduino send's back a string in JSON format.</p>

<p>For cost optimisation reasons, I want to try to switch the Xbees with ESP8266 modules. Is it possible to get the same kind of serial communication over WIFI?Thanks.</p>
 4143: <blockquote>
  <p>Is it possible to get the same kind of serial communication over WIFI?</p>
</blockquote>

<p>Not precisely, no - but TCP sockets are a similar concept.</p>

<p>You would be best programming the ESP8266 directly to implement a simple TCP to UART bridge firmware instead of fighting with the crummy AT firmware that comes with them. </p>
 10394: <p>Its possible to do something similar, but you could reduce the cost even more and drop the Arduinos if you can get FreeRTOS to work on ESP-8266.  </p>

<p>These links gives you a brief guide to using the ESP8266 shield for serial over WIFI and how to program the ESP8266 directly.</p>

<p><a href="https://learn.sparkfun.com/tutorials/esp8266-wifi-shield-hookup-guide" rel="nofollow noreferrer">https://learn.sparkfun.com/tutorials/esp8266-wifi-shield-hookup-guide</a>
<a href="https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide" rel="nofollow noreferrer">https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide</a></p>

<p>Of course you could also look at an ESP32s which is a dual core microprocessor with loads of networking stuff baked into the chip, its about £7/$8 at the moment.</p>
