esp8266 both server and client with SoftwareSerial?

I have an Arduino Uno and an ESP8266 connected to it. I want the ESP8266 to function both as server and client. I know it should be possible, because I have it running on the esp8266 based Wemos board.

However, the libraries for the Wemos board allow me to start a client and a server object, and the SoftwareSerial library for the UNO does not have that option. Essentially all it offers is the AT-commands.

I can do the AT commands to attach to the access point, give the ESP8266 its private IP number etc, no problem. Then I can either read a webpage on a server somewhere or I can access the ESP8266 as a server and read a webpage stored there.

But in one single sketch I can do one or the other and then the other option does not work any more.

These are the AT command I use:

in setup:

esp8266.begin(9600); // your esp's baud rate might be different
sendData("AT+RST\r\n",2000,DEBUG); // reset module
sendData("AT+CWMODE=3\r\n",1000,DEBUG); // configure both as access point and as station
sendData("AT+CIFSR\r\n",1000,DEBUG); // get ip address
sendData("AT+CIPMUX=1\r\n",1000,DEBUG); // configure for multiple connections
sendData("AT+CIPSERVER=1,80\r\n",1000,DEBUG); // turn on server on port 80

Then, either the remote server and the server on the esp8266 can be accessed, but not both

I start the reading of the remote with


and end the routine with


Similarly I start the server with


and finish with


What did I get wrong?

Take a look at ESP8266 Arduino Core firmware if you don't want to use AT firmware.

Thank you for your answer, but I want to use the AT commands. Unless, of course, that is impossible for some reason or another.

use WiFiEsp library. you find it in Library Manager

Jurai: thanks, that one worked.

There are a lot of libraries out there for wifi management and they differ widely in possibilities and ease of use. I did not yet know this one.