Traumflug / Teacup_Firmware

Firmware for RepRap and other 3D printers
http://forums.reprap.org/read.php?147
GNU General Public License v2.0
310 stars 198 forks source link

No code M117 #305

Open thomaskilian opened 5 years ago

thomaskilian commented 5 years ago

Is there a reason why M117 is not implemented? Cura does put them in the generated code. So why not just accept this M-code and skip the rest of the line? Shouldn't be too difficult, right? I'd do that, but I'd like to avoid diving deep into gcode_process.c and find out how it actually works (if possible). Any hint on how to implement that quickly?

Wurstnase commented 5 years ago

Because there is no complete support for displays in Teacup. Afaik M117 will show a message on a display. So there is acutally no reason to implement something which will do nothing.

Edit: Probably your start gcode or end gcode has some lines with M117 which could be easily removed.

thomaskilian commented 5 years ago

I use, probably like anyone else, Octoprint to feed my 3D printer. Once an unknown opcode (like M117) is sent, Teacup echos the remainder of the current line one char after the other. That causes Octoprint to just hang and stop further printing. So rather than that I'd wish Teacup could just reply with some well-formed warning or to skip the opcode.

P.S. No, it's not start/end. Cura is putting that in when using a post-processing macro.

Wurstnase commented 5 years ago

I will check how to do correct error/warning handling for Octoprint. It's not very easy to handle all different hosts. thomaskilian notifications@github.com schrieb am Di. 2. Okt. 2018 um 07:42:

I use, probably like anyone else, Octoprint to feed my 3D printer. Once an unknown opcode (like M117) is sent, Teacup echos the remainder of the current line one char after the other. That causes Octoprint to just hang and stop further printing. So rather than that I'd wish Teacup could just reply with some well-formed warning or to skip the opcode.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Traumflug/Teacup_Firmware/issues/305#issuecomment-426155553, or mute the thread https://github.com/notifications/unsubscribe-auth/AITlJ6eVGrAaTs6nPvZtcPmcHKGplxXHks5ugvzggaJpZM4XCugM .

thomaskilian commented 5 years ago

Looking into Marlin I just see "Error: \n". I'll check how Octoprint reacts on that and whether it probably accepts something like a warning. So you can save that effort here.

I'd be happy to just know how to skip until \n in the gcode_process.c.

thomaskilian commented 5 years ago

I'm a bit confused now. The malicious M117 is preceded by a M107 where Teacup responds with "E: Bad M-code" and Octoprint happily continuing. It's probably that 107 has no extra parameters. So, why not add a skip to newline after that?

phord commented 5 years ago

I don't think I've seen this before. Also, teacup does process the entire g-code before determining if it's valid. So I'm confused. Maybe some parameter field isn't recognized or the message includes something that triggers us to bail. Can you provide the exact command that causes this failure?

thomaskilian commented 5 years ago

Sure: M117 Printing... ch@L 1 It causes Teacup to echo chars enclosed in question marks. Can't post the result since I disassembled the Arduino at the moment.

thomaskilian commented 5 years ago

Fixed my board. Here's the echo from Teacup upon the above command: ?R??I??I??C??H??@??L?ok

thomaskilian commented 5 years ago

Uh! I think it was just because the code was compiled with DEBUG. That makes it echo unknown chars :-/