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] BTT MMU DIP not connecting to SKR Mini E3 v3 #24677

Closed
1 task done
pennypacker007 opened this issue Aug 25, 2022 · 30 comments
Closed
1 task done

[BUG] BTT MMU DIP not connecting to SKR Mini E3 v3 #24677

pennypacker007 opened this issue Aug 25, 2022 · 30 comments

Comments

@pennypacker007
Copy link

Did you test the latest bugfix-2.1.x code?

Yes, and the problem still exists.

Bug Description

Main board is SKR Mini E3 v3 trying to connect to MMU DIP via TFT port. Connection below

SKR me3v3 MMU DIP
TFT Pins Pins
+5v--------------------+5v
Gnd-------------------Gnd
Tx----------------------Rx
Rx----------------------Tx
Reset------------------Reset

Port settings
Marlin 2.1.x Bugfix
Configuration.h

#define SERIAL_PORT -1
#define BAUDRATE 115200
//#define SERIAL_PORT_2

Configuration.adv.h
MMU2_SERIAL_PORT 2
#define MMU2_DEBUG

The above setup sends Marlin into a boot loop. Serial monitor returns attached error. Any help would be appreciated.

Terminal

Bug Timeline

New issue after setup and install of MMU2S with BBT MMU DIP board

Expected behavior

I expected the MMU to connect with the printers board

Actual behavior

Communication between the two boards fails.

Steps to Reproduce

Restart printer

Version of Marlin Firmware

2.1.x Bugfix

Printer model

AM8

Electronics

BTT SKR MINI E3 V3, MMU DIP

Add-ons

MMU2S

Bed Leveling

ABL Bilinear mesh

Your Slicer

Simplify3D

Host Software

OctoPrint

Don't forget to include

  • A ZIP file containing your Configuration.h and Configuration_adv.h.

Additional information & file uploads

No response

@ellensp
Copy link
Contributor

ellensp commented Aug 25, 2022

looks more like you have an issue with the mmu pinda probe since it crashed when you ask it to read the pinda state

@pennypacker007
Copy link
Author

pennypacker007 commented Aug 25, 2022 via email

@ellensp
Copy link
Contributor

ellensp commented Aug 25, 2022

Using external power? Usb is not sufficient

@pennypacker007
Copy link
Author

pennypacker007 commented Aug 25, 2022 via email

@GMagician
Copy link
Contributor

I checked code, for specified event, there is nothing evidentely wrong in code. Code is in 'case -4' waiting for an answer.

@GMagician
Copy link
Contributor

GMagician commented Aug 25, 2022

P0 command is sent also time to time then it may be a canditate for the cause.
What I see, maybe not correct, is sscanf(rx_buffer, "%hhuok\n", &finda);. finda is int8 and %hhu is uint8 but not sure it may be the cause

@GMagician
Copy link
Contributor

You may add a debug print in case -4, before sscanf and print rx_buffer. Just to see if it enters here or not

@pennypacker007
Copy link
Author

Thank you I will try that and post the result

@GMagician
Copy link
Contributor

oh, add the same "debug print" in case 2. This is when P0 is sent periodically

@pennypacker007
Copy link
Author

IMG_2609

@GMagician
Copy link
Contributor

is this message ("test output") what you get in rx_buffer?

@GMagician
Copy link
Contributor

and "'P0' complete" where does it come from?

@pennypacker007
Copy link
Author

IMG_2610

@pennypacker007
Copy link
Author

IMG_2611

@GMagician
Copy link
Contributor

