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

LittleFS not re-built when files in datadir change #1364

Open
4 tasks done
schlimmchen opened this issue Oct 30, 2024 · 3 comments
Open
4 tasks done

LittleFS not re-built when files in datadir change #1364

schlimmchen opened this issue Oct 30, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@schlimmchen
Copy link
Member

What happened?

When only changing files in the data dir, the newly created firmware image is the same as in the build before.

To Reproduce Bug

Change a file in data but only that file, then rebuild firmware.

Expected Behavior

LittleFS image is re-built and integrated into new firmware image.

Install Method

Self-Compiled

What git-hash/version of OpenDTU-OnBattery?

1234

What firmware variant (PIO Environment)?

generic_esp32s3_usb

Relevant log/trace output

No response

Anything else?

No response

Please confirm the following

  • I believe this issue is a bug that affects all users of OpenDTU-OnBattery, not something specific to my installation.
  • I have already searched for relevant existing issues and discussions before opening this report.
  • I have updated the title field above with a concise description.
  • I have double checked that my inverter does not contain a W in the model name (like HMS-xxxW) as they are not supported.
@schlimmchen schlimmchen added the bug Something isn't working label Oct 30, 2024
@tbnobody
Copy link

tbnobody commented Nov 6, 2024

Could you please doublecheck if it works as expected if you replace this line:

env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp32_create_combined_bin)

by

env.AddPostAction("buildprog", esp32_create_combined_bin)

@schlimmchen
Copy link
Member Author

schlimmchen commented Nov 11, 2024

Sorry for not getting back to you sooner. I was AFK over the weekend, merely skimmed some of the notifications, and I did not see this one yet. I came back here to note: "Probably fixed by ecb5e9c". Seeing your request I tested it, but unfortunately, changes to files in the data/ directory (in my test I changed the Wi-Fi SSID in config.json) did not create a new... Well, nothing new entirely:

[...]
|-- Update @ 2.0.0
|-- VeDirectFrameHandler
|-- ResetReason
|-- MqttSubscribeParser
|-- Ticker @ 2.0.0
|-- DNSServer @ 2.0.0
|-- HTTPClient @ 2.0.0
|-- SPI @ 2.0.0
|-- TimeoutHelper @ 0.0.1
|-- SdmEnergyMeter
|-- SMLParser
Building in release mode
Retrieving maximum program size .pio/build/generic_esp32s3_usb/firmware.elf
Checking size .pio/build/generic_esp32s3_usb/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [===       ]  26.5% (used 86828 bytes from 327680 bytes)
Flash: [======    ]  56.8% (used 2233409 bytes from 3932160 bytes)
============================================================================================ [SUCCESS] Took 7.23 seconds ============================================================================================

Environment          Status    Duration
-------------------  --------  ------------
generic_esp32s3_usb  SUCCESS   00:00:07.226
============================================================================================ 1 succeeded in 00:00:07.226 ============================================================================================

Given the approach you suggest, I asked ChatGPT about it. The code it produced was unusable, as is often the case, but there was a pointer, as is also often the case: AlwaysBuild. Using that I found some documenation that uses it.

This works as expected (esp32_create_combined_bin is always executed):

from SCons.Script import AlwaysBuild
AlwaysBuild(env.AddPostAction("buildprog", esp32_create_combined_bin))

@tbnobody
Copy link

You are right. Will add it with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants