prusa3d / Prusa-Firmware-MMU

Other
35 stars 19 forks source link

PFW-1423 add Retry handling in NoCommand for init error #247

Closed gudnimg closed 1 year ago

gudnimg commented 1 year ago

Note: https://github.com/prusa3d/Prusa-Firmware-MMU-Private/pull/249 should be merged first.

This PR adds the ability for the user to recover from FINDA_VS_EEPROM_DISREPANCY error with a Retry button; without power cycling the MMU or Printer.

gudnimg commented 1 year ago

Jira ticket has nice steps to reproduce the issue: https://dev.prusa3d.com/browse/PFW-1423

  1. While printer is idle, trigger both FINDA and FSENSOR an keep them triggered
  2. restart the printer
  3. UNLOAD MANUALLY appears
  4. un-trigger both sensors
  5. Hit Retry on the screen - the error screen doesnt go away although the cause of the error no longer exists. After hitting Retry, MMU should re-home.
gudnimg commented 1 year ago

I'm seeing an issue with this Firmware. Am getting Unload Manually without triggering FINDA or Fsensor:

Steps to reproduce:

  1. Boot up printer
  2. Click Load to Nozzle
  3. Select filament (make sure there is no actual filament in the MMU!)
  4. Wait for Finda Didn't trigger error
  5. Restart printer without resolving error
  6. On next boot, Unload Manually error appears and it is impossible to resolve.

⚠️ This situation is actually worse than before the PR.

I will improve the unit tests to cover this.

gudnimg commented 1 year ago

Interesting find. This doesn't seem to have any effect on the unit test results. Something smells wrong here. image

DRracer commented 1 year ago

@gudnimg

VerifyLoadState(...
    CHECKED_ELSE(mg::globals.FilamentLoaded() & fls) { // beware - abusing the values as bit masks to detect multiple situations at once
    return false;
    }
    ...

It should fail whenfls doesn't match FilamentLoaded()

DRracer commented 1 year ago

ouch, this seems to work correctly ... I'm smelling a preprocessor macro problem:

    bool flsMatch = mg::globals.FilamentLoaded() & fls;
    CHECKED_ELSE(flsMatch) { ...
gudnimg commented 1 year ago

Rebased this branch on top of https://github.com/prusa3d/Prusa-Firmware-MMU-Private/pull/249, as it will hopefully improve things.

gudnimg commented 1 year ago

Can confirm the new issue is resolved now :)

gudnimg commented 1 year ago

Closing in favor of https://github.com/prusa3d/Prusa-Firmware-MMU-Private/pull/253