-
Notifications
You must be signed in to change notification settings - Fork 25
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
Powerwall Firmware 22.18.6 Upgrade - Flashing Powerflow Animation #23
Comments
Ok, the fix is easy! The issue is that pypowerwall proxy caches the responses from the Powerwall, including the setup JS. You just need to restart the pypowerwall proxy server.py and refresh your browser: # if using a docker container
docker restart pypowerwall I'll have to look to see if there is an easy way to have the proxy detect version upgrades and flush the cache. |
I was gonna say, this looks like a caching issue. We might be able to inject some no-cache headers to prevent it from breaking. |
Thanks Dan! Did you happen to see this on your dakboard displays? I suspect this is going to be a rare occurrence. I'll see if there is something simple we can do. |
My powerwalls are offline this week because I'm adding another one so I didn't see it when the firmware update went out. However, I did see this behavior a couple times when I was developing the dashboard and it was a caching issue. I'll see what my dakboard does when my powerwalls come back online later this week. |
So I'm still on 20.18.3. I have a first gen gateway. When I check for updated firmware, says I'm up-to-date. Is there something special I can do to get the newer firmware? |
That's interesting! It doesn't seem like Tesla pushes out firmware versions globally. I suspect they have a digital twin of all of our configurations and only apply updates to those systems that need it, or at least the ones they want to "test" with. |
Flashing animation due to firmware upgrade raised in jasonacox/Powerwall-Dashboard#112. TODO: Research cause (browser or proxy cache) and solution (no-cache header and/or TTL). |
So there are two issues it seems:
To fix the browser cache, I added the "Cache-Control: no-cache" header to the non-API endpoints (ie. animation css, js, etc). To fix the local cache, based on some observations from @mcbirse in the discussion jasonacox/Powerwall-Dashboard#112, I made changes to the proxy server to detect when Powerwall Authentication happens (ie. auth token will change during a Firmware update) and then force clear the local cache. This all seemed to work and I noticed the browser would re-request all the assets when a browser reload was performed (did not happened before). I released Build t20 that contains this update (see diff). Now, I confess, I tend to over-engineer things. As I watched the debug log during my tests of t20, it occured to me that all the logic I added to provide a local cache was only being used on a browser reload. That is a rare event for a dashboard especially if you are rendering an animation. Removing the local cache removes the need to detect a firmware update. I pulled that code and new logic out and released Build t21 (see diff). I just need another Firmware upgrade to test this new code. Sadly, a firmware upgrade on my system just happened last night before I made these changes so I won't be able to test this for a while but I'll publish this update so others can report how well it works during firmware updates on their systems. I am going to continue to test the t21 code to ensure I didn't introduce any memory leaks before I update the "latest" tag (currently t19) with this new version (t21). |
As part of testing t21, I had an idea. It would be nice to be able to display the Powerwall firmware version or other data using some simple JQ calls. To support the CORS policy, the pypowerwall proxy also needs to set a "Access-Control-Allow-Origin: *" header. I added that and updated the example.html to include firmware version information in Build t22 (see diff): |
Great solution to this issue! Look forward to testing this and providing feedback... whenever my next firmware update happens. Maybe it won't be too long for me as mine hasn't updated to 22.26.4 yet. Adding the firmware version to the Power Flow animation is a really nice addition too - love it! ❤️ |
Thanks! Hopefully you can be the first to test it! 😄 I pushed the Build t22 to "latest" if you want to upgrade now. |
Confirmed no more issues with the Power Flow animation after a FW update for me. 👍 |
Thanks @mcbirse ! No issues for me either. Thanks everyone! 🙏 |
The latest firmware upgrade from Tesla Powerwall has changed the powerflow animation javascript on the gateway. JavaScript error are now being produced for anyone using the pypowerwall proxy to render the animation.
@danisla Let me know if you see the same thing or have any suggestions for a fix. I'm taking a look as well.
Errors:
Issue also raised in Powerwall-Dashboard: jasonacox/Powerwall-Dashboard#88
The text was updated successfully, but these errors were encountered: