-
Notifications
You must be signed in to change notification settings - Fork 648
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
Check for corrupted models #3184
Comments
It crashes here: |
@Slider0007 @SybexX @jomjol Do you have experience with enabling exception handling? |
@caco3: I've never used exception handling in ESP IDF environment. Therefore I cannot assist with this topic. As I understand this correct, this could be tricky because every potential exception all over the software needs a catch otherwise processing is getting aborted in error case. Would potentially a lot of work... Beside execption handling at least a sort of version check could be added. Maybe this helps a bit depending on how the file is getting corrupted. The question is what should be the reaction because the flow in jomjol firmware cannot be aborted gracefully anyway... Nevertehless I raise the question what will the user do if it's not crashing but still not working anymore because the model is corrupted anyway? This does not solve the root cause, wearing SD cards quickly because of tons of reading cycles of the same files... |
Well, without exceptions (as is now), it goes directly into an abort!
The crash happens within the tflite library. The right way would be to patch that one, but I fear it might by a lot of learning first. The other way is to add a try/catch around it. This way we can notify the user gracefully without crashing. Your proposal with the version check sounds as a good start. but it will not be able to catch all corruptions.
We simply can show an error in the UI/MQTT, ...
Yes, thats right, but I have the feeling we had quite some bug reports because of corrupted models/filesystems. |
The Feature
We sporadically see issues that the system crashes after loading a model, eg. #3177 (reply in thread)
Usually this is due a SD card going bad.
I think it would be wise if we would check the models before we use them (and prevent a crash).
The best way would be to handle the issue if it is corrupted. Not sure if this is possible with the use tflite library.
The other way would be to provide a 2nd file per model containing the CRC32 or MD5 sum. The firmware then could check against it and handle it.
The text was updated successfully, but these errors were encountered: