Olimex MOD-WIFI-ESP8266: Difference between revisions

From openinverter.org wiki
Jump to navigation Jump to search
No edit summary
 
(32 intermediate revisions by 6 users not shown)
Line 1: Line 1:
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.
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.  


=== Flashing Process Overview (e.g for Tesla Charger) ===
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.
[[File:Esp8266-flash.png|thumb]]
1. solder GPIO0 to 0


2. Install & open arduinoi and setup the code from <nowiki>https://github.com/jsphuebner/esp8266-web-interface</nowiki>
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.


3. Flash the code (see below)
Below we include an example of how you might want to flash a module.


4. re-soldered GPIO0 to 1
=== Flashing Process Overview ===
[[File:Esp8266-flash.png|thumb]]By default, when the module powers up it will be in FLASH boot mode (counterintuitively, this means the device will run code in its flash memory, not that the device is ready to be flashed). To flash code onto the module, it must be set instead into in UART boot mode. It's important to note, as the name implies, "boot modes" are set at boot (i.e. when the device is powered on), so they cannot be changed while when the device is running. To set the UART boot mode, hold the small pushbutton on the top side of the module down while you plug it in, this holds GPIO0 to ground and is the same process as the much-hated setting modes via solder blobs, but without the hassle. Unlike the solder blobs, which holds GPIO0 low until the blob is moved, you don't have to keep the pushbutton held down, so after plugging in the device with the button pushed, you can release it.


==== Quick Method ====
''*This may be deprecated as the bin linked below hasn't been updated in some time*''


See a new unprotected wifi & connect,
Get ESP Tool https://raw.githubusercontent.com/espressif/esptool/master/esptool.py


access web interface at IP 192.168.4.1
Get single binary which flashes both the firmware and SPIFFS contents: https://openinverter.org/forum/download/file.php?id=9167


====== Step 3 shortcut ======
Flash binary using the following command:
https://raw.githubusercontent.com/espressif/esptool/master/esptool.py


https://openinverter.org/forum/download/file.php?id=9167
<code>python esptool.py --port COM<your-port-here> --baud 115200 write_flash 0x0 FSBrowser.ino.modwifi.bin</code>


<code>python esptool.py --port COM1 --baud 115200 write_flash 0x000000 FSBrowser.ino.modwifi.bin</code>
==== Full Method ====
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.


====== Step 3 detail ======
1. Download the Arduino IDE and install it to PC
https://openinverter.org/forum/viewtopic.php?p=4928#p4928


3.1. Download latest Arduino IDE and install it to PC
2. Buy a Wemos 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.2. Buy a Weimos D1 mini ESP8266 board with FTDI and get CH340 driver from <nowiki>https://www.wemos.cc/en/latest/d1/d1_mini.html</nowiki> (or use Olimex)
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.3. Inside Arduino IDE install ESP8266  
4. Inside Arduino IDE install ESP8266  


- open the Preferences window
- open the Preferences window


- enter <nowiki>https://arduino.esp8266.com/stable/pack</nowiki> ... index.json into the Additional Board Manager URLs
- 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 are in the pic
- 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
[[File:Settings.jpg|alt=Arduino IDE settings for Wemos D1 mini board|thumb|Arduino IDE settings for Wemos D1 mini board]]


3.4. Install ESP8266 Filesystem Uploader
5. Install ESP8266 Filesystem Uploader


- Download <nowiki>https://github.com/esp8266/arduino-esp8</nowiki> ... n/releases python support files
- Download https://github.com/esp8266/arduino-esp8266fs-plugin/releases python support files


- extract file to Arduino IDE tools folder like you see here <nowiki>https://randomnerdtutorials.com/install</nowiki> ... duino-ide/
- 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
- restart Arduino for changes to come into effect


3.5. Download Johannes Web interface code here: <nowiki>https://github.com/jsphuebner/esp8266-web-interface</nowiki>
6. 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 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’)


- 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
- 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.6. Connect board to USB and select correct COM port and rest of settings
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
 
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
- if you used a new board you have to select "erase flash: sketch + wifi settings" so the board will erase its password
Line 60: Line 69:
- select tools/ESP8266 sketch data upload and wait for the board to reset
- select tools/ESP8266 sketch data upload and wait for the board to reset


- connect to the board and go to <nowiki>http://192.168.4.1/</nowiki> to set your wifi settings inside interface
- connect to the board’s WiFi network then go to <nowiki>http://192.168.4.1/</nowiki> to see the web interface


====== Wifi doesn't show up ======
- remember set up your own wifi name and password for the interface
- in arduino studio Tools -> Serial Monitor gives debug info of the chip. If the Serial Monitor says "<code>Unknown command sequence"</code> 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
==== Troubleshooting ====


====== FileNotFound Error in WebInterface ======
===== WiFi doesn't show up =====
Upload the files from the repository <nowiki>https://github.com/jsphuebner/esp8266-web-interface</nowiki> with below command:<blockquote>curl -F 'data=@index.js' <nowiki>http://$IP/edit</nowiki>
- in Arduino studio Tools -> Serial Monitor gives debug info of the chip. If the Serial Monitor says "<code>Unknown command sequence"</code> you need to change the TTL


curl -F 'data=@log.js' <nowiki>http://$IP/edit</nowiki>
- if GPIO0 is not resoldered, the chip is in programming mode and will not boot from the flash code
 
