Octopi USB issues on Raspberry Pi B+ with Ender 3

There is a lot of stuff like this appearing in my serial.log:

2020-09-10 14:35:59,188 - Send: N684 G1 F1500 X124.086 Y126.349 E113.72133*15
2020-09-10 14:35:59,220 - Recv: ok
2020-09-10 14:35:59,226 - Send: N685 G0 F9000 X123.52 Y126.349*112
2020-09-10 14:35:59,228 - Recv: Error:checksum mismatch, Last Line: 682
2020-09-10 14:35:59,231 - Recv: Resend: 683
2020-09-10 14:35:59,236 - Recv: ok
2020-09-10 14:35:59,240 - Send: N683 G0 F9000 X108.649 Y110.912*66
2020-09-10 14:36:00,075 - Recv: ok
2020-09-10 14:36:00,082 - Recv: Error:Line Number is not Last Line Number+1, Last Line: 682
2020-09-10 14:36:00,085 - Send: N684 G1 F1500 X124.086 Y126.349 E113.72133*15
2020-09-10 14:36:00,089 - Recv: Resend: 683
2020-09-10 14:36:00,113 - Recv: ok
2020-09-10 14:36:00,117 - Send: N685 G0 F9000 X123.52 Y126.349*112
2020-09-10 14:36:00,120 - Recv: Error:Line Number is not Last Line Number+1, Last Line: 682
2020-09-10 14:36:00,123 - Recv: Resend: 683
2020-09-10 14:36:00,128 - Recv: ok
2020-09-10 14:36:00,132 - Recv: ok
2020-09-10 14:36:00,136 - Send: N683 G0 F9000 X108.649 Y110.912*66
2020-09-10 14:36:00,140 - Recv: echo:Unknown command: "Êîoûæÿ÷wûÿn"
2020-09-10 14:36:00,142 - Recv: ok
2020-09-10 14:36:00,145 - Send: N684 G1 F1500 X124.086 Y126.349 E113.72133*15
2020-09-10 14:36:00,148 - Recv: echo:Unknown command: "÷ï÷÷÷ï÷ÿçï÷ÿ÷÷÷÷÷÷÷ÿ÷÷÷ÿýã"
2020-09-10 14:36:00,149 - Send: N685 G0 F9000 X123.52 Y126.349*112
2020-09-10 14:36:00,152 - Recv: ok
2020-09-10 14:36:00,157 - Send: N686 G1 F1500 X108.649 Y111.478 E114.42081*11
2020-09-10 14:36:00,159 - Recv: Error:Line Number is not Last Line Number+1, Last Line: 682
2020-09-10 14:36:00,162 - Recv: Resend: 683
2020-09-10 14:36:00,169 - Recv: ok
2020-09-10 14:36:00,173 - Send: N683 G0 F9000 X108.649 Y110.912*66
2020-09-10 14:36:00,595 - Recv:   TT::194.09194.09  //195.00195.00  BB::59.9759.97  //60.0060.00  @@::8787  BB@@::4040
2020-09-10 14:36:00,597 - Recv: 
2020-09-10 14:36:00,998 - Recv: ok
2020-09-10 14:36:01,002 - Send: N684 G1 F1500 X124.086 Y126.349 E113.72133*15
2020-09-10 14:36:01,002 - Recv: Error:Line Number is not Last Line Number+1, Last Line: 686
2020-09-10 14:36:01,006 - Recv: Resend: 687
2020-09-10 14:36:01,010 - Recv: ok
2020-09-10 14:36:01,017 - Send: N687 G0 F9000 X126.349 Y115.601*71
2020-09-10 14:36:01,019 - Recv: Error:Line Number is not Last Line Number+1, Last Line: 686
2020-09-10 14:36:01,023 - Recv: Resend: 687
2020-09-10 14:36:01,031 - Recv: ok
2020-09-10 14:36:01,037 - Send: N687 G0 F9000 X108.649 Y112.043*73
2020-09-10 14:36:01,040 - Recv: ok
2020-09-10 14:36:01,046 - Send: N688 G1 F1500 X122.955 Y126.349 E115.09372*15
2020-09-10 14:36:01,951 - Recv: ok
2020-09-10 14:36:01,967 - Send: N689 G0 F9000 X122.389 Y126.349*72
2020-09-10 14:36:01,979 - Recv: Error:Line Number is not Last Line Number+1, Last Line: 687
2020-09-10 14:36:01,985 - Recv: Resend: 688
2020-09-10 14:36:01,989 - Recv: ok
2020-09-10 14:36:01,993 - Recv: Error:Line Number is not Last Line Number+1, Last Line: 687
2020-09-10 14:36:01,996 - Send: N688 G1 F1500 X122.955 Y126.349 E115.09372*15
2020-09-10 14:36:01,997 - Recv: Resend: 688
2020-09-10 14:36:02,006 - Recv: ok
2020-09-10 14:36:02,009 - Send: N689 G0 F9000 X122.389 Y126.349*72
2020-09-10 14:36:02,011 - Recv: ok
2020-09-10 14:36:02,017 - Send: N690 G1 F1500 X108.649 Y112.609 E115.74001*7
2020-09-10 14:36:02,595 - Recv:   TT::194.55194.55  //195.00195.00  BB::59.9959.99  //60.0060.00  @@::7777  BB@@::3838
2020-09-10 14:36:02,598 - Recv: 
2020-09-10 14:36:02,939 - Recv: ok
2020-09-10 14:36:02,945 - Send: N691 G0 F9000 X108.649 Y113.175*75
2020-09-10 14:36:02,945 - Recv: Error:checksum mismatch, Last Line: 688
2020-09-10 14:36:02,949 - Recv: Resend: 689
2020-09-10 14:36:02,954 - Recv: ok
2020-09-10 14:36:02,958 - Send: N689 G0 F9000 X122.389 Y126.349*72
2020-09-10 14:36:02,960 - Recv: echo:Unknown command: "ä&îÿçfJ"
2020-09-10 14:36:02,963 - Recv: ok
2020-09-10 14:36:02,966 - Recv: Error:Line Number is not Last Line Number+1, Last Line: 688
2020-09-10 14:36:02,970 - Send: N690 G1 F1500 X108.649 Y112.609 E115.74001*7
2020-09-10 14:36:02,973 - Recv: Resend: 689
2020-09-10 14:36:02,981 - Recv: ok
2020-09-10 14:36:02,984 - Send: N691 G0 F9000 X108.649 Y113.175*75
2020-09-10 14:36:02,988 - Recv: ok
2020-09-10 14:36:02,993 - Recv: echo:Unknown command: "÷ÿ÷ÿÿÿÿïÿÿûF"
2020-09-10 14:36:02,995 - Send: N692 G1 F1500 X121.823 Y126.349 E116.35968*10
2020-09-10 14:36:03,017 - Recv: ok
2020-09-10 14:36:03,026 - Send: N693 G0 F9000 X121.258 Y126.349*77
2020-09-10 14:36:03,027 - Recv: echo:Unknown command: "÷ÿÿÿÿÿÿÿ÷ÿ§¬H€
                                                                    "
