ESPlorer – probably best Lua editor

Hi Readers,

Today I would like to present you ESPlorer. If you read my previous post about LuaLoader. I believe that this is another tool which is worth to be used and learned by everybody who somehow starts his journey with ESP8266.

 

So first interesting thing I was surprised to see was Basic AT Commands Panel.

esplorer2

It contains common wifi commands which you can use to set up Station or Access point mode, HDHCP or not. You can simply query list of around WiFi networks (AT+CWLAP).

 

Second and the main feature is Lua editor. Basic, with nice syntax coloring.

esplorer6

 

You can of course save, compile, run and upload code. It also contains Commands panel which can restart your ESP8266 and do couple more things.

esplorer5

 

I didn’t spend much time using it as most of this what this tool offer I tried before with other or my own tools (ATManager on my Github repository). But if you are beginner or even you are not this is useful tool to control ESP8266 module plus offers everything we need to programmer ESP8266 with Lua programming language.

 

Also as you probable have noticed. There is Frankenstein tab. I am really curious what author of ESPlorer has in mind but it is not yet ready and we will need to wait.

esplorer3

 

Try it, test it and play with it. Really nice tool.

 

You can download it from here: http://esp8266.ru/esplorer/

 

Github repository: https://goo.gl/ii9xsz

 

Be positive and stay calm!

Cheers,

Radek

LuaLoader – Unknown but surprisingly useful tool!

Hi Readers,

Today I would like to present LuaLoader. Surprisingly useful tool which I wasn’t aware for too long. To be honest I believe everybody who starts his journey with ESP8266 should at least try LuaLoader.

Of course after testing and learning basic ESP8266 functionality using AT commands. And after changing ESP8266 firmware from AT command firmware to Lua firmware. (Which you can find on my blog).

 

123456
LuaLoader

 

As you can see on attached picture LuaLoader has many different interesting features.

(Skin colour section) Starting with interactive real-time main console window. You will see there everything incoming from ESP8266 board and you can still type this what you want to send to the board.

(Blue section) You can change GPIO settings or check current settings.

(Green section) You get restart it get chip Id or more.

(Orange section) You will be also able to create Access point or get list of other access points near your module.

(Yellow section) You can do everything related to Lua programming language. You can upload source code file, download existing file. Compile. Format. Remove, cat or any toher

Try it. Play with it. Hopefully it will make ESP8266 more easy for you!

 

Apologize Readers I am so brief today but yesterday I tried LuaLoader and as you know really I liked it! But I didn’t had much time to work on a new post. I planned to do it today and guess what it doesn’t work for me. I tried everything but it have a problem to connect LuaLoader connecting with my Nodemcu. I am able to connect to the board with other tools but not LuaLoader.

 

Still I hope you will like LuaLoader and you will have fun a bit with it before my next lesson which will be about another Lua tool which I am planning to test tomorrow.

 

Github repository: https://goo.gl/ii9xsz

Be positive and stay calm!

Cheers,

Radek

 

 

 

AtManager (Cool AT commands software with some Reactive Extension)

Hi Readers,

Today I would like to introduce application I have created to tests and learn how to control ESP8266 using AT commands. It is software tool written in C#.

I called it “AtManager”.

Based on AtManager I have created two basic tools PCoordinator and PEndDevice both are basically AtManager with new sequence of first commands send to ESP8266.

What is cool about this application what I tried to achieve is having really basic application which simply sends AT commands and after that is waiting for response. Response which returns as enumerate within response string.

I called it AtCommandService class. It contains SendCommand() command which sends AT command string we want to send and has a timeoutPeriod in which will wait for response.

What could be interesting for you instead of registering SerialDataReceivedEventHandler function I used Reactive Observable to which later I am Subscribing ProcessIncomingData() function which is processing the incoming data. It could be done in classic easy C# way but I have decided it would be cool doing it with reactive a bit simplifying the source code.

      private IObservable<object> _dataReceivedSubscription
{
get
{
return Observable
.FromEventPattern<SerialDataReceivedEventHandler, SerialDataReceivedEventArgs>(x => _serialPort.DataReceived += x, x => _serialPort.DataReceived -= x)
.Select(x => x.Sender);
}
}

Have fun with it. It should make your testing and learning ESP8266 module much easier.

Whole project you can find on my github repository.

 

Github repository: https://goo.gl/ii9xsz

Be positive and stay calm!

Cheers,

Radek

Flashing ESP8266 & Nodemcu with latest firmware

Hi Readers,

Today I would like to show you how you can flash ESP8266 boards.

Most of ESP8266 boards have AT firmware installed when are leaving factory. To use Lue we will need to change AT firmware to nodemcu firmware. You can download it from here:

https://github.com/nodemcu/nodemcu-firmware/releases

To change firmware you need flasher tool which you can find here:

https://github.com/nodemcu/nodemcu-flasher

How to do that?

First thing you need to run nodemcu flasher tool (32bit or 64bit depends on your operating system). Then you need to connect nodemcu. After connection you need to select right COM port number.

687474703a2f2f693635392e70686f746f6275636b65742e636f6d2f616c62756d732f75753331362f766f77737461722f4e6f64654d43552d466c61736865722d426567696e2e706e67

Then you need to go to config section and select new firmware I have selected ‘nodemcu_integer_0.9.6-dev_20150704.bin’ but you can select latest one as at time you are reading it there could be newest version.

687474703a2f2f693635392e70686f746f6275636b65742e636f6d2f616c62756d732f75753331362f766f77737461722f4e6f64654d43552d466c61736865722d53657474696e672e706e67

After that you need to go back to Operation section and simply click Flash.

687474703a2f2f693635392e70686f746f6275636b65742e636f6d2f616c62756d732f75753331362f766f77737461722f4e6f64654d43552d466c61736865722d50726f6772616d6d696e672e706e67

After that flashing process will start but if you will have trouble during flashing and you are flashing for example Nodemcu prototype ESP6288 board then you need to click flash button on the board Nodemcu board.

687474703a2f2f693635392e70686f746f6275636b65742e636f6d2f616c62756d732f75753331362f766f77737461722f4e6f64654d43552d466c61736865722d537563636573732e706e67

And that’s all folks! Should work now!

porkey

Github repository: https://goo.gl/ii9xsz

Be positive and stay calm!

Cheers,

Radek

ESP8266 Server and Client (TCP & UDP)

Hi Readers,

Today I would like to present you how we can create TCP Server and Client on ESP8266 modules. For purposes of this post we are assuming that an Access point will be also a TCP Server and a Station will be also a Client.

We will reuse commands from my previous posts with list of commands needed to create a Station and an Access point.

Server

So let’s start with the Server. To do that first we need to set one of the modules to work as an Access point to create Wifi network on which we could operate, send commands and etc.

 // Creating Access point – described here:  https://gettoknowthebob.wordpress.com/2016/04/02/second-contact-esp8266-access-point/

AT+RST

AT+CWMODE=2

AT+CWSAP=””,””,,

AT+CIFSR

// Creating TCP Server

AT+CIPMUX=1 – This commands prepares ESP8266 to work with multiple connections. But also we need to remember that if this settings is not set to 1 then Server will not work.

AT+CIPSERVER=1, – Creating and starting Server you can set port number bnut if you don’t want to set it default port number will be set to 333.

Example:

 // Creating Access point

AT+RST

AT+CWMODE=2

AT+CWSAP=”TestNetworkSSID”,”TestPassword”,5,3

AT+CIFSR

// Creating TCP Server

AT+CIPMUX=1

AT+CIPSERVER=1,80

TCP/UDP Client

We need to set second module to work as an Station which will connect to our example Access point and Server.

 // Creating Station – described here:  https://gettoknowthebob.wordpress.com/2016/04/02/second-contact-esp8266-access-point/

AT+RST

AT+CWMODE=1

AT+CWLAP

AT+CWJAP=””,””

AT+CIFSR

// Creating TCP Client

AT+CIPSTART=”TCP”,””, – This command starts the TCP Client (you can replace TCP with UDP)

Example:

 // Creating Station

AT+RST

AT+CWMODE=1

AT+CWLAP

AT+CWJAP=”TestNetworkSSID”,”TestPassword”

AT+CIFSR

// Creating TCP Client

AT+CIPSTART=”TCP”,”192.168.4.1″,80

Github repository: https://goo.gl/ii9xsz

Be positive and stay calm!

Cheers,

Radek

Second contact ESP8266 (Access point)

Hi Reader,

As you could read in previous post to make a connection with WiFi network you need to use AT+CWJAP=””,”” command and to get your new IP address you need to use AT+CIFSR command.

But this is just an eye drop in the lake of features which ESP8266 is offering.

Another very useful feature is settings ESP8266 to work as an Access point to do it you need to simple set all commands one by one as I will show you on the bottom. Also you can use my SerialPortMonitor (which you can find on my github) and add all commands to an array and send it every 2-5s instead of typing it manually.

AT+RST – I believe it is always good to reset (software reset) module before starting doing anything really.

AT+CWMODE=2 – Set ESP8266 to be able to work as an Access point. After that we will need to set SSID (network name) and password also encryption type to create new access point.