curl -F 'data=@inverter.js' <nowiki>http://$IP/edit</nowiki>
 
curl -F 'data=@index.html' <nowiki>http://$IP/edit</nowiki>
 
curl -F 'data=@log.html' <nowiki>http://$IP/edit</nowiki>
 
curl -F 'data=@wifi.html' <nowiki>http://$IP/edit</nowiki>
 
curl -F 'data=@wifi-updated.html' <nowiki>http://$IP/edit</nowiki>
 
curl -F 'data=@ajax-loader.gif' <nowiki>http://$IP/edit</nowiki>
 
curl -F 'data=@refresh.png' <nowiki>http://$IP/edit</nowiki>


curl -F 'data=@style.css' <nowiki>http://$IP/edit</nowiki>
===== FileNotFound Error in WebInterface =====


curl -F 'data=@gauges.html' <nowiki>http://$IP/edit</nowiki>
Upload the files from the repository <nowiki>https://github.com/jsphuebner/esp8266-web-interface</nowiki> with below command:<blockquote><syntaxhighlight lang="bash">
#!/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
</syntaxhighlight>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.


curl -F 'data=@gauges.js' <nowiki>http://$IP/edit</nowiki>
Example: curl -F data=@wifi.html <nowiki>http://$IP/edit</nowiki></blockquote>Replace $IP with 192.168.4.1
 
curl -F 'data=@gauge.min.js.gz' <nowiki>http://$IP/edit</nowiki>
 
curl -F 'data=@chart.min.js.gz' <nowiki>http://$IP/edit</nowiki></blockquote>Replace $IP with 192.168.4.1


=== Flashing Process for GS450H ===
=== Flashing Process for GS450H ===
Part 1 : Lets all use the same software and ide.


==== Part 1: Software and IDE. ====
<nowiki>https://www.arduino.cc/en/software</nowiki>
<nowiki>https://www.arduino.cc/en/software</nowiki>


Line 109: Line 125:
Go ahead and do that.
Go ahead and do that.


Download the wifi package from my Github :  
Download the WiFi package from my Github :  


https://github.com/damienmaguire/Lexus-GS450H-Inverter-Controller/tree/master/WiFi
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.
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.
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.
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 :
I uploaded mine to the repo :
Line 127: Line 143:
Next up go to tools and setup your board exactly as shown in the picture.
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.
Close and reopen Arduino then hit the tick box to compile. If you did everything right it will just compile.


 
==== Part 2: programming method. ====
Part 2 : Lets all use the same programming method.
You will need a 3v3 level FTDI cable:
 
You will need a 3v3 level ftdi cable :


https://www.mouser.ie/ProductDetail/FTDI/TTL-232R-3V3/?qs=Xb8IjHhkxj627GFcejHp0Q==
https://www.mouser.ie/ProductDetail/FTDI/TTL-232R-3V3/?qs=Xb8IjHhkxj627GFcejHp0Q==
Line 142: Line 156:
Now, to program the module you need to desolder the GPIO0 jumper and move it to the "0" position.
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.
Back to tools and select your COM port.


Click the upload icon (right facing arrow).
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.
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".
Back to tools and click "esp8266 sketch data upload".


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


Congratulations its now programmed.
Congratulations, it's now programmed.


====== Precompiled binaries (similar to step 3 shortcut in the tutorial above) ======
==== 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
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`''
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=9051


https://openinverter.org/forum/download/file.php?id=9050
https://openinverter.org/forum/download/file.php?id=9050
=== Common Issues ===
[[File:ESP8266 communication with DuPont jump leads and without.png|thumb|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. [https://openinverter.org/forum/viewtopic.php?p=29523#p29523]
* 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 [https://openinverter.org/forum/viewtopic.php?t=2299]
[[Category:OpenInverter]] [[Category:ESP8266]]

Latest revision as of 12:41, 20 February 2025

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

Esp8266-flash.png

By default, when the module powers up it will be in FLASH boot mode (counterintuitively, this means the device will run code in its flash memory, not that the device is ready to be flashed). To flash code onto the module, it must be set instead into in UART boot mode. It's important to note, as the name implies, "boot modes" are set at boot (i.e. when the device is powered on), so they cannot be changed while when the device is running. To set the UART boot mode, hold the small pushbutton on the top side of the module down while you plug it in, this holds GPIO0 to ground and is the same process as the much-hated setting modes via solder blobs, but without the hassle. Unlike the solder blobs, which holds GPIO0 low until the blob is moved, you don't have to keep the pushbutton held down, so after plugging in the device with the button pushed, you can release it.

Quick Method

*This may be deprecated as the bin linked below hasn't been updated in some time*

Get ESP Tool https://raw.githubusercontent.com/espressif/esptool/master/esptool.py

Get single binary which flashes both the firmware and SPIFFS contents: https://openinverter.org/forum/download/file.php?id=9167

Flash binary using the following command:

python esptool.py --port COM<your-port-here> --baud 115200 write_flash 0x0 FSBrowser.ino.modwifi.bin

Full Method

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.

1. Download the Arduino IDE and install it to PC

2. Buy a Wemos 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. 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.

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

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

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 )

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

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

Troubleshooting

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, it's 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]