Olimex MOD-WIFI-ESP8266

From openinverter.org wiki
Jump to navigation Jump to search

The Olimex MOD-WIFI-ESP8266 WiFi expansion module is commonly used to provide WiFi connectivity and a web interface for several inverter controllers including those in the the OpenInverter ecosystem.

It is not just a WiFi chip - it actually hosts a web server that you can connect to in order to set parameters and monitor behaviour. The module communicates with OpenInverter controllers a UEXT header connector.

When used in the OpenInverter ecosystem (including ZombieVerter), this module is typically flashed with the [ESP8266-web-interface](https://github.com/jsphuebner/esp8266-web-interface) software. You can refer to the README of that code repository for up to date guidance on how to use the software and how to flash it onto an Olimex module.

Below we include an example of how you might want to flash a module.

Flashing Process Overview (e.g for Tesla Charger)

Esp8266-flash.png
  1. Solder GPIO0 to 0
  2. Install & open Arduino and setup the code from https://github.com/jsphuebner/esp8266-web-interface
  3. Flash the code (see below)
  4. Re-solder GPIO0 to 1
  5. See a new unprotected WiFi & connect, access web interface at IP 192.168.4.1
Step 3 (shortcut)

https://raw.githubusercontent.com/espressif/esptool/master/esptool.py

https://openinverter.org/forum/download/file.php?id=9167

python esptool.py --port COM1 --baud 115200 write_flash 0x000000 FSBrowser.ino.modwifi.bin

Step 3 (full)

https://openinverter.org/forum/viewtopic.php?p=4928#p4928

These steps have proved successful on Windows 10 using Arduino IDE v1.8.13 and version 0.5.0 of the ESP8266 Filesystem Uploader.

You'll also need a Micro-USB cable capable of data transfer - some of the cheaper ones are only used for charging.

3.1. Download the Arduino IDE and install it to PC

3.2. Buy a Weimos D1 mini ESP8266 board with FTDI and get CH340 driver from https://www.wemos.cc/en/latest/d1/d1_mini.html (or use Olimex)

3.3. Install the CH340 driver on your computer. When the installer opens run the uninstall option first to remove any previous versions of the driver. Then perform the installation.

3.4. Inside Arduino IDE install ESP8266

- open the Preferences window

- enter https://arduino.esp8266.com/stable/package_esp8266com_index.json into the Additional Board Manager URLs

- open Boards Manager from Tools > Board menu and install esp8266 platform. I select LOLIN D1 R2 mini board, settings (tools menu) are in the pic

Arduino IDE settings for Wemos D1 mini board
Arduino IDE settings for Wemos D1 mini board

3.5. Install ESP8266 Filesystem Uploader

- Download https://github.com/esp8266/arduino-esp8266fs-plugin/releases python support files

- extract file to Arduino IDE tools folder like you see here https://randomnerdtutorials.com/install-esp8266-filesystem-uploader-arduino-ide/

- restart Arduino for changes to come into effect

3.6. Download Johannes Web interface code here: https://github.com/jsphuebner/esp8266-web-interface

- make a note of the name of the .ino file then rename the enclosing folder with the same name (ie if the .ino file is ‘eps8266-web-interface.ino’ rename the enclosing folder ‘eps8266-web-interface’)

- move the renamed folder to the Arduino folder on your hard disc. This is usually inside your documents folder (eg …\Documents \ Arduino \ eps8266-web-interface )

3.7. Open Johannes Web interface code in the Ardunio IDE by double clicking the .ino file. The following edit may be needed:

- at about line 14 of the code (not the comments) there’s a line that should read "bool fastuartavailable = false;" if the value is set to true change it to false

3.8. Connect board to USB and select correct COM port and rest of settings

- if you used a new board you have to select "erase flash: sketch + wifi settings" so the board will erase its password

- click upload and wait for interface to reset the board

- select tools/ESP8266 sketch data upload and wait for the board to reset

- connect to the board’s WiFi network then go to http://192.168.4.1/ to see the web interface

- remember set up your own wifi name and password for the interface

WiFi doesn't show up

- in Arduino studio Tools -> Serial Monitor gives debug info of the chip. If the Serial Monitor says "Unknown command sequence" you need to change the TTL

- if GPIO0 is not resoldered, the chip is in programming mode and will not boot from the flash code

FileNotFound Error in WebInterface

Upload the files from the repository https://github.com/jsphuebner/esp8266-web-interface with below command:

#!/bin/bash
IP=192.168.4.1
echo $IP
curl -F 'data=@README.md' http://$IP/edit
curl -F 'data=@ajax-loader.gif' http://$IP/edit
curl -F 'data=@chart.min.js.gz' http://$IP/edit
curl -F 'data=@chartjs-annotation.min.js.gz' http://$IP/edit
curl -F 'data=@gauge.min.js.gz' http://$IP/edit
curl -F 'data=@gauges.html' http://$IP/edit
curl -F 'data=@gauges.js' http://$IP/edit
curl -F 'data=@index.html' http://$IP/edit
curl -F 'data=@index.js' http://$IP/edit
curl -F 'data=@inverter.js' http://$IP/edit
curl -F 'data=@jquery.core.min.js.gz' http://$IP/edit
curl -F 'data=@jquery.knob.min.js.gz' http://$IP/edit
# curl -F 'data=@log.htm' http://$IP/edit
curl -F 'data=@log.html' http://$IP/edit
curl -F 'data=@log.js' http://$IP/edit
curl -F 'data=@refresh.png' http://$IP/edit
curl -F 'data=@remote.html' http://$IP/edit
curl -F 'data=@style.css' http://$IP/edit
curl -F 'data=@syncofs.html' http://$IP/edit
curl -F 'data=@upload.sh' http://$IP/edit
curl -F 'data=@wifi-updated.html' http://$IP/edit
curl -F 'data=@wifi.html' http://$IP/edit

If the above commands don't work, try removing the single apostrophes around the filename, there seems to be some discrepancies in Curl formatting between Linux and the version included in Windows 10 command prompt. Example: curl -F data=@wifi.html http://$IP/edit

Replace $IP with 192.168.4.1

Flashing Process for GS450H

Part 1 : Software and IDE.

https://www.arduino.cc/en/software

I've tested this on 1.8.13 so go ahead and grab that and install.

Next you will need to add the ESP8266 to your boards manager.

Tutorial here : https://randomnerdtutorials.com/how-to-install-esp8266-board-arduino-ide/

Go ahead and do that.

Download the WiFi package from my Github :

https://github.com/damienmaguire/Lexus-GS450H-Inverter-Controller/tree/master/WiFi

Copy it to your Arduino sketch directory. Close and reopen Arduino, go to file, sketchbook and it should show up.

Go ahead and open it.

Now you need the correct libraries which is where the fun starts as they are a hot mess in Arduino these days.

I uploaded mine to the repo :

https://github.com/damienmaguire/Lexus-GS450H-Inverter-Controller/tree/master/Software/Libraries

Grab those and unzip both files to your /Arduino/libraries directory.

Next up go to tools and setup your board exactly as shown in the picture.

Close and reopen Arduino then hit the tick box to compile. If you did everything right it will just compile.

Part 2 : programming method.

You will need a 3v3 level FTDI cable :

https://www.mouser.ie/ProductDetail/FTDI/TTL-232R-3V3/?qs=Xb8IjHhkxj627GFcejHp0Q==

Yes you can use others, no I have no idea if they will work. This is the one I use.

Wire it as per the the attached diagram.

Now, to program the module you need to desolder the GPIO0 jumper and move it to the "0" position.

Back to tools and select your com port.

Click the upload icon (right facing arrow).

When upload is done, unplug and replug the WiFi module from the FTDI cable but do not unplug the USB end from the computer.

Back to tools and click "esp8266 sketch data upload".

when done remove the module and resolder the GPIO0 jumper back to position "1".

Congratulations its now programmed.

Precompiled binaries (similar to step 3 shortcut in the tutorial above)

attached the compiled binaries for use with the WEMOS D1 Mini, including the SPIFFS filesystem .bin

the SSID is "GS450H-VCU" and the WiFi password is `inverter123`

https://openinverter.org/forum/download/file.php?id=9051

https://openinverter.org/forum/download/file.php?id=9050


Common Issues

  • If experiencing connection issues, try different cables to rule out bad connectors ( apparently common with recent Olimex)
    The settings & partition size in Arduino Studio are easy to get wrong. [1]
  • If you get any of: 1) incomplete responses via HTTP 2) patchy WiFi on a logic board 3) parameters from logic board not loading in web interface; you can try powering the ESP8266 from a different source, or connect it via DuPont leads to rule out connector & plug issues (see photographs).
  • If you are all out of luck, there are alternative boards discussed here [2]