2020-09-10 14:36:03,030 - Recv: ok
2020-09-10 14:36:03,037 - Send: N694 G1 F1500 X108.649 Y113.74 E116.95276*48
2020-09-10 14:36:03,958 - Recv: ok
2020-09-10 14:36:03,964 - Send: N695 G0 F9000 X108.649 Y114.306*78
2020-09-10 14:36:03,993 - Recv: ok
2020-09-10 14:36:03,999 - Send: N696 G1 F1500 X120.692 Y126.349 E117.51923*7
2020-09-10 14:36:04,595 - Recv:   TT::195.00195.00  //195.00195.00  BB::60.0060.00  //60.0060.00  @@::6868  BB@@::3535
2020-09-10 14:36:04,610 - Recv: 
2020-09-10 14:36:05,009 - Recv: ok
2020-09-10 14:36:05,014 - Send: N697 G0 F9000 X120.126 Y126.349*66
2020-09-10 14:36:05,045 - Recv: ok
2020-09-10 14:36:05,051 - Send: N698 G1 F1500 X108.649 Y114.872 E118.05907*15
2020-09-10 14:36:05,053 - Recv: echo:Unknown command: "1.258 Y126.349"
2020-09-10 14:36:05,057 - Recv: ok
2020-09-10 14:36:05,062 - Send: N699 G0 F9000 X108.649 Y115.438*73
2020-09-10 14:36:05,064 - Recv: Error:Line Number is not Last Line Number+1, Last Line: 692
2020-09-10 14:36:05,068 - Recv: Resend: 693
2020-09-10 14:36:05,072 - Recv: ok
2020-09-10 14:36:05,076 - Recv: echo:Unknown command: "8.649 Y113.74 E116.95276"
2020-09-10 14:36:05,079 - Send: N693 G0 F9000 X121.258 Y126.349*77
2020-09-10 14:36:05,079 - Recv: ok
2020-09-10 14:36:05,086 - Send: N694 G1 F1500 X108.649 Y113.74 E116.95276*48
2020-09-10 14:36:05,088 - Recv: echo:Unknown command: "8.649 Y114.306"
2020-09-10 14:36:05,092 - Recv: ok
2020-09-10 14:36:05,095 - Recv: echo:Unknown command: "0.692 Y126.349 E117.51923"
2020-09-10 14:36:05,097 - Send: N695 G0 F9000 X108.649 Y114.306*78
2020-09-10 14:36:05,100 - Recv: ok
2020-09-10 14:36:05,103 - Recv: Error:Line Number is not Last Line Number+1, Last Line: 692
2020-09-10 14:36:05,108 - Recv: Resend: 693
2020-09-10 14:36:05,112 - Send: N696 G1 F1500 X120.692 Y126.349 E117.51923*7
2020-09-10 14:36:05,139 - Recv: ok
2020-09-10 14:36:05,146 - Recv: Error:Line Number is not Last Line Number+1, Last Line: 692
2020-09-10 14:36:05,150 - Send: N697 G0 F9000 X120.126 Y126.349*66
2020-09-10 14:36:05,155 - Recv: Resend: 693
2020-09-10 14:36:05,164 - Recv: ok
2020-09-10 14:36:05,168 - Send: N698 G1 F1500 X108.649 Y114.872 E118.05907*15
2020-09-10 14:36:05,170 - Recv: echo:Unknown command: ""
2020-09-10 14:36:05,173 - Recv: ok

It looks like the serial data is being corrupted.

Yes, as @fieldOfView already pointed out.

This is my setup:

You can see the short usb cable with the ferrite bead on it.

Somethings still missing with the serial communication however. This is an issue you'll need to solve before you can expect reliable operation from OctoPrint. It needs to be able to talk to your printer without half of the messages getting garbled in the process in order to do its job :woman_shrugging:

If I wrap my USB cable in foil and attach that to the ground pin of my powersupply (essentially just connected to the earth pin on a socket) would that shield the signal? Would that be enough to rule out a dodgy USB cable?

I have tried 4 different cables now but I can't be sure if any of them are shielded because you can't see through the insulation.

I think it's working:

I attached the foil to the chassis of the raspberry pi and the Ender 3. Looks like the corruption has stopped.

Here are the results:

The one on the left had no shielding.

I wrapped the cable in foil and attached it to the earth pin of my PSU and started to print again but it didn't work. I then ready that you need to attach it to the earth of the devices at each end of the connection so I hooked up more wires from the foil to the usb port's ground on the Raspberry Pi and the PSU of the Ender 3 and the messages stopped.

You can see a cross pattern on the bottom of the print on the right - this is from the corruption. I think the printer was not receiving the message to stop extruding. As soon as I fixed the shielding the crossing stopped!

Honestly, I thought all of this talk about shielding USB cables was a load of rubbish. Looks like I was wrong! Also goes to show how few USB cables have the proper shielding.

I have a shielded 15cm cable showing up tomorrow. I couldn't find one with a Ferrite Core but I don't think it matters. I'll test it tomorrow and let you know what happens.

Either way thanks for your help!

1 Like

If the shielded USB cable works, could you please post a link so others can easily order one?

Yes will do. It's due to arrive tomorrow so I will test and update this thread to say whether it works or not either tomorrow or the next day

The USB cable turned up today but it was too short. I ran it through an (also shielded) short USB extension but the problem was not fixed.

I've ordered a longer shielded cable and some clip on ferrite chokes which should arrive Monday - I will do some testing and report back here!

I'm not sure if anyone's still actually interested in this but I promised I would post when I'd solved the problem.

I ordered a USB cable but when I tested it it didn't work without my aluminium foil shielding, so I ordered another cable which didn't arrive until today. Over the weekend I upgraded the motherboard of my printer to a new silent motherboard (and it really does silence the stepper motors!) and then when the new cable turned up this morning I plugged it in and everything worked perfectly.

As always seems to be the case with 3D printing, there were too many variables to tell what had actually fixed it as I had upgraded the motherboard and swapped the cable, so I went back to my original cable that didn't used to work, this time without my extra shielding... and it worked!

So, switching the motherboard seemed to fix the corruption problem, not switching the cable!

The reason I was suspicious in the first place was that I had a conversation with an electrical engineer about the shielding thing and he seemed very surprised that none of my USB cables were shielded in the first place.

So my new question is, what was causing the problem?

