Categories

Tutorial

Starting with LUA on ESP8266 Wifi module

Robo India presents tutorial on starting with LUA on ESP8266 wifi module and ESPLORER.

Detailed Tutorial

1. Introduction:

To start with LUA programming on ESP8266 wifi module you will need ESPlorer. Here in this tutorial it is explain in detail to start with LUA on ESP8266 and ESPloer.

1.1 Prerequisites:

1.1.1 Setup connections of ESP8266: This tutorial of Robo India explains setup connections of ESP8266.

1.1.2 NodeMCU firmware on your ESP8266: This tutorial of Robo India explains how to flash ESP8266 wifi module with NodeMCU.

1.1.3 JAVA 7 and above installed: You may get it if you don't have from here. http://java.com/download

Connect RX and TX pins of ESP8266 module to the Serial Port of you computer, if you don't have one in your computer, FTDI or CP2102 can be used.

2. Required Software

Following software will be required to start with LUA programming on ESP8266 using ESPlorer.

2.1 ESPlorer

Download ESPlorer Software from the below link.

https://github.com/4refr0nt/ESPlorer

As you open above link there will be a button on the right side of the page download-ZIP-2, click on this and download master folder.

or you may download it from the following link-

http://esp8266.ru/esplorer-latest/?f=ESPlorer.zip

After downloading ESPlorer.zip extract the same to your desired place. This is how it looks like.

ESPlorer-explore

The highlighted file in the following image is the file to run ESPlorer. Double click on the highlighted file to run ESPlorer.

ESPlorer-explore-2

2.2 LUA Editor

Though ESPlorer has got LUA Editor in itself. But we recommend to use following LUA Editor for ease. LUA Editor is an open source software for developing LUA programs. you may download it from the following link.

http://luaedit.sourceforge.net/

3. Introduction to ESPlorer

Open ESPlorer as explained in Step 2.1. It looks like following image -

ESPlorer--explained-1

Connect your ESP8266 to your computer and note down the COM port(Mine is COM2). You will need to restart ESPlorer after connecting ESP8266 to the computer. Select you COM port. COM Port selection area is high lighted in the following image.

ESPlorer-explained-2

Select Baud Rate as shown highlighted in the below image, It is to be 9600, but some time it doesn't work. So you will need to repeat these steps with other baud rates.

ESPlorer-explained-3

Click on open button to connect ESPlorer to the ESP8266 wifi module.

ESPlorer-explained-4

Following window is response window, you will know what exactly is happening in ESP8266 through this window, After successful connection you will see message as shown highlighted in following image.

ESPlorer-explained-5

Following window is user window where you can write codes or commands for ESP8266.

ESPlorer-explained-6

4. Hello World programming 

Write following code in user window-

print('hello world');

and click on the button highlighted in the following image-

ESPlorer-explained-7

As you click on the said button your code gets transferred to the ESP8266 wifi module and you get following response from ESP8266 wifi module.

ESPlorer-explained-8

ESP8266 wifi Module repeats whatever we say to it. Thus the response shown highlighted in above image has got 2 lines first is the repetition of our code and in the next line is the execution of our code.

5. File system on ESP8266 wifi module

Set of commands can be saved in a form of file with .lua extension. Such files can be transferred to ESP8266 and be executed by calling their name.

init.lua this file is executed at the starting. So as the ESP8266 wifi modules gets power it find init.lua and executes all of the command set written in this file.

For uploading file to ESP8266 you need to have that file prepared with you. You may use Notepad, LUA Editor, or ESPlorer to do the same. Click on the highlighted button locate the file you created and it will be uploaded to ESP8266 wifi module.

ESPlorer-explained-9

See the response from ESP8266 wifi module after uploading of file.

ESPlorer-explained-10

Status bar of ESPlorer is highlighted in the following image, It shows current status of process-

ESPlorer-explained-11

To execute any file which is already there in ESP8266, use following code-

dofile('filename.lua');

If your click on the highlighted button shown in the following image, You will get list of files on the response window and on the below of this button in the form of button. After that you just need to click on the button to execute that file.

ESPlorer-explained-12

This is basics of ESPlorer and LUA Programming on ESP8266 wifi module.

If you have any query please write us at info@roboindia.com

our whatsapp helpline: whatsapp-logo-robo-india +91 9694011188

Thanks and Regards
Content Development Team
Robo India
http://roboindia.com

Related Tutorials
Logic Level Converter

Robo India presents tutorial how to use logic level converter. While interfacing with sensor or other electronic device logic level converter is required, if one device works on 5V and other on 3.3V and both have to communicate than this logic level converter will be required between them.

ESP8266 Wiif Module Setup

Robo India presents tutorial how to setup ESP8266 wifi module. Hardware configuration to run ESP 8266 wifi module is explained in this tutorial.

ESP8266 Flash with NodeMCU firmware

Robo India presents tutorial how to flash ESP8266 wifi module with LUA firmware. NodeMCU firmware is used here.

Robo India Tutorial portal

Illustrated tutorials and guides.

Feel free to contact us

© Robo India | http://roboindia.com