Prusa MK3S and Raspberry Pi 3B+ serial garbage via GPIO

What is the problem?
I've connected my Raspberry Pi 3B+ to a Prusa MK3S printer. The connection is via GPIO and the Pi is powered externally through a power supply (not via GPIO from MK3S Einsy board).

I can get a connection at 115200 baud rate, but the serial line has LOTS of noise/garbage on it, rendering the "Operational" status unusable.

What did you already try to solve it?
I've followed the Prusa and Octoprint forum suggestions for configuring the operating system and Octoprint settings.

Logs (octoprint.log, serial.log or output on terminal tab at a minimum, browser error console if UI issue ... no logs, no support!)

Here is the relevant snippet from octoprint.log:

2019-11-24 10:59:35,388 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Opening serial port"
2019-11-24 10:59:35,396 - octoprint.util.comm - INFO - Changing monitoring state from "Opening serial port" to "Connecting"
2019-11-24 10:59:35,410 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2019-11-24 10:59:35,417 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2019-11-24 10:59:36,686 - octoprint.util.comm - INFO - Changing monitoring state from "Connecting" to "Operational"
2019-11-24 10:59:36,693 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2019-11-24 10:59:36,706 - octoprint.plugins.firmwareupdater - INFO - Got CONNECTED event
2019-11-24 10:59:36,714 - octoprint.plugins.firmwareupdater - INFO - Run postflash flag is not set
2019-11-24 10:59:59,636 - octoprint.util.comm - INFO - Got a resend request from the printer: requested line = 5, current line = 7
| Last lines in terminal:
| Recv: (n�k{�����BB$%��H�k�L�o���������������������������������gR)�����{n�-�n��jjL{
| Recv: �	���N�O��-h�(J���
| Recv: �*)HL�
| Recv: �L	k+����FB�Kjm��5�������n���{Y����i;�	��/��LLO��J��k�K-k)n�we}w�w�����BB!�h��BBJ�)1��DDB!!(
| Recv: k��BJ��#2���O�k�����������������������������-35�zZ��o�k�JL�Il��k�N���I���kI�n��.H����L���BB�!!!!!!������BC��(�J#�k������������������������wH�k�H�u������������������������n��j��.M-���---�m-n�kO��./m�,	�����BBBBB#�!!!�H(�����\�!M	����S#������bWW�15���n�2���k�~�ok
���������������������[������!�,���]���n��������������	����BSB#1�!	���!�H(�#��J��k�Y����������������Z{k9��5�.�k���������������i���9����-���-��*�L	J��(�m��j���kk{��(�����@BFB"!��-����%#�
| Recv: (	�k{X��S-�k�e�1��������%g�jnr��5)�����������������V���)���������j�/t��DBBB��N���*��H����!!�(H����B!���B!!IB�Zj�����w�no��nk����com�������o�o��O��,�H��J������MM���jg--]M�No������BD"�����BD!���BBC"%!!���c!���c!����c!���������k�o���������+��kB�b�Zhkq-kk�*�k/(�llH�����k�
| Recv: 	{�	hkhh	�
| Recv: h�
| Recv: 	����)%���1�����I������{3�ekm���kno������+��:��N��������nk{j+{k{
���N;��YN��J(Q�4Q�
| Recv: �����FBBB!1��
| Recv: ��JJ���J������ck))������Ks�k�m�u{oo�Uokoowo��omm������������������o�now��������'�im�n��o���r����*.��M�ok�kecno:Unknow�����+��KB�!���^�O"(2�G�k������������������}���})I�����N����k�O�����k�k����njkoM��m�O/�"(2)
| Recv: ��H����������������k����kk)�kj�o)V��j�B����]�U]��������.K��+j�
| Recv: "*�)
| Recv: ok
| Recv: ��������own��omo���:�RK����K�n���j-�Hok-���Ml�o)�l.j��DBbBB&!!!!P
| Recv: ���B!�(H�	*���c1(�cc)���)�k����K��k�k�n�u{no:���������������M+/jk�j}km���
| Recv: �)B����jJ/�Lno���o�	kk�H
| Recv: (k������BBB!a/-H
| Recv: 	���a�
�Bki-L�������1���������7kkm�������������bg�������h�sksum,"Lqst Line:!>�
| Recv: Resend�$5KokJ������[_����J��okkkkkkkkk))�KO������n�����M�N�����N��+n�
2019-11-24 10:59:59,686 - octoprint.util.comm - INFO - Firmware didn't send an 'ok' with their resend request. That's a known bug with some firmware variants out there. Simulating an ok to continue...
2019-11-24 10:59:59,692 - octoprint.util.comm - INFO - Got a resend request from the printer: requested line = 1, current line = 7
| Last lines in terminal:
| Recv: �L	k+����FB�Kjm��5�������n���{Y����i;�	��/��LLO��J��k�K-k)n�we}w�w�����BB!�h��BBJ�)1��DDB!!(
| Recv: k��BJ��#2���O�k�����������������������������-35�zZ��o�k�JL�Il��k�N���I���kI�n��.H����L���BB�!!!!!!������BC��(�J#�k������������������������wH�k�H�u������������������������n��j��.M-���---�m-n�kO��./m�,	�����BBBBB#�!!!�H(�����\�!M	����S#������bWW�15���n�2���k�~�ok
���������������������[������!�,���]���n��������������	����BSB#1�!	���!�H(�#��J��k�Y����������������Z{k9��5�.�k���������������i���9����-���-��*�L	J��(�m��j���kk{��(�����@BFB"!��-����%#�
| Recv: (	�k{X��S-�k�e�1��������%g�jnr��5)�����������������V���)���������j�/t��DBBB��N���*��H����!!�(H����B!���B!!IB�Zj�����w�no��nk����com�������o�o��O��,�H��J������MM���jg--]M�No������BD"�����BD!���BBC"%!!���c!���c!����c!���������k�o���������+��kB�b�Zhkq-kk�*�k/(�llH�����k�
| Recv: 	{�	hkhh	�
| Recv: h�
| Recv: 	����)%���1�����I������{3�ekm���kno������+��:��N��������nk{j+{k{
���N;��YN��J(Q�4Q�
| Recv: �����FBBB!1��
| Recv: ��JJ���J������ck))������Ks�k�m�u{oo�Uokoowo��omm������������������o�now��������'�im�n��o���r����*.��M�ok�kecno:Unknow�����+��KB�!���^�O"(2�G�k������������������}���})I�����N����k�O�����k�k����njkoM��m�O/�"(2)
| Recv: ��H����������������k����kk)�kj�o)V��j�B����]�U]��������.K��+j�
| Recv: "*�)
| Recv: ok
| Recv: ��������own��omo���:�RK����K�n���j-�Hok-���Ml�o)�l.j��DBbBB&!!!!P
| Recv: ���B!�(H�	*���c1(�cc)���)�k����K��k�k�n�u{no:���������������M+/jk�j}km���
| Recv: �)B����jJ/�Lno���o�	kk�H
| Recv: (k������BBB!a/-H
| Recv: 	���a�
�Bki-L�������1���������7kkm�������������bg�������h�sksum,"Lqst Line:!>�
| Recv: Resend�$5KokJ������[_����J��okkkkkkkkk))�KO������n�����M�N�����N��+n�
| Recv: H��h!!J��B!����BBBB!(H�(Hlk�B�1(��r�-�ok
������������z������������������o����n�,�kj�)�*��-�ok�}��k���s[��][_��������mesksum,0Last Line: 0�
| Recv: Resend:<1
| Send: N5 M105*34
2019-11-24 10:59:59,799 - octoprint.util.comm - INFO - Changing monitoring state from "Operational" to "Offline"
2019-11-24 11:00:00,197 - octoprint.util.comm - INFO - Firmware didn't send an 'ok' with their resend request. That's a known bug with some firmware variants out there. Simulating an ok to continue...

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible)

OctoPrint Version 1.3.12
OctoPi Version 0.17.0, running on Raspberry Pi 3 Model B Plus Rev 1.3
Prusa firmware version: 3.8.1

Hello @JackN!

Can you tell something about the wiring between the Einsy board and the Pi? Length, type of cable, ferrite cores...

Hi @Ewald_Ikemann,

Thanks for your quick reply. I used a 10 wire ribbon cable, 28 AWG, and it is just a little over 3 feet long. No ferrite cores. Do you think it is external signal interference that is causing the garbage data in the transmission?

Yes, it's like an antenna for all the unwanted electric noise around. And there is a lot of them.

At least you need a shielded cable with two wires inside, if you have the two wire solution.
The ferrite core at the ends are optional but very recommended, but the shielded cable is a must. Especially with that length.

1 Like

Thank you. I will order some shielded wire and ferrite core, and trust that this will solve my problem. I will close this issue for now.

Also, you want to make sure the Raspberry is using the good UART to the GPIO-related serial connection.

sudo raspi-config -> Interfaces -> Serial -> "no", "yes"

Also, add dtoverlay=pi3-disable-bt to the /boot/config.txt file.