RepetierServer + Marlin : echo:Unknown command: "k"

edited December 2018 in Repetier-Server
Hello,

I'm not sure if this fits in the Repetier forum or if I sould ask in the Marlin forum?
Before I elaborate my issue in detail, let me ask you where I should ask this.
Thing is I got the error described below when I started to use Repetier Server via a RPi Zero W + Repetier Host.
I had no issues with direct serial connection from Repetier-Host to Ramps 1.4 but when printing via repetier server, this started.
Repetier wrote some settings to modify in Marlin. I am not sure though what I should do. I found some settings but I don't know if they are the right ones.

Repetier said:
The problem here is caused by
N49 M109 S200.000000
which is a slow command taking longer then timeout seconds. Server knows this and as long as it thinks it is not finished will not cause the timeout. It is not that visible now if the M109 got a matching ok and 5 more commands so run out of the test scope for slow commands, but somehow this is exactly what has happened.

What firmware exactly are you using? I have seen that marlin was working on a system of extra buffer so that is what could cause the "ok" to confuse server.

On the other side if you use such a new marlin version, it also has nice additions that help hosts to fix/detect problems much better and would have prevented this:
- Enable busy protocol or however they call it. This tells server when firmware is running a slow command so you can even reduce timeout to 3 seconds.
- Enable line numbers in ok. This allows detecting missed "ok" on the fly without needing to hit timeout. Also keeps performance up to a good level.
- Enable sending "wait" when idle. This informs server that all commands are processed.

I have no idea why they do not enable these by default. These are very big adds to stable communication.
My config is:
RAMPS 1.4 with RPi Zero W
Repetier Server 0.90.7
Repetier Host 2.1.3
Marlin 1.1.1 (don't want to change firmware. Never change a running system. At least with USB connection an printing directly from repetier host worked like a charm.)

I'm getting these errors:
...
21:28:44.113 : X:87.43 Y:117.73 Z:1.30 E:0.00 Count X:8484 Y:10513 Z:5200
21:28:45.757 : X:66.69 Y:117.18 Z:1.30 E:0.00 Count X:8480 Y:11708 Z:5200
21:28:45.758 : echo:Unknown command: "k"
21:28:45.758 : Error:No Line Number with checksum, Last Line: 19307
21:28:45.759 : Error:Line Number is not Last Line Number+1, Last Line: 19307
21:28:45.759 : Resend: 19308
21:28:49.150 : X:71.45 Y:94.18 Z:1.30 E:0.00 Count X:4995 Y:8283 Z:5200
21:28:50.463 : X:84.66 Y:87.18 Z:1.30 E:0.00 Count X:6800 Y:9444 Z:5200
21:28:51.768 : X:113.77 Y:80.95 Z:1.30 E:0.00 Count X:8459 Y:8708 Z:5200
21:28:52.427 : X:114.98 Y:102.36 Z:1.30 E:0.00 Count X:10500 Y:7218 Z:5995
21:28:53.630 : X:149.99 Y:117.17 Z:1.30 E:0.00 Count X:11498 Y:10236 Z:5200
21:28:57.770 : X:125.42 Y:125.43 Z:1.30 E:0.00 Count X:14169 Y:13235 Z:5200
21:29:00.729 : X:143.56 Y:62.76 Z:1.30 E:0.00 Count X:14343 Y:7021 Z:5990N194ok
21:29:31.582 : Warning: Communication timeout - resetting communication buffer.
21:29:31.582 : Connection status: Buffered:47, Manual Commands: 2, Job Commands: 5000
21:29:31.582 : Buffer used:47 Enforced free byte:40 lines stored:2
21:29:47.872 : X:49.95 Y:72.68 Z:1.30 E:0.00 Count X:5727 Y:6953 Z:5200
21:29:50.058 : X:64.40 Y:137.62 Z:1.30 E:0.00 Count X:5654 Y:13762 Z:5200
21:29:50.281 : X:54.93 Y:137.74 Z:1.30 E:0.00 Count X:6185 Y:13759 Z:5200
...

Before cluttering the repetier forum I wanted know if I am at the correct place to ask.

Comments

  • Well it looks like a communication error between server and firmware, so that is in deed hard to say.
    Did you read https://www.repetier-server.com/knowledgebase/prepare-for-prusa-mk3-on-raspberry-pi-zerow-rambo-einsy-board/ to see how to disable the chrome browser. I guess on a pi zero you do not use a lcd. That frees at least some cpu time.

    echo:Unknown command: "k"
    is in so far correct that no command k exists. But I also know that serve is never sending this on it's own. Furthermore I also see
    21:29:00.729 : X:143.56 Y:62.76 Z:1.30 E:0.00 Count X:14343 Y:7021 Z:5990N194ok
    21:29:31.582 : Warning: Communication timeout - resetting communication buffer.
    21:29:31.582 : Connection status: Buffered:47, Manual Commands: 2, Job Commands: 5000
    21:29:31.582 : Buffer used:47 Enforced free byte:40 lines stored:2

    you see the ok at the end. There should have been a return before "ok". Here the missed "ok" caused the timeout.

    That all shows the communication is not good and that is normally on the firmware side resp. serial converter. And as long as there are errors you get some problems with timeouts. So you should first be sure you use the right baud rate. e.g. 230400 and 250000 work as replacement but the wrong one gets many errors. You might simple need to go down to 115200 baud or up to 250000 baud. Some baud rates create more errors then others. Also use short shielded usb cables.

    Also you said you do not want to change firmware, if you have the sources you used adding line numbers/wait greatly helps fixing such errors on the fly if ping pong mode is disabled. That is not really a new firmware just enabling a feature.
  • Yes, I have read the article and disabled chrome. I do not use a LCD.

    I let it saddle for some time and thought about the issue. I have always used 250000 as a baudrate and it worked so far until now.
    I consider changing the baudrate to 115000.
    I guess the "ok" at the end of the line, aswell as the "k" command are due to some non executing return commands. I guess this could be because of the baudrate (used to work in the past well) or the "slow" rpi zero. But I had these errors and com timeouts also when I direclty usb-connected the printer to my main pc (which was my setup in the past that ran successful without any issues).
  • After changing the baudrate to 115200 there are not more timeouts or hangs during the print.
  • Did you change anything? New usb cable or moved cables in the printer? Such tiny changes can already make a difference with all the interference from heaters and motors.
Sign In or Register to comment.