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 support for various Marlin message types #293

Merged
merged 3 commits into from
Jan 14, 2023

Conversation

MonoAnji
Copy link

The changes add support for the following Marlin features

  • M106 fan speed updates from the printer can be shown
  • M73 progress reports can be interpreted (printing via serial from e.g. a TFT was invisible to ESP3D-UI)
  • Actions are shown in a different style in the terminal (in the provided theme, which is the one I use)

@luc-github
Copy link
Owner

luc-github commented Jan 14, 2023

Hi can you explain how esp3d catch the M73 and M106 commands ? they are commands - not report

also you only handle some syntax is that normal ?
M106 P0 S255 not M106 S255 P0 same for M73 ...

nice theme by the way and good catch for duplicate chamber

@MonoAnji
Copy link
Author

Of course, I should've added that straight away.

Changes in Marlin (Configuration_adv.h)

#define REPORT_FAN_CHANGE this will make Marlin actually echo (interestingly without echo:) changes to the fan speed just as if it was a command.

  #define M73_REPORT                                  // Report M73 values to host
  #if BOTH(M73_REPORT, SDSUPPORT)
    //#define M73_REPORT_SD_ONLY          // Report only when printing from SD
  #endif

The #define M73_REPORT makes marlin send out messages with status updates to the host or basically just out to serial, so I can see the progress in ESP3D-WEBUI.
I'm printing from an SD card in a TFT connected via serial, so there is no SD_STATUS on the actual board. But the M73 report uses the print timer as a source for progress (SD_STATUS is just bytes in the gcode file anyway if I remember correctly). So this gave me a way to actually see that there's a print job running via the WEB-UI by parsing that message.

Regarding the M106 and M73 formats: I honestly just added it exactly the way it was sent by Marlin

Marlin/src/module/temperature.cpp#L429

  #if ENABLED(REPORT_FAN_CHANGE)
    /**
     * Report print fan speed for a target extruder
     */
    void Temperature::report_fan_speed(const uint8_t fan) {
      if (fan >= FAN_COUNT) return;
      PORT_REDIRECT(SerialMask::All);
      SERIAL_ECHOLNPGM("M106 P", fan, " S", fan_speed[fan]);
    }
  #endif

Marlin/src/gcode/lcd/M73.cpp#L76

  #if ENABLED(M73_REPORT)
    if (TERN1(M73_REPORT_SD_ONLY, IS_SD_PRINTING())) {
      SERIAL_ECHO_START();
      SERIAL_ECHOPGM(" M73");
      #if ENABLED(SET_PROGRESS_PERCENT)
        SERIAL_ECHOPGM(" Progress: ", TERN(PRINT_PROGRESS_SHOW_DECIMALS, permyriadtostr4(ui.get_progress_permyriad()), ui.get_progress_percent()), "%;");
      #endif
      #if ENABLED(SET_REMAINING_TIME)
        SERIAL_ECHOPGM(" Time left: ", ui.remaining_time / 60, "m;");
      #endif
      #if ENABLED(SET_INTERACTION_TIME)
        SERIAL_ECHOPGM(" Change: ", ui.interaction_time / 60, "m;");
      #endif
      SERIAL_EOL();
    }
  #endif

Thank you by the way, feel free to include the theme or change it or use stuff from it if you want ;)

@luc-github
Copy link
Owner

Thank you for the clarification - I never tried these auto reports - good to know - thank you

@luc-github luc-github merged commit dfcff05 into luc-github:3.0 Jan 14, 2023
@luc-github
Copy link
Owner

merged thank you

@MonoAnji MonoAnji deleted the 3.0-PLArio branch January 14, 2023 23:10
@luc-github
Copy link
Owner

@all-contributors please add @MonoAnji for code fix of code improvement

@allcontributors
Copy link
Contributor

@luc-github

I've put up a pull request to add @MonoAnji! 🎉

Engineer2Designer added a commit to Engineer2Designer/ESP3D-WEBUI that referenced this pull request Jan 17, 2024
commit 71b9b13709cca83683d7b24b736ad96b626c9cbf
Author: E2D <engineer2designer@gmail.com>
Date:   Wed Jan 17 15:53:06 2024 +0800

    chang E2DxESP

commit db95b26
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue May 16 20:33:31 2023 +0800

    Add translation for 'language'

    Add language entries in ESP400/ESP420 for test server
    Fix select string validation error

commit 9e77ed6
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sat Apr 29 10:20:36 2023 +0800

    Update index.js

commit 11c6a52
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Apr 23 20:12:42 2023 +0800

    Update index.html.gz

commit 445635a
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Apr 23 20:12:33 2023 +0800

    Fix scroollbar hide drop zone border on file panel

