Using a ESP8266 Wifi Module: Difference between revisions

From STorM32-BGC Wiki
Jump to navigation Jump to search
No edit summary
Line 15: Line 15:
It is important to get the correct ESP8266 module. Quite many different versions are available, see e.g. [http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family]. You need a module with 1MB (8Mb) flash, since the STorM32's ESP firmware is made for that flash size.  
It is important to get the correct ESP8266 module. Quite many different versions are available, see e.g. [http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family]. You need a module with 1MB (8Mb) flash, since the STorM32's ESP firmware is made for that flash size.  


With proper cabling any ESP8266 module with said flash size can be used. However, the STorM32 v3.x boards are prepared for hosting a ESP-01 module. The original EPS-01 module has only 512KBB (4Mb) flash and is thus '''''not''''' suitable. You need a "new" EPS-01 module, which nowadays are in fact mostly sold. These are typically black instead of blue, and come with a label '''''"AI-Cloud inside"''''', or as '''''ESP-01s "s series"'''''.
With proper cabling any ESP8266 module with said flash size can be used. However, the STorM32 v3.x boards are prepared for hosting a ESP-01 module. The original EPS-01 module has only 512KBB (4Mb) flash and is thus '''''not''''' suitable. You need a "new" EPS-01 module, which nowadays are in fact mostly sold. These are typically black instead of blue, and come with a label '''''"AI-Cloud inside"''''', or as '''''ESP-01s "s series"'''''. However, as always with this Asian stuff, one can't be absolutely sure, so buy with care.


:[[File:511KuyBpzaL. SX425 .jpg|280px]]
:[[File:511KuyBpzaL. SX425 .jpg|280px]]

Revision as of 14:21, 19 July 2017

The information on this page refers to firmware v2.29e and higher.

Since firmware version v2.28e, communication via Wifi using the popular ESP8266 Wifi module is available.

Ordering Information

Things to have at minimum:

  • ESP-01 ESP8266 Wifi Module with 1MB (8Mb) flash
  • USB-to-serial adapter

The need for a ESP8266 Wifi module should be obvious. The USB-to-serial adapter is required for flashing the ESP8266 module with a dedicated firmware and upload other files to the ESP8266. However, you probably have one anyhow, since it's also needed for upgrading STorM32 v1.x main boards.

It is important to get the correct ESP8266 module. Quite many different versions are available, see e.g. [1]. You need a module with 1MB (8Mb) flash, since the STorM32's ESP firmware is made for that flash size.

With proper cabling any ESP8266 module with said flash size can be used. However, the STorM32 v3.x boards are prepared for hosting a ESP-01 module. The original EPS-01 module has only 512KBB (4Mb) flash and is thus not suitable. You need a "new" EPS-01 module, which nowadays are in fact mostly sold. These are typically black instead of blue, and come with a label "AI-Cloud inside", or as ESP-01s "s series". However, as always with this Asian stuff, one can't be absolutely sure, so buy with care.

511KuyBpzaL. SX425 .jpg

Installation

The installation consists of four steps: flashing the ESP8266 module with the dedicated firmware, uploading some data files to the ESP8266 module, connecting the EPS8266 module to the StorM32 controller, and configuring the STorM32 controller.

Flashing the ESP8266

Uploading of Data Files to the ESP8266

Connecting the ESP8266

STorM32 Configuration

ESP8266 Operation Modes

GUI

STorM32 Web App

Brief

brief instructions for using the ESP8266 wifi support

0) you need a black ESP-01 (i.e. a ESP-01 with 1M instead of 0.5M)(typically they come with a label "AI-Cloud inside", or as ESP-01s "s series").

1) you need to flash the firmware onto the ESP - connect the ESP to a usb-ttl adapter and connect the pins to bring it into bootloader mode, exactly as explained on one of the many instructions on the web - browse to the o323BgcEspWebApp directory in the STorM32 firmware folder - double click cmd-here.bat - enter uploadInoBin COM??, where COM?? stands for the com port (e.g. COM23), and hit enter

2) you need to upload the files in the data subfolder to the SPIFFS file system - connect the ESP to a usb-ttl adapter and connect the pins to bring it into bootloader mode, exactly as explained on one of the many instructions on the web - browse to the o323BgcEspWebApp directory in the StorM32 firmware folder - double click cmd-here.bat - enter uploadDataToFs COM??, where COM?? stands for the com port (e.g. COM23), and hit enter

3) Connect the ESP to the STorM32 board - connect the ESP's Tx and Rx pins to the STorM32's UART Rx and Tx pins - provide 3.3V power to the ESP (do NOT use the STorM32's 3.3V pins, they are too weak)(do NOT use voltages larger than 3.3V)

4) Configure ESP in STorM32 GUI - set the parameter "Esp Configuration" in the Expert tab to "Uart"

5) Connect Wifi By default the ESP is configured as access point with ssid "STorM32 ESP" and password "thisisgreat". So, connect to it, start the browser, and go to 192.168.4.1. Alternative, start the GUI and choose "ESP" in teh Port field.


You are greatly encouraged to improve the javascript and css files. This is made very easy. The ESP just provides a very rudimentary HTML skeleton, everything essential is filled in by the js and css scripst, and these are stored in the ESP's filesystem. In order to use your own js and css, you just have to upload them to the EPS's filesystem (step 3). You also can provide links to js and css files on your own webspace, which makes development most easy. See storm32web.cfg for details.