KipK / openevse-gui-v2

OpenEVSE WiFi Gateway User Interface (V2)
BSD 2-Clause "Simplified" License
5 stars 2 forks source link

Needs some feedback for first release candidate #17

Closed KipK closed 1 year ago

KipK commented 1 year ago

EDIT: rc2 https://github.com/KipK/openevse-gui-v2/releases/tag/1.0.0-rc2

I know have a stable ( I hope ) polished version for latest UI as https://github.com/KipK/openevse-gui-v2/releases/tag/1.0-rc1

please [@fhteagle ] [@jeremypoulter] can you give a test and reports back ?

Hope you'll like it.

To do for rc2;

Time & Charge Limits are disabled for now until proper API integration on EVSE firmware

KipK commented 1 year ago

[@jeremypoulter] what are the requirements for the Wifi Portal Version ?

I'm thinking about doing a step by step configuration process.

Also I'd like to display firmware udates to the UI and use http ota ( I see you've alreadty implemented it on firmware), but we can't use github api directly as it requires https and fails with multiple redirects for what I've tested. Could you setup a wrapper on openevse.com ?

jeremypoulter commented 1 year ago

Would be nice to have a sort of wizard that takes you through setting up the (hardware/install) max current, connects to the WiFi (or reports that ethernet is connected) and finally allows the firmware to be updated. Yes ideally this would be from GitHub, HTTPS shouldn't be a problem, it is just the redirects, need to ideally just handle these, either generically in ArduinoMongose or specifically for the update.

KipK commented 1 year ago

Yes that's what I want to do there. Only a simple wizard and no charge feature . So we set max_current_hard and mx_current_soft using the same value, then Wifi/Ethernet ( Remind me , I have not done the Ethernet configuration parts for fixed IP ), then firmware update. I can catch the latest release on GitHub, but can't download it yet using the http download ota actually implemented. There's probably some change to do on the ArduinoMongoose lib first . It was working fine with http direct links hosted somewhere else. I have not tried with asyncTCP lib For now we can display the download link .

jeremypoulter commented 1 year ago

max_current_hard may not actually be implemented yet, but this is a write once value that sets the absolute maximum value, you can then adjust max_current_soft up to that value. This is mainly for the American market where the EVSE can handle up to 80A but will be installed with different wiring, etc and will likely not be able to supply the full 80A. For now we just set the soft value.

For wired it is just a case of detecting that the connection is wired and displaying that a message instead of the WiFi config.

I did do some testing of GitHub OTA and it works if you manually do the redirect, so just need to implement something to do that.

KipK commented 1 year ago

I did do some testing of GitHub OTA and it works if you manually do the redirect, so just need to implement something to do that.

Do you still have a bunch of code somewhere on how you did that?

jeremypoulter commented 1 year ago

There are some examples in https://github.com/OpenEVSE/ESP32_WiFi_V4.x/blob/master/test/update.http, all I did to make it work was use cURL to get the actual URL

KipK commented 1 year ago

and for the ethernet module, what would be the condition to display the wizard ? I see you use AP mode only for wifi modules.

There are some examples in https://github.com/OpenEVSE/ESP32_WiFi_V4.x/blob/master/test/update.http, all I did to make it work was use cURL to get the actual URL Ho, I did that alrezdy, but I have no idea how to bypass that on esp side ( but using a node.js wrapper )

edit: stupid me , i can do that on js side .. edit2: not sure it can work, I'm fighting CORS problem when requesting the fileurl to get the redirect response. If I use no-cors, I can't then have the response of the fetch api but I can get the blob. Edit3: I think I'll bypass that by downloading the binary blob on client side in an object and submitting it to the ota form. All client side but should works edit4: failed. using no-cors seems javascript has no access to the blob so it's useless. Can't do that on client side.

KipK commented 1 year ago

I think max_currznt_hard is implemented , I remember I've fucked up my openevse by setting it to 6A while testing, and then had to reflash to Atmega firmware then. :)

Le ven. 16 déc. 2022, 19:55, Jeremy Poulter @.***> a écrit :

max_current_hard may not actually be implemented yet, but this is a write once value that sets the absolute maximum value, you can then adjust max_current_soft up to that value. This is mainly for the American market where the EVSE can handle up to 80A but will be installed with different wiring, etc and will likely not be able to supply the full 80A. For now we just set the soft value.

For wired it is just a case of detecting that the connection is wired and displaying that a message instead of the WiFi config.

I did do some testing of GitHub OTA and it works if you manually do the redirect, so just need to implement something to do that.

— Reply to this email directly, view it on GitHub https://github.com/KipK/openevse-gui-v2/issues/17#issuecomment-1355424253, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADXKVNFYVAGLHKLOZL5NU3WNS3LNANCNFSM6AAAAAAS4CZJKM . You are receiving this because you authored the thread.Message ID: @.***>

KipK commented 1 year ago

@jeremypoulter , finally, there's no way I can do that on client side because of CORS issues with fetching binary from github. ( edited comments above )

I see in http_update.cpp line 30, the response code is catched here.

Can we catch the 302 redirect there and then get back to the if(response->respCode() == 200) ?

I'm not used to this moongoose library, if you see the quickest way to handle that

jeremypoulter commented 1 year ago

It is something I need to sit down and think about. Will try and take a look, would be great to get it done.

KipK commented 1 year ago

Everything is ready on client side so if you have something to test, please share :)

KipK commented 1 year ago

So It now displays if there's an udpate available: image

and then propose to download the file or direct upgrade from github release using http_update image

@jeremypoulter It works already ( until openevse response ), you can use it for testing if you works on it

KipK commented 1 year ago

Wizard is ok. It's handled on client side, and will redirect to wizard mode if mode is "AP" or "STA+AP" with SSID not configured like current implementation.

After Wifi connection, it will redirect the window to the wizard network page using new {hostname}.local url and displays the connection states. Next step is firmware update.

image image image image image

@jeremypoulter ? I have not found a correct condition to show the wizard for ethernet connection

Nows the wizard is handled in client side, there's no need of the path = String(net_wifi_mode_is_ap_only() ? WIFI_PAGE : HOME_PAGE); for the v2 UI, and we points now to index.html

KipK commented 1 year ago

I have pushed rc2 https://github.com/KipK/openevse-gui-v2/releases/tag/1.0.0-rc2 I think we can try this one on the firmware now.