Olimex MOD-WIFI-ESP8266

From openinverter.org wiki
Revision as of 13:38, 5 May 2021 by Janosch (talk | contribs)
Jump to navigation Jump to search

The Olimex MOD-WIFI-ESP8266 WiFi expansion module is commonly used to provide WiFi connectivity and interface for several inverter controllers including the openinverter system. This module connects to the controllers via the UEXT header connector.

Flashing Process Overview (e.g for Tesla Charger)

Esp8266-flash.png

1. solder GPIO0 to 0

2. Install & open arduinoi and setup the code from https://github.com/jsphuebner/esp8266-web-interface

3. Flash the code (see below)

4. re-soldered GPIO0 to 1


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 detail

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

3.1. Download latest 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. Inside Arduino IDE install ESP8266

- open the Preferences window

- enter https://arduino.esp8266.com/stable/pack ... 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 are in the pic

3.4. Install ESP8266 Filesystem Uploader

- Download https://github.com/esp8266/arduino-esp8 ... n/releases python support files

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

- restart Arduino for changes to come into effect

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

- put the code in the same dir as the ino file, default FSBrowser

- make another dir Data inside first and copy everything here again (i am not sure which files are correct, so i just copy them again) this are the SPIFFS

3.6. 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 and go to http://192.168.4.1/ to set your wifi settings inside 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:

curl -F 'data=@index.js' http://$IP/edit

curl -F 'data=@log.js' http://$IP/edit

curl -F 'data=@inverter.js' http://$IP/edit

curl -F 'data=@index.html' http://$IP/edit

curl -F 'data=@log.html' http://$IP/edit

curl -F 'data=@wifi.html' http://$IP/edit

curl -F 'data=@wifi-updated.html' http://$IP/edit

curl -F 'data=@ajax-loader.gif' http://$IP/edit

curl -F 'data=@refresh.png' http://$IP/edit

curl -F 'data=@style.css' http://$IP/edit

curl -F 'data=@gauges.html' http://$IP/edit

curl -F 'data=@gauges.js' http://$IP/edit

curl -F 'data=@gauge.min.js.gz' http://$IP/edit

curl -F 'data=@chart.min.js.gz' http://$IP/edit

Replace $IP with 192.168.4.1

Flashing Process for GS450H

Part 1 : Lets all use the same 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 : Lets all use the same 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.