That's not what I meant when I said to print out rx_buffer and also, in case - 4, inside Else you do an unnecessaru sscanf.
what I was thinking something like:

      if (rx_ok()) {
        DEBUG_ECHOLNPGM ("answer=>", rx_buffer, "<");
        sscanf(rx_buffer, "%hhuok\n", &finda);

or similar in output (if this doesn't compile)

From your code it seems that it hang while waiting for "ok" answer, or because of sscanf

@pennypacker007
Copy link
Author

IMG_2612

@pennypacker007
Copy link
Author

Thanks I tried your code and got the above response. Marlin then reboots continuously.

@GMagician
Copy link
Contributor

Since I don't see message:
"MMU 1"
"MMU - ENABLED"
it seems that sscanf or the debug print itself is the issue.
I highly suspect sscanf but you may continue to move the 'rx_buffer print' down one line each time to see.
Maybe sscanf doesn't handle correctly %hhu but in such case this is out of Marlin team control, maybe %hhi will behave correctly (and since variable is signed is a more sensed thing to do despite of result you get)

@pennypacker007
Copy link
Author

hi, have tried %hhi and same result

@pennypacker007
Copy link
Author

below is the output from pronterface:

Connecting...
echo:V86 stored settings retrieved (748 bytes; crc 9557)
//action:notification Stored settings retrieved
//action:prompt_end
MMU <= reset
Testing X connection... OK
Testing Y connection... OK
Testing Z connection... OK
Testing E connection... OK
echo:SD card ok
Printer is now online.
MMU => 'start'
MMU <= 'S1'
MMU => 107
MMU <= 'S2'
MMU => 134
MMU <= 'P0'
answer=>0ok
<
Exception in thread read thread:
Traceback (most recent call last):
File "printrun\printcore.py", line 333, in _readline
File "printrun\printcore.py", line 329, in _readline_nb
File "serial\serialwin32.py", line 275, in read
serial.serialutil.SerialException: ClearCommError failed (PermissionError(13, 'The device does not recognize the command.', None, 22))

@GMagician
Copy link
Contributor

GMagician commented Sep 5, 2022

What you get here is a PC error, not a Marlin fault.
Sure system you are using doesn't send a M112?

@ellensp
Copy link
Contributor

ellensp commented Sep 5, 2022

Googling the error shows "The error you see happens when the device on the other side of the connection resets or closes the connection for any other reason."

Yes its a system error, to the serial port abruptly vanishing

Here is where is gets "interesting"

The MMU is connected the the controllers serial UART 2
Pronterface is connected to the controllers CDC USB serial port, this is the one that is vanishing abruptly.

Which mean hard crash or power issue.

Do you have a lcd? (no config, so cannot check myself)

Does the Controller reboot or just stop talking? (if you have a lcd you would see the boot screen again)

@GMagician
Copy link
Contributor

@ellensp I suspect he has a lcd due to his statement:

The above setup sends Marlin into a boot loop

What I don't understandi is that a message before sscanf is printed while the one after isn't. Does Marlin reboot because of sscanf?
I read somewhere that %hhu may write to a 16 bits integer (https://stackoverflow.com/questions/15825254/why-is-scanfhhu-char-overwriting-other-variables-when-they-are-local). If this is true then reboot may occurs because of memory corruption

@GMagician
Copy link
Contributor

I checked and C89 is really old and we are using, as older, c++11 that is year after C89

@pennypacker007
Copy link
Author

Here are the config files. Yes @GMagician, I have an LCD connected and the machine reboots continuously which is why the serial connection disappears

Configuration.zip

@GMagician
Copy link
Contributor

I don't know where to look at. All seems bring to sscanf, but no real evidence, just suspects. To remove any doubt you may replace sscanf, where finda variable is involved, with finda = true;. You'll have issues using it (filament always present) but if it stops to reboot we know who is guilty.

@pennypacker007
Copy link
Author

@GMagician thank you, I have tried the above, commented sscanf out and finda = true; now receive the MMU - Enabled message and marlin then reboots which again drops the serial connection.
IMG_2624

@GMagician
Copy link
Contributor

Then sscanf is not guilty. No idea how to find where/why marlin hangs, sorry

@github-actions
Copy link

github-actions bot commented Nov 7, 2022

This issue has had no activity in the last 60 days. Please add a reply if you want to keep this issue active, otherwise it will be automatically closed within 10 days.

@github-actions
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 Jan 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants