Get Started Using AT Commands w/ ESP8266

Get Started Using AT Commands w/ ESP8266

Multiple Connection as TCP Server – #arduSerie 19

J3

Jungletronics

J3

·

Follow

Published in

Jungletronics

·

·

Oct 11, 2016

2 min read

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 the 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 THE SECOND TERMINAL!”

1ºTERMINAL
— — — — —
AT+CIPSEND=0,27
“HELLO FROM THE FIRST TERMINAL!”

Here is summarized commands used:

AT commands set is divided into Basic AT commands, WiFi related AT commands, TCP / IP AT commands:

Files 4 This project

That´s all for now!!!
Thank you for (reading these articles !) watching this video!
Bye!!!

👉 GitHub:)

Related Posts

Arduino Headless Setup & ESP8266 (WIFI cheap chip!) — Rather Stunning MCU!!! — #arduSerie 16

Flashing The Official ESPRESSIF Firmware in ESP8266 !!! — Easy ESP8266 Flashing!!! — #arduSerie 17

Get Started Using AT Commands w/ ESP8266 — Multiple Connection as TCP Server — #arduSerie 19

Your First NodeMCU/Lua Script Flash on ESP8266!!! — Let’s get our feet wet with NodeMCU/Lua and sees what happens !!- #arduSerie 20

— Edited @jan2019 with the help of Grammarly —Help me improve my text, please comment:) —

— Edited @jun2022 — fixing broken link 🙂