How to Print AT Commands with ESP8266 using USB TTL Converter

ESP8266 Wifi module is creating a buzz in the world of IoT. It is cost effective and can do wonders for developers especially the beginners who have just started building IoT projects. In this post, we are going to learn how to upload firmware to ESP8266 (ESP-01) and print AT Commands using a USB TTL converter.

There are different ways to program the ESP8266, but we will only cover the method using the Arduino IDE. This is really easy for beginners, and it’s a very familiar environment if you’ve used Arduino boards before. You just need to install the ESP8266 board setup for Arduino.

 What do you need to get started?

  • An ESP8266 board
  • A computer that can run the Arduino IDE (Windows, Mac or Linux)
  • A 3.3 volts compatible USB-to-Serial converter
  • A USB cable
  • A 3.3V power supply or voltage regulator
There are two modes in which the ESP-01 module works:
  • Flashing mode
  • Normal working mode
In the flash mode, the GPIO0 pin is grounded whereas in the normal mode the GPIO0 pin is shorted to ground. Let us see the connections between ESP-01 Wi-Fi module and USB TTL converter in the flash mode:
Flashing Mode

Flashing Mode

Normal Mode

Normal Mode

Rx -> Tx

Tx –> Rx

CH_PD -> Vcc = 3.3 volt provided by the USB-TTL module

GND -> GND

GPIO0 –> GND or Open (Flash mode/Normal mode)

Arduino’s Serial Monitor displays serial data being sent from the Arduino or Genuino board (USB or serial board). To send data to the board, enter text and click on the “send” button or press Enter. ESP8266 chip is usually set to either 9600 bps or115200 bps.Recent firmware versions set the baud rate to by115200 bps default, so if your chip is set to communicate at a different speed, you probably need to update the firmware.

Now, you can send it AT commands. First, let’s send “AT”:

AT


OK

Now let’s get the firmware version:

AT+GMR

0018000902

OK

Now, let’s get the operation mode.

AT+CWMODE?

+CWMODE:3

OK

3 implies that we are in Standalone + Access Point mode. That’s fine. Now, let’s do something fun. Let’s list all the available WiFi access points.

AT+CWLAP

+CWLAP:(0,"Cisco-guest",-84,"ce:d7:19:0b:80:19",1)
+CWLAP:(4,"TRENDnet",-86,"c8:d7:19:0b:80:19",1)
+CWLAP:(2,"ASingh",-87,"00:25:5e:c5:d1:88",1)
+CWLAP:(4,"HMMA",-66,"80:ea:96:f1:27:7a",11)
+CWLAP:(4,"dlink-30B8",-91,"c8:d3:a3:6e:30:b8",6)
+CWLAP:(4,"Deepak",-93,"80:a1:d7:77:a1:e4",6)
+CWLAP:(1,"MGMNT",-91,"80:a1:d7:77:a1:e5",6)
+CWLAP:(3,"pinky",-67,"20:aa:4b:31:43:9d",6)
+CWLAP:(2,"smk385",-89,"00:1f:33:bc:02:f6",6)
+CWLAP:(4,"Abraham",-91,"ec:1a:59:17:53:93",7)
+CWLAP:(3,"Shaina",-88,"08:60:6e:cb:63:b0",11)
+CWLAP:(2,"Ubaid",-77,"94:d7:23:f5:fc:34",9)
+CWLAP:(1,"MGMNT",-77,"94:d7:23:f5:fc:35",9)
+CWLAP:(1,"Pallavi",-92,"00:1d:7e:1e:68:4e",11)

OK

Now let’s connect to my WiFi network.

AT+CWJAP="chris","chris123"


OK

Now, let’s check if we actually got an IP address:

AT+CIFSR

192.168.4.1
192.168.4.10

OK
Cool! We are on the network.

NOTE: 

  • The ESP8266 chip requires 3.3V power supply voltage. It should not be powered with 5 volts like other Arduino boards.
  • The I/O pins of ESP8266 communicate or input/output max 3.3 V. i.e. the pins are NOT 5V tolerant inputs.

Christine

Christine

Author at onlineshouter
Christine writes for people who seek for knowledge about SEO, blogging, online marketing, gadgets and web apps.
Christine

Leave a Reply

Your email address will not be published.