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

feat: Add a post process event handler to perform error/debug handling #59

Merged
merged 53 commits into from
Aug 20, 2023

Conversation

Slider0007
Copy link
Owner

@Slider0007 Slider0007 commented Aug 15, 2023

  1. Add a Post Process Event Handler to perform error / debug handling at the end of a process cycle. It is possible to signal warning and error events to main task and react to the event after the states are already fully processed. This reduces possible side-effects by stopping in between in case of an error. Error events are signaling (error message) and aborting the actual processing after completing the state where the event is triggered, waring events only signaling (warning message) without aborting the actual processing.
    • Use the newly introduced process state "Post Process Event handler" to handle different tasks of the process states. No automatic device reboots anymore in case of a critcal error. (Further debug / error events can be implemented in future.)
      • State Take Image: Handle the reload of camera driver in case of a camera issue.
        --> Error, actual image evaluation process to be aborted. Publishing states like MQTT, ... are still performed.
      • State Image Alignment: In case of an alignment deviation, save align algorithm results and the alignment image for debug purposes (only activated if enabled by new expert parameter Save Debug Info (SaveDebugInfo) in section Alignment).
        --> Error, actual image evaluation process to be aborted. Publishing states like MQTT, ... are still performed.
      • State Post-Processing: In case of an max. rate threshold deviation (positive and negative), save the evaluation status message and the all ROI images for debug purposes (only activated if enabled by new expert parameter Save Debug Info (SaveDebugInfo) in section Post-Processing).
        --> Warning, actual process to be continued. All flowwing states are fully performed.
    • All debug infos will be saved to /sdcard/log/debug.
    • Add new expert parameter Debug Files Retention (DebugFilesRetention) in section System to maintain the new created /sdcard/log/debug folder.
    • It is possbile to set more than one event per process state. All events will be sequencially performed at the end of the process by the event handler function (doPostProcessEventHandling())
  2. Refactor all exisitng file and folder retention functions (same structure, more debug logs)
  3. Adapt camera init/test during boot considering the new cam driver reload handling
    • Init camera after WIFI init and only forsee one init (second init could be performed during process init).
    • Remove camera framebuffer test at boot, because this will be checked every cycle during regular process. In case of an framebuffer error, an automatic reinit will be performed and if camera still not working, a reinit can be manually triggered in web interface --> Manual Control --> Start Round.
    • Continue booting the regular process and web interface in case of every cam error (no redirect to reduced web interface anymore). More interaction possible to try to fix the issue (e.g. manual trigger a reinit by manual start of a new process)
  4. Refactor demo mode
    • Avoid cam buffer pointer modification to ensure proper cam deinit without memory leak
    • Directly loading demo image into cam buffer, no helper image anymore (save 30kB in SPIRAM)
  5. Process state 'Init failed': A reinit and process start can be triggered in web interface --> Manual Control --> Start Round.
  6. WebUI Overview: Show round counter in separate line
  7. WebUI OTA update: Allow firmware.bin as fully supported file name pattern
  8. Various function / variable renaming

BEGIN_COMMIT_OVERRIDE
feat: Add a post process event handler to perform error/debug handling)
refactor: Refactor demo mode
refactor: Refactor file and folder retention functions
refactor(webui): Show round counter in separate line
refactor: Refactor camera init during boot
feat(webui): Allow firmware.bin as valid file name
END_COMMIT_OVERRIDE

Slider0007 added 30 commits June 8, 2023 13:12
@Slider0007 Slider0007 merged commit 932d538 into develop Aug 20, 2023
@Slider0007 Slider0007 added the enhancement New feature or request label Aug 31, 2023
@Slider0007 Slider0007 changed the title Add a post process event handler to perform error/debug handling feat: Add a post process event handler to perform error/debug handling Sep 7, 2023
@Slider0007 Slider0007 removed the enhancement New feature or request label Sep 7, 2023
@Slider0007 Slider0007 deleted the automatic-error-handling branch September 7, 2023 18:38
Slider0007 added a commit that referenced this pull request Oct 17, 2024
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

Successfully merging this pull request may close these issues.

1 participant