commit 7f1449c
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Apr 23 19:26:12 2023 +0800

    Remove unwished panel class in file list that may generate overflow if lot of files

commit 6310b4b
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Apr 23 13:40:55 2023 +0800

    Split Terminal Buffer to Verbose Buffer and Quiet Buffer

    Fixes luc-github#355  Build package
    Bump version
    Build package

commit e26ff03
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Apr 23 12:03:07 2023 +0800

    Add support for swap X Y, Invert X/Y/Z

commit f5247a9
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Apr 11 22:41:18 2023 +0800

    Rebuild packages

commit 5ed515a
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sat Apr 8 14:01:30 2023 +0800

    Make logo visible even in dark mode

commit d40850f
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Apr 3 10:21:14 2023 +0800

    Fix typo issue with datetime generation in webui orz...

    Bump version

commit 54bb6c8
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Apr 2 19:18:25 2023 +0800

    Add support for GCODE starting by C and D

commit eb80ce5
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sat Apr 1 15:15:01 2023 +0800

    Fix multiple file upload not working

commit ce8c5af
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sat Mar 11 17:33:35 2023 +0800

    Update .prettierrc

commit 0af2ae9
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Mar 8 04:56:42 2023 +0800

    remove hard coded size of svg as now handled by css

commit 794e082
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Mar 8 04:38:59 2023 +0800

    resize 3dprinter jog svg according resolution

commit 7aa9f02
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Feb 27 09:09:24 2023 +0800

    Add support for Marlin 1.X in settings

    Add Marlin 1.X settings in Marlin emulator

commit 1439b49
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Fri Feb 24 08:49:50 2023 +0800

    Fix test websocket server

commit 20922b4
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Feb 22 06:52:54 2023 +0800

    Update README.md

commit defb257
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Feb 20 14:05:56 2023 +0800

    Fix dev server websocket port is incorrect with latest code

    Fix extra panel name not displayed in collapsed view

