Thursday, August 3, 2017

IoT / Arduino - USB ESP8266 Programmer (CH340G Chip)

 

I recently bought this ESP8266 WiFi module (ie ESP-01) for my IOT project. This is a self contained chip and can be programmed to do the respective tasks. To ease out the task of programming, I bought this ESP-01 ESP8266 Programmer CH340G Chip USB WiFi Wireless UART GPIO0 Adapter.

Please read my tutorial series on IOT.

clip_image001

So lets get started !

 

Installing Drivers - Part 1

1.  This Programmer Adapter is build around CH340 chip which usually needs to install the following drivers on a computer.

  • Unzip the folder.
  • If you are running a 64Bit Windows: – run the SETUP_64.EXE installer.
  • If you are running a 32Bit Windows: – run the SETUP_32.EXE installer.

2. Connect the ESP-01 (as shown) to the programmer and plug it into the USB.

clip_image002

3. Install the Drivers

clip_image003

After restarting the PC, the device will be ready to go.

 

 

Setting Arduino Software - Part 2

1. Download the latest arduino Software.

2. We need to Install ESP board in Arduino Software

Open up Arduino, then go to the Preferences (File > Preferences).

Then, towards the bottom of the window, copy this URL into the “Additional Board Manager URLs” text box:

clip_image004

3.  Hit OK. Then navigate to the Board Manager by going to Tools > Boards > Boards Manager. There should be a couple new entries in addition to the standard Arduino boards. Look for esp8266. Click on that entry, then select Install.

clip_image005

4. The board definitions and tools for the ESP8266 include a whole new set of gcc, g++, and other reasonably large, compiled binaries, so it may take a few minutes to download and install (the archived file is ~170MB). Once the installation has completed, an Arduino-blue “INSTALLED” will appear next to the entry

5. Select the Generic ESP 8266 Module Board.

clip_image006

6. Set the Upload Speed and CPU Frequency.

clip_image007

clip_image008

7. Select the device port. (Device should be connected to the PC)

clip_image009

8. To test the ESP8266, open up serial monitor (Ctrl + Shift + M)

clip_image010

9. Set baud rate to : 115200 baud
    and Both NL & CR
    with AutoScroll

10. Type AT command in the serial monitor and click enter. If you see an OK message, you are good to go.

11. You can find the complete set of AT commands here.

 

Bonus :

Out of them, here are my noted ones.

AT                      // Test if AT system works correctly

AT+GMR           //Print firmware version

AT+CWMOD=3   //Wifi Mode
- 1 = Station mode (client)
- 2 = AP mode (host)
- 3 = AP + Station mode (Yes, ESP8266 has a dual mode!)

AT+CWLAP       // List of all available wifi 

ATE1  / ATE0       // Enable or Disable echo

AT+CWJAP=”my-test-wifi”,”1234test”    // Connect to a wifi

AT+CWQAP         //Disconnect from the wifi

 

Caution :

  • 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.3V only. i.e. the pins are NOT 5V tolerant inputs.

Taken From: http://www.arjunsk.com/iot/iot-using-esp8266-programmer-ch340g-chip-adapter/