Get Started Using AT Commands w/ ESP8266
Multiple Connection as TCP Server - #arduSerie 19
Hi, Hobbyist!!
Lets playing with AT Commands in ESP8266!
When ESP8266 is working as a TCP server, a multiple of connections shall be maintained. That is to say, there should be more than one client connecting to ESP8266.
Here is an example showing how TCP server is realized when ESP8266 is working in softAP mode:
1 WAY CONNECTIONS
— — — — — — — — -
AT
AT+GMR
AT+CWLAP // Scan the airwaves for WiFi signals in range
AT+CWJAP=”colibri”,”**********” // SSID and password of router; Connect to router/
AT+CIPMUX=1 // MULT CONN; Enable multIPle connection:
AT+CIPSERVER=1,80 // Setup server ON PORT 80
AT+CIFSR // GET IP NUMBER; Query device’s IP:
USE BROWSE 192.168.1.3
AT+CIPSEND=0,30 // Send data: ID number of connection is defaulted to be 0/ Send 30 bytes to connection NO.0
“HELLO FROM ESP8266!” // enter the data, no CR
If the number of bytes sent is bigger than the size defined (n), will reply busy, and after sending n
number of bytes, reply SEND OK
AT+CIPCLOSE=0 // Delete NO.0 connection.
AT+CIPSERVER=0 // CLOSE SERVER
AT+RST
2 WAY CONNECTIONS
— — — — — — — — -
1ºTERMINAL
— — — — —
AT+CIPMUX=1 // MULT CONN; Enable multIPle connection:
AT+CIPSERVER=1,80 // Setup server ON PORT 80
AT+CFSR // GET IP NUMBER; Query device’s IP
2ºTERMINAL
— — — — —
// USE PUTTY RAW MODE 192.168.1.3
// TYPE SOME CHARACTERS
“HELLO FROM SECOND TERMINAL!”
1ºTERMINAL
— — — — —
AT+CIPSEND=0,27
“HELLO FROM FIRST TERMINAL!”
Here is summarized commands used:
AT commands set is divided into: Basic AT commands, WiFi related AT commands, TCP / IP AT commands:
That´s all for now!!!
Thank you for (reading this articles !) watching this video!
By!!!