commit 8e3bafe
Author: René Pasold <rene@pasold.org>
Date:   Wed Feb 15 23:58:53 2023 +0100

    Fix recognition of 100% M73 print status update (multiple leading whitespaces) (luc-github#302)

commit 63bd0b4
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Feb 13 10:20:11 2023 +0800

    Send 0xA3 command if state change to `Tool`

    Build packages with latest changes

commit e881e82
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Feb 13 08:58:25 2023 +0800

    Add Resume if State is Tool

    related to luc-github#269

commit e4cd6d6
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Feb 9 18:00:02 2023 +0800

    Fix luc-github#300

commit 966c99c
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Feb 9 09:21:36 2023 +0800

    Fix wrong title page on disconnection refresh

commit a05ffb0
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sat Feb 4 11:35:42 2023 +0800

    Fix some values are not properly translated due to format

commit c3260f4
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Feb 1 08:13:24 2023 +0800

    Fix websocket error when using nat and change port number

commit f5275d4
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Fri Jan 27 20:34:11 2023 +0800

    Fix additionnal error message not displayed for saving data

commit f3e11c4
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Jan 18 16:17:27 2023 +0800

    Remove the confusing `404 - Not Found preferences.json` notification if no preferences.json is available

commit 08c14ff
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Jan 18 15:16:18 2023 +0800

    Add missimg translation

commit 6bdd438
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Jan 18 13:10:44 2023 +0800

    Add usb translation support

commit dfcff05
Author: René Pasold <rene@pasold.org>
Date:   Sat Jan 14 23:43:53 2023 +0100

    Add support for various Marlin message types (luc-github#293)

    * Adaptions: theme, support M73 report

    * fan speed report support (M106 ..)

    * print progress float support

commit b4e24e7
Author: aaron GitHub <aaronse@outlook.com>
Date:   Tue Jan 10 04:18:07 2023 -0800

    Fix number input infocus to not invoke keyshortcut.  Fix keyshortcut code to be insensitive.  Current checked in code is not working for arrow keys. (luc-github#291)

    Merged - thank you

commit 1eab237
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Jan 8 09:00:03 2023 +0800

    3.0 keyboard shortcut mapping  (luc-github#288)

    * Implement user type shortcut
    * Move shortcut handler to Dashboard page to handle all panels
    * Upper Case Letters for shortcuts
    Co-authored-by: aaron GitHub <aaronse@outlook.com>

commit ad07df8
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Fri Jan 6 10:48:50 2023 +0800

    Add missing case

commit a65550f
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Fri Jan 6 10:43:09 2023 +0800

    Add contextual translation for about status

commit afc13aa
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Dec 28 08:40:20 2022 +0800

    Add more consistency in key mapping for jog X+ / X- Y+ / Y- raised by @V1EngineeringInc

commit 7150011
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Dec 5 13:27:06 2022 +0800

    Add support for ESP3D-TFT for FW Github link

    Bump version

commit 2478f65
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Oct 23 13:32:41 2022 +0800

    Update ESP3D [ESP400] format.md

commit d2795ef
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Oct 11 12:05:28 2022 +0800

    Fix missing conversion from steps to mm in positions (luc-github#275)

    Add ETX command
    Add formatCommand function for HP-GL to ensure commands are properly formated with ending ; when needed

commit 600e682
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Oct 10 18:18:13 2022 +0800

    Rebuild package to integrate luc-github#274

commit b310732
Merge: 04bb509 1dd4445
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Oct 10 18:15:50 2022 +0800

    Merge branch '3.0' of https://github.com/luc-github/ESP3D-WEBUI into 3.0

commit 04bb509
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Oct 10 18:15:47 2022 +0800

    Add Plotter support for jog panel

commit 1dd4445
Author: Pavulon87 <github@pavulon.net>
Date:   Sun Oct 9 16:04:41 2022 +0200

    Fix missing settingid of temperatures panel (luc-github#274)

commit 387f3c9
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Oct 9 17:49:41 2022 +0800

    Add PD; PU; PRXXX, YYY; OA: support command in test server

commit 09af4dd
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Oct 9 17:48:53 2022 +0800

    Change JogPanel for dedicated one for plotter WIP

commit 028cf8a
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Oct 9 17:48:10 2022 +0800

    Remove unused Machine settings

commit 200fa5f
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Oct 9 17:38:56 2022 +0800

    Allow any setting to be hidden in webUI - done for HP-GL Machine setting that is not used

commit f93c539
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Oct 9 12:49:45 2022 +0800

    Code base for HP-GL WIP

commit aaee2c7
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Fri Oct 7 16:14:04 2022 +0800

    Update Commands.md

commit 4e74537
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 27 19:27:34 2022 +0800

    New axis definition (luc-github#270)

    * Add support of ABCUVW axis for grbHAL

    Refactor the JogCNC panel
    Fix prob value was not properly saved

    * Update JogCNC.js

    * Build packages with latest changes

    bump version

commit f9eb97c
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Sep 22 13:51:48 2022 +0800

    Add check language script

commit 15e7cc8
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Sep 22 10:21:36 2022 +0800

    Update languagepack.md

commit b77bbf6
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Sep 22 10:15:04 2022 +0800

    Add basic scripts for language packs management - WIP

commit d085183
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 20 17:04:07 2022 +0800

    Update ESP3D [ESP800] format.md

commit e4febd8
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 20 14:46:31 2022 +0800

    Fix crash  due to wrong Mask bits size definition if bit index is over array capability

    Fix mask saving crash = regression due to fix for space
    Fix glitch in index of mask for value test
    Bump version

commit 3f9c7c0
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 20 10:20:34 2022 +0800

    Add support of U and E flag of ESP400 output

    Bump version

commit badadfa
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Mon Sep 19 18:42:45 2022 +0800

    Add File stream streaming detection from ? for grblHAL

commit 2b1c5c6
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Sep 18 20:40:54 2022 +0800

    Add support for XbitMask and bitMask

    Bump version

commit a952eb2
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Sep 18 13:56:39 2022 +0800

    Remove ugly {" "} and use style when necessary

commit d06c8a2
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Sep 18 13:32:59 2022 +0800

    Add ESP401 server emulation

    Add support of  float in [ESP400]

commit dbfd47c
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Sun Sep 18 09:38:40 2022 +0800

    apply not saved changes

commit a89c409
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Sep 15 10:56:01 2022 +0200

    Rename directories with proper grblHAL typo

commit e5ff248
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Thu Sep 15 15:37:01 2022 +0800

    Fix grblHAL typo in documents

commit e88b154
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Wed Sep 14 07:40:20 2022 +0800

    Update websocket.md

commit 2e53367
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 13 12:56:31 2022 +0800

    Create ESP3D [ESP410] format.md

commit 93657b0
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 13 12:19:27 2022 +0800

    Fix not translated string

commit 29fa38b
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 13 12:05:31 2022 +0800

    Add grblHal logo for grblhal target

    Use target function to define feature id is SSID to hook the scan button on input box
    Reactivate Feature page for grblHal now ESP400 is enabled
    Bump version

commit f1d818b
Author: Luc <8822552+luc-github@users.noreply.github.com>
Date:   Tue Sep 13 08:54:32 2022 +0800

    Fix update still display when web update is disabled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants