"Failed to autodetect serial port, please set it manually"

What is the problem?
I set up OctoPi yesterday and was able to connect to my Ender 3 printer. Today, I cannot. I can SSH to OctoPi and bring up the web interface via its IP address or via http://octopi/.

What did you already try to solve it?
I enabled serial logging, but it didn't tell me much. I have no options in the "Serial Port" dropdown box. I have the baud rate set to 115200, but yesterday I had it set to "AUTO" and it connected just fine.

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

Too long for post body... will attempt to upload a ZIP of serial.log and octoprint.log.

LOGS.zip (5.5 KB)

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible)
OctoPrint 1.3.12, OctoPi 0.17.0, running on Raspberry Pi 3 Model B Rev 1.2, Ender 3 Pro with stock firmware (for now). Using a Win 10 laptop with Chrome.

I ran dmesg this morning after plugging the Ender 3 into an as-yet unused USB port and got this:

[70181.726320] Under-voltage detected! (0x00050005)
[70187.967391] Voltage normalised (0x00000000)
[70262.859340] Under-voltage detected! (0x00050005)
[70269.100280] Voltage normalised (0x00000000)
[70445.924434] rpi_firmware_get_throttled: 5 callbacks suppressed
[70445.924441] Under-voltage detected! (0x00050005)
[70452.165229] rpi_firmware_get_throttled: 5 callbacks suppressed
[70452.165236] Voltage normalised (0x00000000)
[70456.325759] Under-voltage detected! (0x00050005)
[70460.486282] Voltage normalised (0x00000000)
[70477.128429] Under-voltage detected! (0x00050005)
[70483.369214] Voltage normalised (0x00000000)
[70618.588979] usb 1-1.2: new full-speed USB device number 8 using dwc_otg
[70618.688936] usb 1-1.2: device descriptor read/64, error -32
[70618.908865] usb 1-1.2: device descriptor read/64, error -32
[70619.128761] usb 1-1.2: new full-speed USB device number 9 using dwc_otg
[70619.228724] usb 1-1.2: device descriptor read/64, error -32
[70619.448631] usb 1-1.2: device descriptor read/64, error -32
[70619.568663] usb 1-1-port2: attempt power cycle
[70620.228304] usb 1-1.2: new full-speed USB device number 10 using dwc_otg
[70620.261772] usb 1-1.2: New USB device found, idVendor=1a86, idProduct=7523, b                                                                                        cdDevice= 2.63
[70620.261787] usb 1-1.2: New USB device strings: Mfr=0, Product=2, SerialNumber                                                                                        =0
[70620.261796] usb 1-1.2: Product: USB2.0-Serial
[70620.350461] usbcore: registered new interface driver usbserial_generic
[70620.350531] usbserial: USB Serial support registered for generic
[70620.355256] usbcore: registered new interface driver ch341
[70620.355336] usbserial: USB Serial support registered for ch341-uart
[70620.355425] ch341 1-1.2:1.0: ch341-uart converter detected
[70620.361075] usb 1-1.2: failed to receive control message: -32
[70620.361129] ch341-uart: probe of ttyUSB0 failed with error -32
[70778.588441] rpi_firmware_get_throttled: 11 callbacks suppressed
[70778.588449] Under-voltage detected! (0x00050005)
[70788.987038] rpi_firmware_get_throttled: 11 callbacks suppressed
[70788.987045] Voltage normalised (0x00000000)
[70822.273165] Under-voltage detected! (0x00050005)
[70826.422725] Voltage normalised (0x00000000)
[70863.859310] Under-voltage detected! (0x00050005)
[70870.098772] Voltage normalised (0x00000000)

I'm going to change the power supply to the Pi first to see whether I can clear that undervoltage problem. But I still can't connect to the printer.

EDIT: A new power supply solved the problem. I have no idea why I was able to connect yesterday with exactly the same setup and (non-active) "undervoltage" warnings on OctoPi... but I can connect today.

1 Like

I spoke too soon. I've done that a few times this morning. I did one successful print through OctoPi, end-to-end, and after the print was completed the printer stopped responding again. I went out, shut off the printer, moved the USB cable to a different Pi port, and then powered up the printer. Here's the results of dmesg:

[  229.850584] usb 1-1.3: new full-speed USB device number 8 using dwc_otg
[  229.950599] usb 1-1.3: device descriptor read/64, error -32
[  230.170600] usb 1-1.3: device descriptor read/64, error -32
[  230.390595] usb 1-1.3: new full-speed USB device number 9 using dwc_otg
[  230.490604] usb 1-1.3: device descriptor read/64, error -32
[  230.710576] usb 1-1.3: device descriptor read/64, error -32
[  230.830674] usb 1-1-port3: attempt power cycle
[  230.950728] Under-voltage detected! (0x00050005)
[  231.500609] usb 1-1.3: new full-speed USB device number 10 using dwc_otg
[  231.940609] usb 1-1.3: device not accepting address 10, error -32
[  232.040614] usb 1-1.3: new full-speed USB device number 11 using dwc_otg
[  232.480612] usb 1-1.3: device not accepting address 11, error -32
[  232.480703] usb 1-1-port3: unable to enumerate USB device
[  235.110714] Voltage normalised (0x00000000)

What is going on? It appears that "unable to enumerate USB device" is where OctoPi gives up on connecting.

Try this :slight_smile:

Thanks... I just tried that, but I got the same problem and same messages from OctoPi. To be sure, I want to just cut the conductor. Are the wire colors standard? I have white, black, red, and green.

EDIT: The RED wire is pin 1. I cut it and reconnected, then rebooted OctoPi. Same issue.

The one difference I do notice is that the Ender 3 control screen is no longer dimly lit when the printer is powered off; now it's not lit at all. I'll bet the undervoltage error was from the printer drawing power from the Pi board. That's no longer happening... but I still can't connect. The messages are the same as before. This is from the last Pi reboot with the printer connected via USB and powered up:

[    3.781789] usb 1-1.5: new full-speed USB device number 6 using dwc_otg
[    4.102352] random: systemd: uninitialized urandom read (16 bytes read)
[    4.116731] random: systemd: uninitialized urandom read (16 bytes read)
[    4.120403] systemd[1]: Listening on Journal Socket (/dev/log).
[    4.127490] random: systemd: uninitialized urandom read (16 bytes read)
[    4.130727] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    4.140041] systemd[1]: Reached target Swap.
[    4.147007] systemd[1]: Listening on fsck to fsckd communication Socket.
[    4.221809] usb 1-1.5: device not accepting address 6, error -32
[    4.321845] usb 1-1.5: new full-speed USB device number 7 using dwc_otg
[    4.761825] usb 1-1.5: device not accepting address 7, error -32
[    4.762000] usb 1-1-port5: unable to enumerate USB device

If I'm ever in a situation where there's a bomb to be defused in the next ten seconds, I wanna be with this dude.

Heh, thanks... no hesitation in cutting the red wire, but if OctoPi working = bomb not detonating, then I'd say we both chose poorly.

I just left both the printer and the RPi powered off for 15 minutes to see if that would help... but no luck. I'm getting pretty frustrated with this seeing as it worked just fine this morning. A couple of resources I was able to find but haven't done much with include:
This which led me to "this." (Apparently I'm only allowed one link per post? That's handy.)

I thought if I let them sit for awhile I might get somewhere, based on a response to that second thread linked above. I suppose I need to try another cable.

  • Make sure that the printer board is connected to power and turned ON at the same time or before powering on the Pi board
  • Make sure that nothing else is plugged into the Pi (minimizing power requirement temporarily)
  • Make sure that the serial cable has internal metallic shielding or a ferrite core
  • Make sure that the Pi's power adapter is 5V @ 2.5A and isn't a "charger"
  • Make sure that the microUSB power connection fits tightly both in the Pi in in the wall socket
  • If you have it as an option, plug that into a UPS or verify that the wall socket is giving you a full 120VAC (assuming the states)
  • Try it in Safe Mode (to make sure that third-party plugins aren't getting in the way)

Basically, in an undervoltage condition the ability to differentiate a digital one from a zero becomes problematic. This makes handshaking with a serial device a problem.

Boot the Pi without the serial cable (and nothing else attached) and make sure that it still doesn't suffer from the undervoltage condition. Put a multimeter across BOARD pins 2 (5V) and 39 (Gnd) and let us know what the meter reads.

Plug in the serial cable and measure again. It shouldn't go down from that earlier value.

4.64VDC is the low threshold that throws the undervoltage messages, forces the CPU to lower its speed and starts to shut down devices.

1 Like

Since changing out the supply, I'm no longer getting an undervoltage condition. I just checked dmesg | grep -i volt and dmesg | grep -i under and there's nothing there. There's plenty under dmesg | grep -i usb. I should say that I am by no means proficient in Linux, but I can Google.

The web UI is no longer showing undervoltage, but the printer isn't recognized in any USB port. I have been shutting off Pi before shutting off the printer, and powering up the printer before turning on Pi.

EDIT: volts between pin 2 and 39 are 5.060VDC. I have no other devices plugged into the Pi (USB or otherwise).

Alright, you're past any undervoltage conditions, for the moment at least.

dmesg | grep usb # ought to return more than you're looking for

But if you unplug and then re-plug the serial cable then what's at the end of that is what you're interesting in:

# Plug in the serial cable (again)
dmesg | tail -f -n 25
[   22.893481] ICMPv6: process `dhcpcd' is using deprecated sysctl (syscall) net.ipv6.neigh.wlan0.retrans_time - use net.ipv6.neigh.wlan0.retrans_time_ms instead
[   44.662276] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[12966.070202] i2c-bcm2835 fe804000.i2c: i2c transfer timed out
[12967.110221] i2c-bcm2835 fe804000.i2c: i2c transfer timed out
----- New stuff from re-plugging in my serial cable -----------------------------
[18672.870740] usb 1-1.3: USB disconnect, device number 4
[18672.871271] cdc_acm 1-1.3:1.0: failed to set dtr/rts
[18675.727982] usb 1-1.3: new full-speed USB device number 7 using xhci_hcd
[18675.865569] usb 1-1.3: New USB device found, idVendor=1d50, idProduct=6015, bcdDevice= 1.00
[18675.865586] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[18675.865600] usb 1-1.3: Product: Smoothieboard # <-- That's my board ----------
[18675.865611] usb 1-1.3: Manufacturer: Uberclock
[18675.865623] usb 1-1.3: SerialNumber: 17000022AF1A0C4859A5C92CF50020C2
[18675.873830] cdc_acm 1-1.3:1.0: ttyACM1: USB ACM device # <-- And the device --
[18675.879302] usb-storage 1-1.3:1.2: USB Mass Storage device detected
[18675.879954] scsi host1: usb-storage 1-1.3:1.2
[18676.940837] scsi 1:0:0:0: Direct-Access     MBED.ORG MBED USB DISK    1.0  PQ: 0 ANSI: 0 CCS
[18676.941650] sd 1:0:0:0: Attached scsi generic sg1 type 0
[18676.946395] sd 1:0:0:0: [sdb] 7744512 512-byte logical blocks: (3.97 GB/3.69 GiB)
[18676.946897] sd 1:0:0:0: [sdb] Write Protect is off
[18676.946912] sd 1:0:0:0: [sdb] Mode Sense: 03 00 00 00
[18676.947569] sd 1:0:0:0: [sdb] No Caching mode page found
[18676.947583] sd 1:0:0:0: [sdb] Assuming drive cache: write through
[18676.983113]  sdb: sdb1
[18676.986934] sd 1:0:0:0: [sdb] Attached SCSI removable disk
[18698.066868] FAT-fs (sdb1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

As you can see, sometimes it can get a little chatty. In my case, the Smoothieboard also brings in another mountable SD drive so it logs all that as well. Try to find the tree-in-the-forest and find the port, noting that this line didn't include the word usb (lowercase) at all. In fact, you might try just dmesg grep tty|grep -i usb:

[   16.819386] cdc_acm 1-1.2:1.1: ttyACM0: USB ACM device
[   16.822461] cdc_acm 1-1.3:1.0: ttyACM1: USB ACM device
[18675.873830] cdc_acm 1-1.3:1.0: ttyACM1: USB ACM device

I'm going to lose my mind.

Everything's fine now. Connected. I changed nothing from the last attempt. I shut everything off (again) and left it alone, albeit a little longer this time. Last time was maybe 15 minutes; this time, almost 2 hours.

Here's the log after plugging in the powered-up printer:

[   58.341691] usb 1-1.2: new full-speed USB device number 4 using dwc_otg
[   58.474799] usb 1-1.2: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.63
[   58.474812] usb 1-1.2: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[   58.474821] usb 1-1.2: Product: USB2.0-Serial
[   58.566852] usbcore: registered new interface driver usbserial_generic
[   58.569208] usbserial: USB Serial support registered for generic
[   58.574874] usbcore: registered new interface driver ch341
[   58.575271] usbserial: USB Serial support registered for ch341-uart
[   58.575654] ch341 1-1.2:1.0: ch341-uart converter detected
[   58.577783] usb 1-1.2: ch341-uart converter now attached to ttyUSB0

I can't explain it, but it's working again. Time to set my e-steps while I still can.

Okay, so go into your OctoPrint -> Settings -> Printer -> Serial Connection -> General tab and add /dev/ttyUSB* to Additional Serial Ports. Then when OctoPrint is set for AUTO for the device it will try those combinations as well. Additionally, just press Disconnect from the Connection side panel widget, manually select the ttyUSB0 from the pull-down, manually select 115200 for the baud rate, check the box for Save Connection Settings as well as Auto-Connect and then press Connect again.

I'd recommend buying an APC brand UPS in the 500-600 VA hour range at a garage sale for your 3D printer. It's possible that your refrigerator's compressor, your air conditioner, the clothes dryer or something was pulling down the wall outlet's power below the expected amount.

Done, thanks. I'm mid-print, so I'm going to do the second step later.

That could be. The printer is in an outbuilding with power, AC, and a small fridge. It's been fairly cool out lately, though, so I don't think the appliances have been running. I have a UPS for stuff inside, but a smaller unit for the outbuilding wouldn't be a bad idea.

Thanks for sticking with this thread...!

1 Like

For the record, that is not necessary, ttyUSB* is part of the standard port patterns, as is ttyACM*, see also

1 Like

Here's an alternative method to cut power to the USB ports that I found (untested as my only cable has the power conductor snipped).

Well, yeah... but...

I'm the author of OctoPrint-USBControl—which actually uses uhubctl—and it's not that simple. The Raspberry Pi Foundation decided to use cheaper bus controllers which are ganged rather than to allow individual control like suggested. Read the repository's documentation for a better feel of that.

And when you're done there, read this one.

I believe you... I'm solidly in the "ain't broke, don't fix" camp, so I'm not really looking for more solutions. My USB powering issue is gone, for now, but I stumbled on that and thought it was worth a look/relevant to the thread. Thanks for the info!

1 Like

Hey i have beat myself up several times with this issue...wound up just rebuilding octiprint (it was the fastest solution a lot of the time)
The long and the short of it was there was no ttyUSB0 being created when i pluged in the device...
then today i tripped onto an article about how the vendor id sometimes is not recognized. i sshed into that box and ran this command.
modprobe ftdi_sio

plugged the printer in (ender3 pro) and whammo! ttyUSB0 was there and octiprint connected to it.
I dont know what would cause this but i do know that updates some sort of vendor list.
Hope that helps somebody.