evcc icon indicating copy to clipboard operation
evcc copied to clipboard

New UI does not automatically refresh after longer period inactivity

Open hyperbart opened this issue 2 years ago • 14 comments

Describe the bug

I have EVCC as a "web app" on the homescreen of iOS (https://www.makeuseof.com/tag/add-website-shortcuts-iphone-home-screen/).

However, after a longer period of time (+12h) when you open the EVCC app it does not update the values anymore and the buttons for the charging points (stop/now/min/pv) also don't work.

If I force close the "app" and restart it the values are updating again

Steps to reproduce

Install EVCC Add EVCC local website to your homescreen on iOS (https://www.makeuseof.com/tag/add-website-shortcuts-iphone-home-screen/) Launch EVCC "app" Wait +12h Launch EVCC "app"

Configuration details

interval: 1s

site:
- title: Allspark
  meters:
    grid: HuisMeter
    pvs:
    - pvHuis
    - pvTuinHuis
  residualpower: 100

messaging:
  events:
    start:
      title: Laadbeurt gestart
      msg: Er is een laadbeurt gestart op xxxx
    stop:
      title: Laadbeurt gestopt
      msg: |
        Oplader {{.title}} heeft een laadbeurt voltooid
        Er is {{round (divf .chargedEnergy 1000) 2 }} kWh geleverd op {{.chargeDuration}}.
    connect:
      title: Wagen aangesloten op xxx
      msg: Er is een auto aangesloten op de lader in xxxx
    disconnect:
      title: Wagen ontkoppeld op xxxx
      msg: De wagen is ontkoppeld van de lader in xxxxx
  services:
    - type: telegram
      token: xxxxxxx:xxxxxxxxxxxxxxxxxxxx
      chats:
        - -xxxxxxx

tariffs:
  currency: EUR # (default EUR)
  grid:
    # static grid price
    type: fixed
    price: 0.28 # [currency]/kWh

  feedin:
    # rate for feeding excess (pv) energy to the grid
    type: fixed
    price: 0.12 # [currency]/kWh

meters:
  - name: HuisMeter
    type: modbus
    model: sdm # specific non-sunspec meter
    id: 1
    energy: Sum # only required for charge meter usage
    #via TCP:
    uri: 192.168.4.184:8899
    rtu: false # serial modbus rtu (rs485) device connected using simple ethernet adapter
  - name: pvHuis
    type: sma
    uri: 192.168.4.230
    password: xxxxxx
  - name: pvTuinHuis
    type: sma
    uri: 192.168.4.231
    password: xxxxxx


sponsortoken: xxxxxx

log: debug
levels:
    core: debug

influx:
  url: http://192.168.y.x:xxxx
  database: EVCC
  token: "xxxxxxxx=="
  org: "xxxxx"

chargers:
- name: ChargingPointAlfen
  type: alfen
  uri: 192.168.4.178 # TCP ModBus address

loadpoints:
- title: Alfen # display name for UI
  charger: ChargingPointAlfen # Wallbox Referenz
  vehicles:
  mode: now # charge mode (off, now, minpv, pv)
  phases: 3
  mincurrent: 6
  maxcurrent: 16

vehicles:

Log details

/

What type of operating system are you running?

Linux

Version

No response

hyperbart avatar May 25 '22 10:05 hyperbart

Thanks for the issue. I've noticed similar effects from time to time - even with the previous design. I'll try to reliably recreate this issue to come up with a solid fix. If you're able to reproduce it (without waiting > 12h) please let me know 😁.

naltatis avatar May 25 '22 10:05 naltatis

@naltatis with the previous GUI I didn't notice it as to be a thing with EVCC, because I went out of the house, lost connection etc, but even then I didn't experience it (or maybe once that I still know of), but now with the new GUI it's every morning or evening.

hyperbart avatar May 25 '22 11:05 hyperbart

I thought it only depends on browser cashing ? I simply refresh the page, no need to force close it

RTTTC avatar May 25 '22 12:05 RTTTC

If anything it would probably be the reconnect of the websocket connection. Haven't found any way to replicate it though.

andig avatar May 25 '22 17:05 andig

I thought it only depends on browser cashing ? I simply refresh the page, no need to force close it

You are not reproducing the issue: if you create a shortcut on home screen and you open it the browser controls are not shown: You can’t refresh

hyperbart avatar May 26 '22 22:05 hyperbart

👆 I've introduces a dedicated offline indicator. It will help debug this issue but is also a general improvement since evcc usually only works in your lokal network.

naltatis avatar May 27 '22 07:05 naltatis

The PR is merged and the code will be part of todays nightly build. Would be great if you could install and test it. Maybe the changes already solve some issues.

naltatis avatar May 27 '22 13:05 naltatis

The PR is merged and the code will be part of todays nightly build. Would be great if you could install and test it. Maybe the changes already solve some issues.

@naltatis , sure. I am running EVCC in a Docker environment. Haven't used/built the nightly builds before. How do I instruct my Docker to take the latest nightly?

hyperbart avatar May 28 '22 20:05 hyperbart

:nightly

andig avatar May 28 '22 20:05 andig

@naltatis : installed the nightly, verified if the "cloudy icon and no connection to server" popped up by disabling wifi, works as expected.

Couple of hours later: EVCC "webpage app on homescreen" hangs (no updates) but the notification does not appear. So I have the issue but the no connection notification is not popping up.

hyperbart avatar May 29 '22 14:05 hyperbart

Ok, so I guess we don't have a networking/reconnect issue. It seems likely that the web app hags due to some other problem.

@hyperbart Do you have a Mac? If yes it would help if you could USB-connect you iPhone to you Mac in this "hanging"-situation to extract browser logs via macOS Safari.

Here is an good description on how to do that: Method 1 https://www.browserstack.com/guide/how-to-debug-on-iphone

I hope there will be some useful information in the Konsole and Network tab that can help me understand the problem.

naltatis avatar May 30 '22 07:05 naltatis

Another data point that might be interesting:

Due to my main inverter problems I get no connection to it, so grid meter and one pv meter is not working, constant flow of errors in GUI. EVCC also now shows "no connection to server" , yet I know there is a good connection to server (raspberry) since I can see data from my other inverter "pv meter" changing.

RTTTC avatar May 30 '22 11:05 RTTTC

Ok, so I guess we don't have a networking/reconnect issue. It seems likely that the web app hags due to some other problem.

@hyperbart Do you have a Mac? If yes it would help if you could USB-connect you iPhone to you Mac in this "hanging"-situation to extract browser logs via macOS Safari.

Here is an good description on how to do that: Method 1 https://www.browserstack.com/guide/how-to-debug-on-iphone

I hope there will be some useful information in the Konsole and Network tab that can help me understand the problem.

No, sorry, no Mac available here.

hyperbart avatar May 31 '22 09:05 hyperbart

Mir ist das heute seit langer Zeit mal wieder passiert, gleich 2x. Ich schau mal, ob ich an die Logs komme...

UPDATE

evcc läuft, es gibt regelmäßige Requests auf health, allerdings keine WS Updates mehr:

Screenshot 2022-06-19 at 12 27 07 Screenshot 2022-06-19 at 12 31 38

andig avatar Jun 19 '22 10:06 andig

Ich mach hier mal zu- gerne wieder auf wenn wir neue Erkenntnisse haben.

andig avatar Aug 25 '22 16:08 andig

Hallo Alle, bei mir läuft die Nightly seit dem MR nun problemfrei durch. Ich hatte keine steckengebliebenen Werte mehr und musste auch seitdem die Homescreen-App nicht wieder abschießen weil sie nicht mehr reagierte oder nur weiß angezeigt hat. Habt ihr ähnliche Erfahrungen gemacht?

naltatis avatar Sep 04 '22 14:09 naltatis

@naltatis : same experiences here, your MR seems to have fixed the issue, good job.

hyperbart avatar Sep 05 '22 13:09 hyperbart