# Building openEVSE wifi gui

**URL:** <https://community.openenergymonitor.org/t/building-openevse-wifi-gui/13339>\
**Category:** Getting Started\
**Created:** [17 February 2020 18:00 UTC](https://community.openenergymonitor.org/t/building-openevse-wifi-gui/13339 "2020-02-17T18:00:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ffreddy](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/f/b782af/32.png) [@ffreddy](https://community.openenergymonitor.org/u/ffreddy)\
**Post date:** [17 February 2020 18:00 UTC](https://community.openenergymonitor.org/t/building-openevse-wifi-gui/13339/1 "2020-02-17T18:00:09Z")

</div>

I fancied rebuilding the OpenEVSE WIFI GUE so I could customise it.

git clone [GitHub - OpenEVSE/ESP8266\_WiFi\_v2.x: ESP8266 WiFi for OpenEVSE Version 2.x](https://github.com/OpenEVSE/ESP8266_WiFi_v2.x)  
cd ESP8266\_WiFi\_v2.x  
git submodule update –init  
cd gui  
npm install  
npm build

Now using Arduino IDE to compile I get

> Error compiling:  
> In file included from sketch\web\_server\_static.cpp:14:0:  
> sketch\web\_static/web\_server\_static\_files.h:1:34: fatal error: web\_server.assets.js.h: No such file or directory  
> #include "web\_server.assets.js.h

However using [Platform.io](http://Platform.io) I get

```
*** [src\web_static\web_server.emoncms.jpg.h] TypeError : ord() expected a character, but string of length 0 found
Traceback (most recent call last):

  File "C:\Users\fred\.platformio\packages\tool-scons\script\..\engine\SCons\Action.py", line 1209, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "D:\OPENENERGYMONITOR\ESP8266_WiFi_v2.x\scripts\extra_script.py", line 61, in data_to_header
    output += binary_to_header(file)
  File "D:\OPENENERGYMONITOR\ESP8266_WiFi_v2.x\scripts\extra_script.py", line 42, in binary_to_header
    output += "0x{:02x}, ".format(ord(byte))
TypeError: ord() expected a character, but string of length 0 found
*** [src\web_static\web_server.favicon-16x16.png.h] TypeError : ord() expected a character, but string of length 0 found
Traceback (most recent call last):
  File "C:\Users\fred\.platformio\packages\tool-scons\script\..\engine\SCons\Action.py", line 1209, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "D:\OPENENERGYMONITOR\ESP8266_WiFi_v2.x\scripts\extra_script.py", line 61, in data_to_header
    output += binary_to_header(file)
  File "D:\OPENENERGYMONITOR\ESP8266_WiFi_v2.x\scripts\extra_script.py", line 42, in binary_to_header
    output += "0x{:02x}, ".format(ord(byte))
TypeError: ord() expected a character, but string of length 0 found
*** [src\web_static\web_server.favicon-32x32.png.h] TypeError : ord() expected a character, but string of length 0 found
Traceback (most recent call last):
  File "C:\Users\fred\.platformio\packages\tool-scons\script\..\engine\SCons\Action.py", line 1209, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "D:\OPENENERGYMONITOR\ESP8266_WiFi_v2.x\scripts\extra_script.py", line 61, in data_to_header
    output += binary_to_header(file)
  File "D:\OPENENERGYMONITOR\ESP8266_WiFi_v2.x\scripts\extra_script.py", line 42, in binary_to_header
    output += "0x{:02x}, ".format(ord(byte))
TypeError: ord() expected a character, but string of length 0 found
*** [src\web_static\web_server.assets.js.h] AttributeError : 'str' object has no attribute 'decode'
Traceback (most recent call last):
  File "C:\Users\fred\.platformio\packages\tool-scons\script\..\engine\SCons\Action.py", line 1209, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "D:\OPENENERGYMONITOR\ESP8266_WiFi_v2.x\scripts\extra_script.py", line 59, in data_to_header
    output += text_to_header(file)
  File "D:\OPENENERGYMONITOR\ESP8266_WiFi_v2.x\scripts\extra_script.py", line 26, in text_to_header
    original = source_fh.read().decode('utf-8')
AttributeError: 'str' object has no attribute 'decode'

```

Can anybody throw any light on these errors?  
I’m obviously missing something 😬

---

<div class="post-metadata">

**Author:** ![jeremypoulter](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jeremypoulter/32/1006_2.png) [@jeremypoulter](https://community.openenergymonitor.org/u/jeremypoulter)\
**Post date:** [17 February 2020 23:29 UTC](https://community.openenergymonitor.org/t/building-openevse-wifi-gui/13339/2 "2020-02-17T23:29:37Z")

</div>

Rebuilding the UI is only really supported on Platform IO as the scripts that convert the HTML/JS/etc to files to embed in the firmware are Python 3 and part of the Platform IO build process.

I think the errors you are getting from Platform IO are due to running Platform IO with Python 2 not Python 3. FYI the changes for Python 3 are [here](https://github.com/OpenEVSE/ESP32_WiFi_V3.x/commit/56c57661dba08536e22bf04b04c0840229ab232a#diff-f94b7b3fa0e4d4675cd4938f32b40033), should be easy to revert if it is not practical to upgrade to Python 3 (but you really, really should)

---

<div class="post-metadata">

**Author:** ![ffreddy](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/f/b782af/32.png) [@ffreddy](https://community.openenergymonitor.org/u/ffreddy)\
**Post date:** [18 February 2020 09:02 UTC](https://community.openenergymonitor.org/t/building-openevse-wifi-gui/13339/3 "2020-02-18T09:02:37Z")

</div>

Thanks for getting back to me - Noted re: Platform IO

I am running Python 3.8.1 but on windows 10 v1909, if that makes a difference.  
Maybe it only compiles on Linux?

F

---

<div class="post-metadata">

**Author:** ![ffreddy](https://community.openenergymonitor.org/letter_avatar_proxy/v4/letter/f/b782af/32.png) [@ffreddy](https://community.openenergymonitor.org/u/ffreddy)\
**Post date:** [18 February 2020 10:00 UTC](https://community.openenergymonitor.org/t/building-openevse-wifi-gui/13339/4 "2020-02-18T10:00:55Z")

</div>

Update! Works OK on Linux…

Just would have been nice to use a gui on windows rather than a ssh session…

---

<div class="post-metadata">

**Author:** ![jeremypoulter](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jeremypoulter/32/1006_2.png) [@jeremypoulter](https://community.openenergymonitor.org/u/jeremypoulter)\
**Post date:** [18 February 2020 19:48 UTC](https://community.openenergymonitor.org/t/building-openevse-wifi-gui/13339/5 "2020-02-18T19:48:35Z")

</div>

Hum… I only made the Python 3 changes for the ESP32 version… oops, will apply to the ESP8266 version.

---

<div class="post-metadata">

**Author:** ![jeremypoulter](https://community.openenergymonitor.org/user_avatar/community.openenergymonitor.org/jeremypoulter/32/1006_2.png) [@jeremypoulter](https://community.openenergymonitor.org/u/jeremypoulter)\
**Post date:** [18 February 2020 21:46 UTC](https://community.openenergymonitor.org/t/building-openevse-wifi-gui/13339/6 "2020-02-18T21:46:24Z")

</div>

I have made a [PR](https://github.com/OpenEVSE/ESP8266_WiFi_v2.x/pull/256) with the Python 3 changes to match ESP32. should fix your windows build, but probably break the Linux build as that must be Python 2 (may be installed in Platform IO’s virtual env)