AT+CWSAP=””,””,, – this command is creating access point to which we will able to connect.

  • Network SSID – name of your new Wifi network
  • Password – Wifi network password
  • Channel – Wifi channel I am using 5th channel
  • Encryption:
    • 0 – OPEN (no encryption)
    • 2 – WPA_PSK
    • 3 – WPA2_PSK
    • 4 – WPA_WPA2_PSK

AT+CIFSR – Command to get access point IP address

And this is it what you need to set to create new Wifi network using ESP8266 module.

In next post I will add commands to create Server and Client and how to exchange data between modules.

Example:

AT+RST

AT+CWMODE=2

AT+CWSAP=”TestNetworkSSID”,”TestPassword”,5,3

AT+CIFSR

Github repository: https://goo.gl/ii9xsz

Be positive and stay calm!

Cheers,

Radek

First conversation with ESP8266 (Station mode)

Hi Readers,

Today I want to talked about AT commands the ‘language’ to communicate with ESP8266 boards.

The simplest command is ‘AT’. It is like saying Hi to esp board and if it will replay with same ‘AT’ it means connection is good.

Each command must be ended with Carriage return <CR> and LineFeed <LF> in most of the language it is “\r\n” on the end of each string or command. In my serial port monitor application I have added two post ago <CR><LF> is added automatically after each command. So if you have never went across carriage return you can check it on my github source code.

Another command is ‘AT+CWMODE=1’ with parameter ‘1’. It sets ESP8266 to work in station mode which mean that it will be able to connect to any WiFi network and acts as normal device/client.

After that as we want to connect ESP8266 to our WiFi network we can query list of all near networks. As you can see on attached picture near me esp found more then 10 networks but we are interested in Fred’s Network which is my temporally home network.

 

Consola
Output from SerialPortMonitor application (avail. on github)

 

As you could see on included picture next command we need to use is ‘AT+CWJAP=”<network name>”,”<password>”. This command allows us to connect to any WiFi network when we know it’s name (and if set a password). After sending it you should get back ‘WIFI CONNECTED’ and ‘WIFI GOT IP’ response from ESP8266 module. Which mean that you have successfully connected to this network.

Now to get your IP address which provided by router you need to simply type ‘AT+CIFSR’.

 

Example:

AT

AT+RST

AT+CWMODE=1

AT+CWLAP

AT+CWJAP=”YourNetwork”,”Password”

AT+CIFSR

 

At this point you have ESP8266 connected to your router and you are ready to do more. But more about it I will describe in next post on GetToKnowTheBob blog.

 

Github repository: https://goo.gl/ii9xsz

Be positive and stay calm!

Cheers,

Radek

 

ESP8266 prototype board

Hi Readers,

Today I have done some tests with ESP8266 prototype board.

As I had lot of issues with missing parts or annoying problems with some technologies I decided to use this prototype board as main board which will work as coordinator and for first part I will use raspberry pi zero as end-device.

Prototype board is from china is cheap and easy to install.

Installation:

What you need to do you need to download and install drivers CH340 and that’s all. I have used drivers from this site http://www.arduined.eu/ch340-windows-8-driver-download/  I think this driver is directly provided by Chinese manufactures.

Board testing:

I have created SerialPortMonitor application (source code on the bottom) which will allow you to send all commands to ESP8266 prototype board you would like. As for example to test your board I would suggest to send “AT” and after that if board will response with “AT” it will mean it is working.

Serial port is hardcoded but if you like you can use Console.Read() to provide com port manually. Bear in mind that for me seria port speed set to 9600 didn’t work for me. I have used 115200 and after that was fine.

I have decided to create this basic application even there are many tools which will allow you to send AT commands to ESP8266 prototype board but I think this application is good basic base to start working on your own ESP8266 application.

SerialPortMonitor source code:

private static string indata = string.Empty;

static void Main(string[] args)
{
var indata = string.Empty;
SerialPort serialPort = new SerialPort(“COM5”);
serialPort.BaudRate = 115200;
serialPort.Parity = Parity.None;
serialPort.StopBits = StopBits.One;
serialPort.DataBits = 8;
serialPort.Handshake = Handshake.None;
serialPort.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);

try {
serialPort.Open();
}
catch (Exception e) {
Console.WriteLine(e.Message);
Console.WriteLine(“Application had an exception and must be closed. Press any key to continue…”);
Console.ReadLine();
return;
}

Console.WriteLine(“Write ‘end’ when you will wish to close this application.”);
Console.WriteLine(“To send command press enter (remember that \\r\\n characters will be added automatically to end of the command).\n\n”);
while (true) {
indata = Console.ReadLine();
if (!indata.StartsWith(“end”)) serialPort.WriteLine(indata + “\r\n”);
else break;
}

