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

ASCII animation for the "watch" command and discovered a new PrintInfoStatus #6

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

rorosentrater
Copy link
Collaborator

Not sure how I feel about this one. Take it or leave it. I did it for fun.

I started passing in the printStatus to the watch data. If you set a really low interval you can see it go through the lower/expose/raise cycle. I made a dumb little animation to go along with it.
https://github.com/vvuk/cassini/assets/31737849/7c50cccc-1f9b-4e80-abe6-8f8d59b10d49

As you can see from that video though, because we are polling the animation isn't very smooth. Sometimes the latency between your computer and the printer's response makes it seem like a phase was skipped. I tried to compensate by jumping to the first animation frame of the reported phase but I think you would need the printer to push updates instead of polling to get a truly smooth animation.

I did discover a new printStatus though. I upgraded my printer's firmware to the latest version and before starting my 1st print this "idle" status number was being reported. It's value is 0 so I am pretty sure there is a 1 I just don't know what it represents so I left it commented out.

@rorosentrater
Copy link
Collaborator Author

rorosentrater commented Dec 10, 2023

Oh no

_VelvetU.ctb |███████████████████████████████████████▉⚠︎ (!) 100% [365/366] (0.13/s)
Traceback (most recent call last):
  File "C:\Users\Rob\Documents\3printer stuff\utils\cassini\cassini.py", line 237, in <module>
    main()
  File "C:\Users\Rob\Documents\3printer stuff\utils\cassini\cassini.py", line 224, in main
    do_watch(printer, interval=args.interval, broadcast=broadcast)
  File "C:\Users\Rob\Documents\3printer stuff\utils\cassini\cassini.py", line 80, in do_watch
    match PrintInfoStatus(status['printStatus']):
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\enum.py", line 712, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Python311\Lib\enum.py", line 1128, in __new__
    raise ve_exc
ValueError: 12 is not a valid PrintInfoStatus

Found another. Not sure what 12 is. It happened on the last layer. Maybe it's a return to home status? 16 might be when it's done returning. Unsure if this is related to the latest firmware. Status now reports 16 (complete)

@rorosentrater
Copy link
Collaborator Author

  • Saturn 3 Ultra
  • Firmware V1.5.2

@vvuk
Copy link
Owner

vvuk commented Dec 11, 2023

Thanks! I'm on traveling today/tomorrow, will look when I'm back home on Tuesday.

@rorosentrater
Copy link
Collaborator Author

Saw status 1 today too. Same error. Happens right after starting a print. Maybe this is some sort of initial descent or another type of homing status? I should note that I print almost exclusively via network sending (which is why I like this tool so much) so I'm not sure if these status' are universal or specific to that workflow.

@vvuk
Copy link
Owner

vvuk commented Dec 12, 2023

note that I print almost exclusively via network sending

same -- I wrote this because I was annoyed at the reddit posts about the "proprietary" protocol and such. I just made you a collaborator here; feel free to merge your PRs and even commit directly, add yourself to the README and such too. :)

For the status codes, sounds like we should just print unknown codes as a number to bulletproof this a bit.

… The new status RETURN_HOME also occurs on the last layer before COMPLETE so checking layer # might not indicate the machine has finished printing yet. Print status 1 was observed and appears to occur just before the first layer begins printing. Unsure what it represents yet. Best guess is INITIAL_DESCENT.
@CoolNamesAllTaken
Copy link

Just wanted to drop in and say thank you to @vvuk for making this tool! I really love having an open source workflow out of the box with PrusaSlicer > UVTools > cassini.

Commenting on this PR since I did also notice the idle status code 0 throwing an error with the status query. Maybe it's worth adding a quick try/catch that prints the unknown status code instead of erroring out?
image

I also encountered an issue where cassini would hang after successfully uploading a file, but I'm still running my first print just now. I'll poke at it some more and maybe open a new issue if I encounter the hang again.

Thanks again, y'all! happy printing.

@rorosentrater
Copy link
Collaborator Author

rorosentrater commented Dec 27, 2023

I also encountered an issue where cassini would hang after successfully uploading a file, but I'm still running my first print just now. I'll poke at it some more and maybe open a new issue if I encounter the hang again.

@CoolNamesAllTaken
Sounds like #4, #2. Does it reliably hang? If so, could you link to a problem file on that issue? I personally use chitubox and upload via that, I only use cassini to remote monitor print progress so haven't messed with the file upload command much.

And yeah I haven't merged this PR yet because I agree we should add error handling for any unknown PrintInfoStatus' instead or erroring out. Figured I would add that to this PR since it now includes a bunch of other little fixes related to PrintInfoStatus. Been away for the holidays

@CoolNamesAllTaken
Copy link

CoolNamesAllTaken commented Jan 6, 2024

It seems to hang pretty reliably, regardless of the file contents. Here's a screenshot of the hang after uploading (I had to quit it with Ctrl+C). Looks like it gets to 100% uploaded then stays stuck in the MQTT message wait loop.

image

@vvuk
Copy link
Owner

vvuk commented Jan 6, 2024

Part of the weird hangs is just the general mess that is python async. I very much regret doing this in python, though it's such a small utility that it's now probably easier to just whackamole a bunch of these issues instead of rewriting it.

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.

3 participants