# {ESP8266} More than one TCP Server using AT Command

Status
Not open for further replies.

#### dhruv_electro

I am using AT Commands for ESP8266. I want:

1. TCP Server at 80
2. TCP Server at 33666
3. UDP at 506

I am using this:
Code:
AT+CIPMUX=1
OK
AT+CIPSERVER=1,33666
no change
OK
AT+CIPSTART=4,"UDP","192.168.0.5",21,506,2
4,CONNECT
OK
Now If I check with clients, I can send and receive data on TCP port 80 and UDP port 506 successfully, but no TCP server is created for 33666.

Does ESP8266 only allow one TCP server for AT Commands? If yes, how to bypass it?

#### Kripton2035

don't use the esp8266 with at commands ...
program it directly with the arduino IDE, it will be easier, faster, and more reliable
and it will behave as an arduino with integrated wifi module.

FvM

### FvM

Points: 2

#### dhruv_electro

don't use the esp8266 with at commands ...
program it directly with the arduino IDE, it will be easier, faster, and more reliable
and it will behave as an arduino with integrated wifi module.

Thanks for the great advice. I agree with you completely. But I just wanted to check if we can generate two TCP server in AT command or not. I can not find that reference about that.

#### Kripton2035

I remember that the original chip does not allow more than one tcp connection (but can't tell you where I read this... as I don't recall it)
and I was pretty surprised that the arduino system allowed the esp8266 to make more than one connection.
also the AT command system is pretty limited.

#### dhruv_electro

I already have connected esp8266 as 1 TCP server, 1 TCP Client and 1 UDP port. In this configuration TCP server can serve upto 3 active TCP client. Now I want is to have 2 TCP server and 1 UDP port, but it gives me this reply. Please also note that I have made mistake when posting the code here in forum here I am posting whole code:
Code:
AT+CIPMUX=1

OK
AT+CIPSERVER=1,80

OK
AT+CIPSERVER=1,33666

no change

OK
AT+CIPSTART=4,"UDP","192.168.0.5",21,506,2

4,CONNECT

OK

- - - Updated - - -

Hey again I think I found my answer: AT Command can not support two TCP server at the same time. More reference here:

#### Kripton2035

I did not try to have 2 tcp servers with the arduino ide but should give a try.
I tried like you some clients and one server. this worked well.

Status
Not open for further replies.