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

[BUG] Line number is not Last Liner Number+1 #2910

Closed
MrKuskov opened this issue Mar 9, 2024 · 7 comments
Closed

[BUG] Line number is not Last Liner Number+1 #2910

MrKuskov opened this issue Mar 9, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@MrKuskov
Copy link

MrKuskov commented Mar 9, 2024

Description

When printing any G-Code with the Command checksum function enabled, I constantly see errors. For example, in the calibration retraction test, I see the following errors at the beginning of printing.
line: cur=6437, exp =6431.
Line number is not Last Liner Number+1, last line: 6442.
line: cur=6433, exp =6431.
Line number is not Last Liner Number+1, last line: 6434.
line: cur=6440, exp =6435.
This is all when printing this file. The values change for different files, but the essence does not. At the same time, messages like "unknown command *84" or "-1.65 Y23" appear in the upper line, that is, it is clear that these are card reading errors (*84 - X84). Skipping one command has almost no effect on print quality, but when printing a thin-walled part, it is almost always a defect. I have tried using different cards in different connectors and USB FLash, sometimes errors disappear, but most often 1 or 2 per printing session appear. How to set up error-free printing or G-code duplication?
retraction_tower_PETG_16m39s.zip

TFT35 B1 V3

@MrKuskov MrKuskov added the bug Something isn't working label Mar 9, 2024
@digant73
Copy link
Contributor

digant73 commented Mar 9, 2024

it seems you enabled advanced_ok but it is not properly supported/configured on Marlin side. Disable it on TFT side only (it is enough). Those errors you reported are related to a corruption on Marlin side (data are properly read from SD card)

@MrKuskov
Copy link
Author

MrKuskov commented Mar 9, 2024

yes it is enabled. And how to set it up correctly? It seems that I have followed all the instructions for setting up.
the configuration for biqu B1 is set to

#define MAX_CMD_SIZE 96
#define BUFSIZE 32

The instructions say

#     - "RX_BUFFER_SIZE" properly configured in Configuration_adv.h in Marlin firmware.
#       To be safe you need (MAX_CMD_SIZE * BUFSIZE) RX buffer. By default this is 96 * 4 bytes so
#       you would need to at least set RX_BUFFER_SIZE to 512 bytes, practically half of that will
#       be enough, but more is better/safer.

but only the following buffer size options are given in the configuration

// :[0, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048]
#define RX_BUFFER_SIZE 1024

what buffer size should I set?

@rondlh
Copy link

rondlh commented Mar 9, 2024

what buffer size should I set?

32 * 96 = 3KB, so if your hardware supports it set RX_BUFFER_SIZE to 2048, this should be fine.
Your BUFSIZE of 32 is quite big, you could also consider lowering it to 8 or 16. 4 is the default, and I personally use 8.
Without advanced ok you basically only send 1 command at a time and wait for Marlin to acknowledge it before sending the next command.

@MrKuskov
Copy link
Author

@rondlh I have a Biqu B1 SKR 1.4 board, can you tell me which buffer can be used for this board?

@MrKuskov
Copy link
Author

I used the following parameters:
config.ini
tx slots:4
Configuration_adv.h:

#define MAX_CMD_SIZE 96
#define BUFSIZE 8
#define TX_BUFFER_SIZE 32
#define RX_BUFFER_SIZE 1024
#if RX_BUFFER_SIZE >= 1024
  #define SERIAL_XON_XOFF
#endif

everything seems to be working correctly

@digant73
Copy link
Contributor

digant73 commented Mar 15, 2024

@MrKuskov remember that tx_slots in config.ini is used by TFT only if ADVANCED_OK is not enabled in Configuration_adv.h (in Marlin fw). If you enable ADVANCED_OK then you enable the real advanced ok feature provided by Marlin and tx_slots in config.ini has no effect at all because the tx slots are dynamically reported by Marlin (in you case it will be at maximum 7 (BUFSIZE - 1)).

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants