Skip to main content

Talking to your ESP8266 Chip (Wired and Wireless Methods)

In my previous post, I mentioned how to setup our chip ESP8266 NodeMCU.
As a convention throughout the industry, we should have our chip printed "Hello World!" for us.
Firmware had already been installed on our chip. So, the only thing we need is to talk to our chip via Serial Communication Protocols.

I'll categorize communication protocols in two groups: REPL and WebREPLREPL stands for Read Evaluate Print Loop.

In the REPL section, I'll be talking about PuTTY and TeraTerm and in WebREPL section I'll  be talking about only WebREPL sw.


1- Wired REPL Methods

i) PuTTY:


Figure: A new Serial Session is opened thru PuTTY.



Figure: Python Scrips (Hello World)



ii) TeraTerm:

Figure: TeraTerm Serial Connection Settings



Figure: Python Scrips (Hello World)



2- Wireless REPL Methods: 

i) WebREPL:

Using any of the REPL options above (PuTTY or TeraTerm), first we need to install weprepl library onto chip.

import webrepl_setup

Follow the instructions and reboot device afterwards.

Figure: Importing webrepl library using a PuTTY session


Connect your PC to ESP8266 Wifi Access point with the password you've just defined in above steps just like you connect to any Wifi access point. Now you are connected to the Wifi of your Chip. Cool!


Figure: Connection to Wifi Access of ESP8266 Chip



Now, open local or online WebRepl:



Connect to default IP: ws://192.168.4.1:8266/
Type your password when prompted...There we go.

Figure: MicroPython scripts using local WebREPL


Figure: MicroPython scripts using online WebREPL

To summarize, both wired and wireless communication methods with our chip is mentioned in this post. You are totally free to choose whichever is most convenient for you.

Happy MicroCoding !

Comments

Popular posts from this blog

How to Fill out a Cheque?

In this post, I will demonstrate how to fill out a cheque properly. You can have a cheque book either from your bank or any store. If you find these two suggestions expensive, you could also design and print out your own cheque. In Figure 1, a sample cheque is displayed and in Figure 2, some regions of the sample cheque are highlighted. Figure 1: Sample unfilled cheque. Figure 2: Some regions are highlighted in sample cheque. 1- Name and Address of Payer: Name and  address of the person who is the owner of this cheque and is filling out the cheque should be written in this region. 2- Date: For any official document, date is a mandatory field and hence you should write current date in this region. 3- Payee Name: Payee could be either a person or an organization (Store, Restaurant, Company, School etc.) You should write the name of the payee here explicitly. 4- Amount of Payment (Numeric): Exact amount of the payment should be w

Star Wars ASCIImation with Python - Windows

In this post, we'll watch a Star Wars movie in ASCII format. The only thing we need for this demo is Python-installed PC and internet connection. Figure : Screenshots from Python Command line while Star Wars is being streamed All credits gained in this demo will go to " blinkenlights.nl " [2] website, which broadcasts this ASCII movie using Telnet protocol on Port 23, and Python which makes socket implementation very easy for us. No authentication is needed for this broadcast. Anyone who is able to create a TCP socket and listens  blinkenlights.nl  on port 23 would be able to get this stream and display on their Python command line. CODE My main source for Python source code is [1]. What  code below does is simply importing Python "socket" library, create a socket, use " towel.blinkenlights.nl " address variable to create connection, receive data from socket and display it. While typing (copy/paste) code, be careful about indentatio

Internet of Things (IoT) with MicroPython

VIDEO LIVE DEMO Please check the link for Live DEMOs  SLIDES REFERENCES    [1] http://micropython.org/    [2] WebREPL: http://micropython.org/webrepl/    [3] Programming with MicroPython, Nicholas H. TollerWay    [4] http://dpgeorge.net/    [5] https://github.com/micropython/micropython    [6] https://www.youtube.com/watch?v=EvGhPmPPzko&t=1488s    [7] https://forum.micropython.org/viewtopic.php?t=744    ABBREAVIATIONS   REPL : Read Evaluate Print Loop