serialPort.Close();
}

private static string ProcessIncommingData(string data)
{
data = data.Replace(“\r”, @”\r”);
data = data.Replace(“\n”, @”\n”);
return data;
}

private static void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e)
{
SerialPort sp = (SerialPort)sender;
indata += ProcessIncommingData(sp.ReadExisting());

if (indata.Contains(“OK\\r\\n”) || indata.Contains(“ERROR\\r\\n”))
{
Console.WriteLine($”<< {indata}\n”);
// DO SOMETHING WITH DATA
indata = string.Empty;
}
}

 

Github repository: https://goo.gl/ii9xsz

Be positive and stay calm!

Cheers,

Radek

ESP8266

Hi Readers,

I have started using ESP8266 and I would like to share it with you.

So let’s begin. Connection of ESP8266 to Raspberry Pi is very easy as you can see on attached picture:

drawing
ESP8266 to Raspberry Pi

As you can see CH_PD is powered down so you need to connect 3.3V to it to power it up as your ESP8266 wont start.

After that you can start communication with esp module as first what you can do you can send ‘AT’ command which is like saying hi to module which after that if will replay with also ‘AT’ it will mean that connection has succeed.

I have wrote simple application in nodejs which you can use to test it you can find it in my github repository at:

https://github.com/rbrus/gettoknowthebob/blob/master/node.js/Coordinator/coordinator.js

or you can find it here:

console.log(“– Begin”);
var list = [“AT\r\n”,”AT\r\n”,”AT\r\n”,”AT\r\n”];
var start = 0;
var allData;
var SerialPort = require(‘serialport’).SerialPort;

var serialPort = new SerialPort(‘/dev/ttyAMA0’, {
baudrate: 115200,
dataBits: 8,
parity: ‘none’,
stopBits: 1,
flowControl: false
});

serialPort.open( function(error)
{
if(error)
{
console.log(‘failed to open: ‘ + error);
}
else
{
console.log(‘open serialport’);

serialPort.on(‘data’, function(data)
{
console.log(“data received: ” + data);
if(data == ‘AT+CWLAP\r\n’)
{
start = 1;
}
if(start == 1)
{
if(data.endsWith(‘OK\r\n’))
{
console.log(allData);
}
allData += data;
}
});

for (var i = 0; i < 3; i++ )
{
serialPort.write(list[i], function(err, results)
{
console.log(‘err ‘ + err);
console.log(‘results ‘ + results);
});
}
}
});
console.log(“– End”);

During next couple weeks I will be adding more information, trick and tips how to use ESP8266.

IMG_20160327_164000
Picture of my raspberry pi and ESP8266 module

Github repository: https://goo.gl/ii9xsz

Be positive and stay calm!

Cheers,

Radek

Arduino and delivery of ESP8266

Hi Readers,

Yesterday I had a new delivery at my doorstep. I have received NodeMCU with ESP8266 and two ESP8266 modules:

wifi20serial20transceiver20module
ESP8266 module
esp8266-nodemcu-developer-kit
Mcu ESP8266

Unfortunately I haven’t received external power supply which I ordered. So I am still waiting with my tests Arduino + ESP8266 as we need external power supply for ESP8266 module if we want to connect it wwith Arduino nano.

So what are ESP8266 modules?

As there is many really a lot of description around internet I will quote sparkfun as they have one of best:

The ESP8266 WiFi Module is a self contained SOC with integrated TCP/IP protocol stack that can give any microcontroller access to your WiFi network. The ESP8266 is capable of either hosting an application or offloading all Wi-Fi networking functions from another application processor. Each ESP8266 module comes pre-programmed with an AT command set firmware, meaning, you can simply hook this up to your Arduino device and get about as much WiFi-ability as a WiFi Shield offers (and that’s just out of the box)! The ESP8266 module is an extremely cost effective board with a huge, and ever growing, community.

This module has a powerful enough on-board processing and storage capability that allows it to be integrated with the sensors and other application specific devices through its GPIOs with minimal development up-front and minimal loading during runtime. Its high degree of on-chip integration allows for minimal external circuitry, including the front-end module, is designed to occupy minimal PCB area. The ESP8266 supports APSD for VoIP applications and Bluetooth co-existance interfaces, it contains a self-calibrated RF allowing it to work under all operating conditions, and requires no external RF parts.

https://www.sparkfun.com/products/13678

In next couple weeks I will share with you experience I will have with ESP8266 module and prototype board.

Github repository: https://goo.gl/ii9xsz

Be positive and stay calm!

Cheers,

Radek