I know it wasn't the cable as the old cable is now working. Was it the old stepper drivers - maybe as well as being noisy as hell they emit lots of electromagnetic noise too? Was it poor grounding on the old motherboard? There's a chance that my foil shielding wasn't actually doing anything but providing a low impedance path from the ground of the Raspberry Pi to the ground of my printer's power supply?

In the name of science I should probably refit the old motherboard and test some stuff, but it was a real pain to change over and there's no way I'm going through that process another couple of times.

If anyone else has this problem I would be very interested to see if it is fixed by running a jumper wire between ground of the two devices.

Sorry if this is not conclusive. I'm just glad I can retire my messy aluminium foil!

Just to clarify, I did monitor this and definitely was still interested in the outcome ^^

If you want to further experiment, you should be able to do connection testing without the actual printer being attached, just with the board. At least connecting should work. Depending on the firmware that is on that board supporting it or not, there was also a dry-run command built into at least mainline Marlin that would allow to print without printing and that should unearth any communication issues. Alternatively you could try streaming a file to SD, if there are communication issues that definitely will also unveal them, maybe even more so than printing. Could you post a picture of the controller board?

Also, just as a heads-up, make sure you update the firmware on the silent board, I remember seeing some posts on here that indicated some issues with one axes stopping to move all of a sudden during a print that if I remember correctly got fixed for everyone trying so far by a firmware upgrade.

I had similar issues with ender 3 and pi3 and pi 4
Changed usb cables ,tried shielding ,two different pi 2.5amp power supplies and could not get consistent usb connections
What i found eventually was that the usb connector was not grounding properly and every now and again the usb would disconnect
Solved eventually by moving the pi off the same workbench surface and it worked for weeks with no issues with 3 hour prints
Since then i have updated to a 32 bit bigtree v2 motherboard and have not had an issue since
I think it came down to bad grounds on either usb connector on pi or ender3 motherboard

Well, this seems like some issues I have (had).
First: make sure ther is no +5V connected to both sides of the USB-cable (see other topics here): it can make really many strange communication-problems when the Pi is sometimes feeding the printers mainboard with power or the other way round. I normally just cut the 5V wire in the USB-cable but there are other ways of doing this.

Second: on some (!) printers I still have problems with communication and for sofar all are solved by simply making an 0 / ground connection besides the small one in the USB-cable directly between printer and Pi.

So, simply: a wire from one 0 on the printer's UPS to one 0 on the Pi's power-supply (or on the Pi itself).
This makes sure that they both have the same potential to ground and all differences in voltage are therefore levelled off and don't have to go over the USB-wires and therefore the signal is getting there much more stable.
Of course, if you use a grounded shielded cable with the shield connected to 0 on both sides (so, on the metal houses of the USB-connectors), you are doing the same thing.
But: not every printer has the houses of the USB connected to 0 and not every USB-cable has this shield connected on both sides.

Think of all cables like 'antennies' that will pick up signals (and voltages) from everywhere around.

By the way, always make sure the earth of your printer is connected to the case and to the earth of your socket. With a multimeter you can test this.

You probably have solved it with the other motherboard because that board has better grounding.

Here is a picture of the (old) mainboard. This is version 4.2.2.

The new mainboard (v4.2.7) looks very similar.

In theory I would like to do some more testing to be sure - but with a 5 month old baby in the house it's hard to find time to do projects! I'd also underestimated what a time sink this would be in general. 3D printing seemed like something where you would set it up and just print stuff but it's turning out to be a full blown hobby!

I have a bench power supply so maybe I can hook the mainboard up to that at the weekend and give it a go.

Also I have updated to the latest firmware too.

The sheath of the USB port is not connected in either the old v4.2.2 mainboard or the new v4.2.7 mainboard.

Regardless of whether the tin foil did anything or not, it is definitely some kind of a grounding issue. I'm just finding it hard to understand how the new mainboard fixed it considering the usb sheath is not connected on that either!

Hello,
I have serial communication problems as well. And my PI is feeding my Ender 3 V2: when switching on PI with ender switched off, the ender's display is working!

How can I manage to "cut" the 5V-line in the USB-cable without ditroying ot?

You can use electrical tape.

1 Like

Thanks a lot! This works fine, as far as I can see. BUT: Only for PI 3B+. I dont get it to work on PI 4B (2 GB).

Correct me if I'm wrong, but I believe there are two issues here. One is the 5V issue which should be fixed with some electrical tape (or similar). The other is the communications issue which appears to be caused by grounding or EMI. A properly shielded USB cable with ferrite beads usually mitigates this issue.

@ohawd, you jumped into this thread so we are without a proper problem description from you. It would serve you best to open a new thread taking the time to fill out the template with the relevant details and we can address your specific issue.