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

Add meatpack serial packing #20802

Merged
merged 20 commits into from
Jan 24, 2021

Conversation

ellensp
Copy link
Contributor

@ellensp ellensp commented Jan 17, 2021

Description

Quick attempt at adding meatpack serial packing to marlin2. Concise Diff
Space removal added
I don't have a way to test this at the moment.

Requirements

#define MEATPACK and something to pack the data at the sending end. Currently only the octoprint plugin OctoPrint-MeatPack

Benefits

Faster data rate for serial communications, particularly useful for UART based serial

Related Issues

#20768

@ellensp ellensp marked this pull request as draft January 17, 2021 12:09
@ellensp ellensp added C: Serial Comms Needs: Testing Testing is needed for this change PR: New Feature labels Jan 17, 2021
thinkyhead added a commit to MarlinFirmware/Configurations that referenced this pull request Jan 19, 2021
thinkyhead added a commit to MarlinFirmware/Configurations that referenced this pull request Jan 19, 2021
@thinkyhead thinkyhead marked this pull request as ready for review January 22, 2021 22:37
@thinkyhead
Copy link
Member

thinkyhead commented Jan 22, 2021

I've been reading the packing code and it seems to be pretty simplified. From what I can gather this is the whole format that the plugin's packing script produces:

  • Start the file with 0xFF 0xFF 0xFB ("packing enabled" command)
  • Whole line comments are left intact
  • Pack up the bytes in one of three ways:
    • Neither character is packable: 0xFF 0x## (not 0xFF) 0x##
    • First character is packable: 0x#F (not 0xFF) 0x##
    • Second character is packable: 0xF# (not 0xFF) 0x##
    • Two packable characters: 0x## (two packed chars, not 0xF# or 0x#F)
  • End the file with 0xFF 0xFF 0xF9 ("reset device state" command)

That should pack most commands down very well, except maybe the occasional M117 command….

The unpacking code looks perfectly good to me when I run it in my head. I have an OctoPrint setup and can give it a try soon.

I guess it doesn't make too much sense to worry about implementing it for SD printing, but that wouldn't be too hard to add if someone wants it.

@ellensp
Copy link
Contributor Author

ellensp commented Jan 23, 2021

next version strips white space from G0-9 ie all low gcodes..

@ellensp
Copy link
Contributor Author

ellensp commented Jan 23, 2021

Now with support for space removal. NB needs re tested. When this was tried on prusa firmware eg G1 X40 Y20 E12 became G1X40Y20E12 and Y was incorrectly interpreted as Y2012 (ie 20 to the power of 12) .

@thinkyhead
Copy link
Member

Y was incorrectly interpreted as Y2012

Haha. Marlin knows to replace the E before interpreting the number.

@thinkyhead thinkyhead merged commit 3921369 into MarlinFirmware:bugfix-2.0.x Jan 24, 2021
@ellensp ellensp deleted the bugfix-2.0.x-#meatpack branch January 24, 2021 06:52
@scottmudge
Copy link
Contributor

Thanks for migrating, integrating, and merging.

TyMi pushed a commit to TyMi/Marlin that referenced this pull request Jan 25, 2021
…_bugfix

* commit '876c2586b9146dd123af4c7b21138b8239ef5d39': (116 commits)
  Clean up MMU2 code (MarlinFirmware#20794)
  Init KILL, SUICIDE, PSU earlier (MarlinFirmware#20810)
  "Move … code" followup (MarlinFirmware#20869)
  Apply SEC_TO_MS and other fixes
  Reformat abortSDPrinting
  Fix sign warning (MarlinFirmware#20872)
  Cosmetic changes (2) (MarlinFirmware#20876)
  "Move … code" followup (MarlinFirmware#20868)
  "Move … code" followup (MarlinFirmware#20874)
  Graphical TFT fixes, cleanup (MarlinFirmware#20861)
  🧻 Cosmetic changes (MarlinFirmware#20859)
  🛠Fix deps script version regex
  Fix Ender 3 V2 DWIN manual move (MarlinFirmware#20837)
  [cron] Bump distribution date (2021-01-25)
  Fix LiquidCrystal CI failures (MarlinFirmware#20873)
  Revert "Adding custom move feedrate for G26 (MarlinFirmware#20729)" (MarlinFirmware#20870)
  MeatPack serial encoding (MarlinFirmware#20802)
  [cron] Bump distribution date (2021-01-24)
  lcd_put_wchar_max for COLOR_UI (MarlinFirmware#20838)
  Adding custom move feedrate for G26 (MarlinFirmware#20729)
  ...

# Conflicts:
#	Marlin/Configuration.h
#	Marlin/Configuration_adv.h
kpishere pushed a commit to kpishere/Marlin that referenced this pull request Feb 19, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
zillarob pushed a commit to zillarob/Marlin that referenced this pull request Feb 25, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
W4tel-BiDi pushed a commit to W4tel-BiDi/Marlin that referenced this pull request Apr 5, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
thinkyhead added a commit to thinkyhead/Marlin that referenced this pull request Apr 29, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
thinkyhead added a commit that referenced this pull request Apr 30, 2021
Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] Interest in an on-the-fly serial/g-code compression technique from Prusa's FW? Existing PR...
4 participants