-
Notifications
You must be signed in to change notification settings - Fork 65
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
Unexpected Printer Response while printing from web interface #180
Comments
Hey! Thanks for posting about this. I've noticed this myself too. This is actually because the printer sends We should probably flush the read buffers before sending any commands to the printer but, even then, I believe there's no guarantee that an So there's a few things we could do:
I'm not sure if 2/ comes with any tradeoffs but it's likely worth a try. 3/ would most likely not help here unless you're taking a lot of different actions around the same time on the app. 1/ should be somewhat simple to implement. |
Similar Issue? The printer returned an unexpected response: ''
|
Yup, you can ignore it. |
Not sure if I have the same issue as I haven't saved the error info to compare, but the home page said "status: printer ready" and i was able to upload a file to print and start the print from the Web interface. Upon starting the print I saw the first "in print" status with layer info, time remaining etc, then received an http 500 error and could not then get back to a working status dialog. New Zero W, Raspberry Pi OS lite and mariner installed as per the instructions as of Saturday 27th and installed on a Phrozen Sonic Mini 4K. The 8hr print completed without issue so not the biggest of problems. Great work BTW 👌 |
Okay, going to play with this issue a bit. Have added the basic buffer flush ( self._serial_port.read(size=1024) )to the mars serial send() function. I get this issue super frequently, so it should be easy enough to test how effective a flush is. |
So adding the flush helps quite a bit, but isn't a 100% solution as expected. This was with just leaving the web display up during prints, and not issuing additional commands. So no race conditions, etc. It probably reduced the issue on my end by 50-70% though. |
I also still get this, but it is quite reduced. Sonic Mini and Mighty 4K. |
Getting this on the Sonic Mini 4K as well. If I clear the error, it's back again the next time I check.
|
So I'm not sure how to solve this issue. It seems to only ever really be a problem with PrintStatus from what I've seen. Sometimes you get a blank line back.. Given the wide variety of issues around this, and the fact that we don't have specs on the internal printer communication flow/etc.. I'm not sure there is a good way to 100% fix this. So for my own testing, I've decided to commit a programming sin, and just try/catch the read response call in PrintStatus. This is quite dirty of course, yet it does handle all the problematic cases above more or less. One thing I would be tempted to do here, is add an error counter that gets cleared on handling a good response. If it instead increments and hits some set threshold than a full error dialog pops up. (AKA something has clearly gone very wrong with the printer or the serial communication.) |
not sure what have i did wrong:
I get this when i want to start a print. Later Edit: i changed my data cable, the one i uses was only able to charge. |
I made some good progress on this bug today by making these changes:
Overall after these changes I can only reproduce this bug if I refresh the page multiple times quickly. This makes sense though: we're probably processing multiple requests at the same time and spamming the printer with commands and running into race conditions. But at that point, #75 becomes more important than any more tweaks to this. If you would like to try a build with these fixes, download the |
Those look like solid steps, one thing though, you'll probably want to add the retry logic to get_selected_file as well. As part of print_status I had the exceptions rising out of that as well. |
Right, 3c9185a did that :) |
Man, that is so cool. Great work!! |
I give the linked build a shot, and ... wow is it much more responsive, even just sitting and not doing anything. File uploads are SIGNIFICANTLY faster. So, great improvements, keep it up! Edit: Using it, the random notifications while printing are gone. It's nice and silent. |
Sounds awesome. I'm happy to test as well. |
@daxliniere, see #415 for how to update it manually from a CI build |
Interesting, so if i had multiple instances of the web UI open on different browsers / computers at the same time, then the error would come up more often since it creates a retry / timing issue on the printer end, since the server handles each browsers refresh request independently ? That would explain why I had no errors like the above at first, now a after a few days of tinkering they seem to become more frequent - but in the same time I am monitoring from different computer / devices at the same time. |
Hi, I'm running into the same issue except way worse on my Mars 2 pro, everytime I refreach the page the error will pop out, making the webpage unusable. The artifact seems to be expired. Is there a guide to build the software manually or are you close to some kind of release? |
I have since then switched to OctoPrint with Chitu implementation - which is not supposed to work on latest firmware, yet it does on my Creality LD-002H. I noticed that on the OctoPrint installation the USB Dongle emulation was not configured properly by default install. While the Mariner3D configuration of the same works well. |
Thank you for the suggestions. Just read the plugin page, it seems the author acturally referenced Mariner code to make that plugin. OctoPi is really laggy on PiZeroW but I guess I can live with it until Mariner update. |
I do not think the problem of lagginess is the PiW, it is the printer. I am running on a Pi4 for now (since we can not get anything here are the moment), it still takes a good 30sec until the printer responds to a start command etc... I rather see Mariner3D to become a OctoPrint plugin, than a standalone feature. |
Hi, I have similar problems on the Saturn, but everything works regularly
|
there is no valid build that is not "expired", so unfortunately, I can try this fix by manually updating the deb. Any pointer beside compiling it myself? |
Is there any hope on a solution on this? I got this error on both the printer status screen and after uploading. I have a Elegoo Mars 2 Pro with a Raspberry Pi Zero W |
Hello!
I have mariner3d_0.1.1-1_armhf.deb running on a fresh Pi Zero (2020-12-02-raspios-buster-armhf-lite.img) and so far everything seems to be running fine.
However, when I try to print from the web interface I get an Unexpected Printer Response:
The printer returned an unexpected response: 'ok N:0\r\n'
I don't know what other printer responses there might be, but it might be a fix to change the regular expression to:
ok '?([^']+)'?\r\n
to make the single quotes in the response optional.
The printer:
Edit:
I've used minicom to debug it further and amongst a lot of simple "ok" responses there a some responses like
and
where lenkrad-v1.ctb is the only uploaded file right now.
The text was updated successfully, but these errors were encountered: