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

New Listening Mode + some bug fixes and cleanup #2179

Merged
merged 13 commits into from
Sep 22, 2021

Conversation

digant73
Copy link
Contributor

@digant73 digant73 commented Sep 16, 2021

IMPROVEMENTS:

  • Added TFT Listening Mode: The TFT simply listen for ACK messages (e.g. spontaneous) while all the outgoing messages are purged.
    This mode is useful on main boards sharing the bus with TFT and USB (e.g. MKS GEN L) allowing Octoprint/Pronterface to properly control the printer (via USB) avoiding command collisions (otherwise present with TFT in normal mode).
    The TFT will receive the ACK messages (spontaneous and/or related to gcodes from USB port) displaying on the screen all the status info.
    The mode can be activated/deactivated on "Connection" menu. Existing labels (ON/OFF) and icon have been used to avoid to add new ones

NOTE: The mode state is stored on FLASH allowing to restore the mode at startup. This allows to power on/off the printer remotely and to control the printer via USB without the need of any touch (from the user) on the display to engage the mode

  • Moved some functions from commnet.c/h to Printing.c/h API
  • Minor code reduction
  • Removed some global variables
  • Minor cleanup

BUG FIXES:

  • Fixed a bug preventing the TFT to reconnect to printer when switching from Marlin mode to Touch mode

Connection_1

Connection_2

Ready_1

@kisslorand
Copy link
Contributor

I do not agree with the things moved out from comment.c/h. In my book it is not an optimization creating new procedures/functions and calling them instead of direct accessing a variable.
Those variables were used only in conjunction with comment info so I still think they belong to where they were.

@digant73
Copy link
Contributor Author

digant73 commented Sep 17, 2021

@kisslorand but they are printing information used by Printing menu that doesn't need to know/interface with other additional/extra modules such as comment module. Layer, time could be set by other modules/gcode while Printing menu simply retrieve and display them using Printing API only

@kisslorand
Copy link
Contributor

Now that you removed M73 Rxx check, what happens if it is present?

@digant73
Copy link
Contributor Author

it was always set to "false" in the code unless there is a case where it is set to "true" that I didn't see

@digant73
Copy link
Contributor Author

digant73 commented Sep 18, 2021

@guruathwal testing this PR I found a bug on Terminal. It seems that some texts will cause an infinite loop on the "while loop" (at line 787 in Terminal.c). The menuTerminalWindow menu will start an infinite page update (from 1 to 20) with no text displayed on screen.
I found that the following text is one causing the infinite loop:
//action:notification Bed Cooling...

The loop is due to the presence of both "//" and ":". With theese characters, the exit condition on the loop is never met (or probably something inside the loop broke the code (e.g. getCharacterInfo)).

When you have some time, could you please have a look to that issue? it seems quite important.

Another minor bug I saw scrolling up on the window is that the ack messages (that were dispalyed with white color) are then displayed as a request command (orange color).

@guruathwal
Copy link
Contributor

@digant73 Thank you for notifying me. I will look into it now.

@bigtreetech bigtreetech merged commit be231ba into bigtreetech:master Sep 22, 2021
@gordo3di
Copy link

I've been having random communication timeouts when using Repetier server connected via USB. Do you think this issue is related?

@digant73
Copy link
Contributor Author

@gordo3di no, I think it's not related to that PR. This PR simply purges (skips) all the gcodes that should be sent to the printer

jeffeb3 pushed a commit to V1EngineeringInc/BIGTREETECH-TouchScreenFirmware that referenced this pull request Nov 10, 2021
This was referenced Jun 14, 2022
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.

5 participants