Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual feedback when comms between esp8266 and OI board is not working #23

Open
chrskly opened this issue Jan 19, 2024 · 10 comments
Open

Comments

@chrskly
Copy link
Contributor

chrskly commented Jan 19, 2024

User MattsAwesomeStuff pointed out in this post that it can sometimes not be apparent (especially to people new to the OI world) that communication between the esp8266 board (or whatever is providing the web interface) and the actual OI board itself is not working. It would be good to have some visual indication of this in the interface itself.

I've done a bit of work on the web stuff in the past, so I'm happy to take the on myself. Just logging an issue here to try and follow a clear process :)

@uhi22
Copy link

uhi22 commented Jan 19, 2024

Maybe show the number of transmitted and received messages, to give the user the chance to see what is happening.
BTW: the esp32 web interface lives in a separate repository, are both maintained? I think it makes sense to have the feature in both variants.

@chrskly
Copy link
Contributor Author

chrskly commented Jan 20, 2024

All good suggestions here, thanks @uhi22

I'll get something implemented on esp8266 and then to a separate MR for the esp32 👍

@chrskly
Copy link
Contributor Author

chrskly commented Jan 23, 2024

Edit : actually, I should put this over on the forum really.

Still working on this, but here's roughly what I'm thinking in case anyone has any thoughts. If we fail to fetch data from the STM, then this red notice pops up. It goes away on recovery.

oi-comms-error

@chrskly
Copy link
Contributor Author

chrskly commented Jan 24, 2024

PR submitted : #24

@jsphuebner
Copy link
Owner

I added it to ESP32 as well.
I noticed in didn't trigger so I moved it to onreadystatechange
jsphuebner/esp32-web-interface@c1ed0df

Maybe that is more universal?

@uhi22
Copy link

uhi22 commented Feb 20, 2024

tested the latest esp32-web-interface, can-backend branch. I do not get the red error bar, no matter what I do.

[Edit] The upload of the new files (e.g. ui.js) via the web interface and via
$ curl -F 'data=@ui.js' http://inverter.local/edit
seems to work at first look, but the file on the controller does not change. In my case, it still showed version 2.1. After deleting the file via the web interface (then the web interface is broken), and uploading via curl the 2.2 was there. I guess I need to do the same procedure for the other changed files, too.
At the moment, I get the red bar, when the esp is turned-off for ~20s. Doesn't look like intended.

@jsphuebner
Copy link
Owner

jsphuebner commented Feb 20, 2024

Do you get it when selecting an invalid node id?
To be honest that was my only test. Will expand

Edit: uploading via web interface worked for me but you have to Ctrl+F5 because the ESP sends a superficial 1-day caching time

@uhi22
Copy link

uhi22 commented Feb 21, 2024

My test case:
Precondition: Foccci running, Web interface on spot values, auto-reload, everything live. Webinterface shows correct version 2.2 after cleaning the browser cache. Windows 10, Edge.
Action: Turn-off Foccci, wait 1 minute
Expected: Red bar after 2 seconds.
Observed: No red bar, even after one minute. --> FAIL.
Action: Turn-off ESP32.
Expected: Red bar after 2 seconds.
Observed: Red bar after ~20s. It says connection between ESP and STM was lost. But this is not true. The web interface itself is down. --> FAIL

@jsphuebner
Copy link
Owner

Now checking for CAN comms while fetching values via SDO. Explicitly returning error 500.

When turning off power to the ESP32 you still get the "between STM and ESP" message though, haven't found out how to check for network error and display something more appropriate

@uhi22
Copy link

uhi22 commented Feb 21, 2024

I do not know the overall concept, so just dreaming: In the browser (javascript), there is a timer which is started as soon as data is requested from the ESP, and expires after 200ms. If no response arrived during this time, then show the error bar with the content "no response from ESP".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants