OctoPrint-DetailedProgress icon indicating copy to clipboard operation
OctoPrint-DetailedProgress copied to clipboard

Error when changing eta_strftime

Open calonmerc opened this issue 8 years ago • 9 comments

I changed the eta_strftime to: eta_strftime: %H:%M:%S

And now get this error on octoprint runtime: found character '%' that cannot start any token in "/home/pi/.octoprint/config.yaml", line 107, column 19

Line 107 in my config.yaml is the eta_strfime command.

calonmerc avatar Dec 01 '16 17:12 calonmerc

@calonmerc for yaml, you must escape %, try this: eta_strftime: %%H:%%M:%%S

dattas avatar Dec 01 '16 17:12 dattas

It's not escaped in the default config though.... Gina just mentioned escaping the : characters.

calonmerc avatar Dec 01 '16 17:12 calonmerc

And aren't the %H, %M, and %S characters to be replaced by the plugin? So wouldn't escaping them break that?

calonmerc avatar Dec 01 '16 17:12 calonmerc

I tried your solution and got the same error. Putting the entire thing in quotes, I now get an error about the line after which is default and I have not changed.

calonmerc avatar Dec 01 '16 17:12 calonmerc

In summary...

I've tried the following all resulting in an error still: eta_strftime: %H:%M:%S eta_strftime: %%H:%%M:%%S eta_strftime: %H%M%S eta_strftime: "%H:%M:%S" this one resulted in the error being on the completion line of: messages: - {completion:.2f}% complete

calonmerc avatar Dec 01 '16 18:12 calonmerc

Changing the entire thing to: detailedprogress: time_to_change: 5 eta_strftime: "%H:%M:%S" etl_format: "{hours:02d}:{minutes:02d}:{seconds:02d}" messages: - "{completion:.2f}% complete" - "ETL: {printTimeLeft}" - "ETA: {ETA}"

Solved the issue.... so I HIGHLY suggest changing it to this in the default config. Even pasting the default config back in still didn't fix it.

I just mean putting all of the potential displays that go into the config.yaml in quotes.

calonmerc avatar Dec 01 '16 21:12 calonmerc

See also the YAML primer:

For most scalars you don’t need any quotes at all, but if you need to define some piece of data which contains characters that could be mistaken with YAML syntax you need to quote it in either double " or single ' quotes for the YAML file to stay valid. As simple rule of thumb, if your data contains any of these characters :-{}[]!#|>&%@ better quote it.

foosel avatar Dec 02 '16 10:12 foosel

Yup, this does seem to fix it!

Issue should probably be closed as well.

1n5aN1aC avatar Jan 09 '17 21:01 1n5aN1aC

Does this fix the display on the LCD screen leaving off the last letter, and on the "Date:, ex: ETA 14 18 46 Day 1, when it should be the 11th? also I get 95.5p complet, no e at the end, Bad Accurac Plus I would rather have ETA show up as it is in ETL, I am new to al this and not understanding coding.....

Thank You Craig H.

Warchildz avatar Aug 11 '18 19:08 Warchildz