Ubuntu, Odroid, and a Serial Connection Problem

Hi everyone. Kinda stumped here. My linux skills are minimal, but I've managed up till now.

Installed Ubuntu on an Odroid-C4, ran the octoprint deploy script, but I can never get the printer connected. The terminal shows it connecting to ttys1 but a handshake never happens.

Blockquote
Connected to: Serial<id=0x7f581177c0, open=True>(port='/dev/ttyS1', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=10.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
Send: N0 M110 N0*125
No answer from the printer within the connection timeout, trying another hello

What did you already try to solve it?

Swapped the usb cable with one that's been working on a Pi Zero, made sure the user I created has sudo, tty, and signal group access. Rebooted in safe mode. Set connection options manually.

Systeminfo Bundle

octoprint-systeminfo-20230716202300.zip (42.3 KB)

Additional information about your setup

Odroid-C4, Ubuntu 20.04, Octoprint v. 1.9.1, Elegoo Neptune 4

Since you're using a USB connection the portname should have USB in it (for example ttyusb0)

Normal tty ports are for the gpio serial pins.

If the port doesn't show up also add the OctoPrint user to the dialout group.

Also a common ubuntu issue:
Run this in the terminal and reboot the machine afterwards sudo apt -y remove brltty.
It removes the brltty package which claims the usb connection when it's running (and installed).

If you still don't see any USB serial port in port list, disconnect your printer, connect it again, run sudo dmesg | tail -n 20 and post the output here.

I had it connected to the micro usb port, like my Pi Zero. Whoops.

Used the normal USB ports, now seeing ttyUSB0, but still not connecting. System told me brltty wasn't installed.

Unplugged USB, replugged, ran:
sudo dmesg | tail -n 20

Output:

[ 87.965415] fuse init (API version 7.26)
[ 91.852693] asoc-aml-card odroid_hdmi: S/PDIF Playback disable
[ 91.852775] spdif_a keep clk continuous
[ 91.852781] aml_spdif_close
[ 91.852837] audio_ddr_mngr: frddrs[0] released by device ff660000.audiobus:spdif@0
[ 123.670652] meson_uart ffd24000.serial: ttyS1 use xtal(24M) 24000000 change 0 to 9600
[ 123.678430] meson_uart ffd24000.serial: ttyS1 use xtal(24M) 24000000 change 9600 to 115200
[ 123.739331] meson_uart ffd24000.serial: ttyS1 use xtal(24M) 24000000 change 115200 to 115200
[ 123.744573] meson_uart ffd24000.serial: ttyS1 use xtal(24M) 24000000 change 115200 to 115200
[ 129.930719] meson_uart ffd24000.serial: ttyS1 use xtal(24M) 24000000 change 115200 to 115200
[ 129.930800] meson_uart ffd24000.serial: ttyS1 use xtal(24M) 24000000 change 115200 to 250000
[ 593.843103] usb 1-1.3: USB disconnect, device number 4
[ 593.844441] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 593.844722] ch341 1-1.3:1.0: device disconnected
[ 598.210320] usb 1-1.3: new full-speed USB device number 5 using xhci-hcd
[ 598.360043] usb 1-1.3: New USB device found, idVendor=1a86, idProduct=7523
[ 598.360049] usb 1-1.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[ 598.360051] usb 1-1.3: Product: USB Serial
[ 598.386500] ch341 1-1.3:1.0: ch341-uart converter detected
[ 598.387632] usb 1-1.3: ch341-uart converter now attached to ttyUSB0
root@odroid:/home/octo#

Noticed this in the terminal:

Connecting to port /dev/ttyUSB0, baudrate 115200
Handshake attempt #1 with timeout 2.0s
Connected to: Serial<id=0x7f59e14730, open=True>(port='/dev/ttyUSB0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=2.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
Send: N0 M110 N0125
Recv:
Handshake attempt #2 with timeout 2.0s
Send: N0 M110 N0
125
Recv: mkspi login: N0 M110 N0125
Recv: Password:
Recv: N0 M110 N0
125

I then blacklisted the other ports and tried connecting again, with manual settings and saw this:

Trying port /dev/ttyUSB0, baudrate 57600
Handshake attempt #1 with timeout 2.0s
Send: N0 M110 N0125
Handshake attempt #2 with timeout 2.0s
Send: N0 M110 N0
125
Handshake attempt #3 with timeout 2.0s
Send: N0 M110 N0*125
Recv:
\x8a 11 *12Ðass÷ïòdº §Q}Qk'¸W\x8e\x8a\x0c\x9d\x98X×÷×z\x1d\x98«ÏÌ8>e¨D\x8fήî\x9fæÍ\x8fÍå\x8fÙ³¾\x8d]æÍÍ8®}æÍ\x8fÍç\x1eØ<Í\x8díÅßą̊vè\x0ce<w\x9fÖóæÍ\x9e?\x7fG\x85͸|ßÎEßDÍßæÍ\x0e\x8fÍ\x85Í\x98ç]x\x0cÅ~óõë\x85DÅæÍÏë\x85g\x88\x9dþ\x98Dí­¨\x0ce?uõêïÏô}Í\x88DÅÌw£?u\x85\x0cý~Ý>ßü]ë>xøW\x8b몿ù¨ß¾\x1a\x0c
èTó«×Êe\x98ÇĮ̈\x8ee8D\x8fÎvî\x9f®Í\x8fÍ\x85\x8fÙÓ¾\x8d]æÍÍ8®}æÍ\x8f5å\x1eÈ\x8cÍ}eų\x85̨\x9e8\x04Å\x8cϯÖ\x9f®mÖÏ\x8fçåͨì³\x8eÍã\x0c=Ç®}\x8e?u\x85Í\x88ç­~\x0ce~Ïõë\x85DÅæÍ<ë\x85\x1fø\x9dÖ¨Dí\x87\x8d;\x8fÍÅÆ«?\x88ÍÕø\x0cÅ\w×=uå\x0cýÎÝ>Çü]ë>xøW\x8bëEªo¨W\x8e\x1a|\x9dèÈ׫óze¨«\x1f<8\x8eŨ
Trying port /dev/ttyUSB0, baudrate 38400
Handshake attempt #1 with timeout 2.0s

Changed USB cables, removed wifi adapter, tried auto connecting again. Saw:

Trying port /dev/ttyUSB0, baudrate 38400
Handshake attempt #1 with timeout 2.0s
Send: N0 M110 N0125
Recv: \x1cüàüàü\x00\x1c\x1c\x1cüàüàü\x00\x1cà\x00\x1cüàüàü\x00\x1c\x1c\x00\x00\x00à\x00\x00\x00\x00à\x00\x00\x00\x00à\x00\x00\x00à\x00\x00\x00\x00à\x00\x00\x00à\x00\x00\x00\x00à\x00\x00;;\x03\x8foç8#o\x8fç\x1c\x1cÄ\x1cã\x9cÇ<\x1c\x9cãßÄo\x9f<ïç\x1c Ûï\x0fß\x1b\x8f\x0f\x1cßØoï{\x1c\x00\x9cà\x03;;ïç<Àoç\x1cççÜ#\x8fç\x1f\x00ü\x03\x07üÀ\xffû­/ÝUÕï¸W\x8e\x8a\x0c\x9d\x98X×÷×éë¡«Ï<8.ŨD\x7f~®F³fÍ?ue³÷³9õÍ÷3ͨ\x0cfÍ®}?Í\x85f\x88<5\x8díõßeL¨vè\x0ceu<u¯V³f}\x9eO\x8fse=¸ìÙó¾Ñ¾\x87\x0b=Es}ÞýueÍ\x88ç­è\x0ceù«V\x7f¾\x98DÅQÍÏ«\x85\x1aø\x9dV¨Dí\x85\x8dU=Í;F«=ÑÍÝøDÅ1uÓýu\x85\x0cý~Ý\x0eÝñ­«ù!\x9aNþÎ<®¨ê\x8a\x89Qí(E«}\x17\x8aÂÂEFí³\x8aþ
WARNThe received line contains at least one null byte character at position 6, this hints at some data corruption going on
Recv: Armbian 22.05.0-trunk Buster ttyS2
Recv:
Handshake attempt #2 with timeout 2.0s
Send: N0 M110 N0
125
Recv: mkspi login:
Recv: mkspi login: N0 M110 N0125
Handshake attempt #3 with timeout 2.0s
Recv: Password:
Send: N0 M110 N0
125
Recv: N0 M110 N0125
Trying port /dev/ttyUSB0, baudrate 19200
Handshake attempt #1 with timeout 2.0s
Send: N0 M110 N0
125
Handshake attempt #2 with timeout 2.0s
Send: N0 M110 N0125
Handshake attempt #3 with timeout 2.0s
Send: N0 M110 N0
125
Trying port /dev/ttyUSB0, baudrate 9600
Handshake attempt #1 with timeout 2.0s
Send: N0 M110 N0125
Handshake attempt #2 with timeout 2.0s
Send: N0 M110 N0
125
Handshake attempt #3 with timeout 2.0s
Send: N0 M110 N0*125
Changing monitoring state from "Detecting serial connection" to "Error"
Changing monitoring state from "Error" to "Offline after error"
Connection closed, closing down monitor
Changing monitoring state from "Offline" to "Detecting serial connection"

Changed cables:

Performing autodetection with 7 port/baudrate candidates: /dev/ttyUSB0@115200, /dev/ttyUSB0@250000, /dev/ttyUSB0@230400, /dev/ttyUSB0@57600, /dev/ttyUSB0@38400, /dev/ttyUSB0@19200, /dev/ttyUSB0@9600
Trying port /dev/ttyUSB0, baudrate 115200
Connecting to port /dev/ttyUSB0, baudrate 115200
Handshake attempt #1 with timeout 2.0s
Connected to: Serial<id=0x7f5808d940, open=True>(port='/dev/ttyUSB0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=2.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitor
Send: N0 M110 N0125
Handshake attempt #2 with timeout 2.0s
Send: N0 M110 N0
125
Handshake attempt #3 with timeout 2.0s
Send: N0 M110 N0125
Trying port /dev/ttyUSB0, baudrate 250000
Handshake attempt #1 with timeout 2.0s
Send: N0 M110 N0
125
Handshake attempt #2 with timeout 2.0s
Send: N0 M110 N0125
Handshake attempt #3 with timeout 2.0s
Send: N0 M110 N0
125
Trying port /dev/ttyUSB0, baudrate 230400
Handshake attempt #1 with timeout 2.0s
Send: N0 M110 N0125
Handshake attempt #2 with timeout 2.0s
Send: N0 M110 N0
125
Handshake attempt #3 with timeout 2.0s
Send: N0 M110 N0125
Trying port /dev/ttyUSB0, baudrate 57600
Handshake attempt #1 with timeout 2.0s
Send: N0 M110 N0
125
Handshake attempt #2 with timeout 2.0s
Send: N0 M110 N0125
Handshake attempt #3 with timeout 2.0s
Send: N0 M110 N0
125
Trying port /dev/ttyUSB0, baudrate 38400
Handshake attempt #1 with timeout 2.0s
Send: N0 M110 N0*125
Recv: \x1cüàüàü\x00\x1c\x1c\x1cüàüàü\x00\x1c\x1c\x1cüàüàü\x00\x1c\x1c\x00\x00\x00à\x00\x00\x00à\x00\x00\x00\x00à\x00\x00\x00\x00à\x00\x00\x00\x00à\x00\x00\x00à\x00\x00\x00\x00à\x00\x00;;\x03\x8foç8#o\x8fç\x1c\x1cÄ\x1cã\x9cÇ<\x1c\x9cãßÄoß<ïç\x1c Ûï\x0fß\x1b\x8f\x0f\x1cßØoï{\x1c\x00\x9cà\x03;;ïç<Àoç\x1cççÜ#\x8fç\x1f\x00ü\x03\x07üð\xff÷\xff\xffUUê+ÙÕ´ß¾\x8a\x0c
\x90X³÷×Ùëa«Ï58>ŨD\x8f~®F³fÍ?uE³÷³ÎõÍ÷º®\x1dÍèfÍ®}\x8fÍ\x85fØ<5\x8díEßęv0\x0ceñ}¯V³®}\x9eÏ\x8f3e=¨ì÷³¾\xff¾³\x0c=ÝsÍ\x0eýÍ\x85Í\x98ç]xDÅ9³õçe>¨ìs}?çeg\x88­V\x98\x0cí­¨DeýuUîïýá}\x8d\x88\x08eqÍ£ÑÍeDõÎ\x8d>EÑ]çùáÂÎþÎ5®\x98ê\x8a\x89Qí(E«}\x17\x8aB\x9aåFíÏ\x8aþ
WARNThe received line contains at least one null byte character at position 6, this hints at some data corruption going on

Changed USB ports, same error, same baud rate.

Ok the connection itself is working, but I'm not quite sure what I'm looking at here.
So here's my theory:

Your printer is running Klipper and already has something like your Odroid-C4 built in.
The Odroid-C4 like device in your printer is a MKS-PI.

When you tried to open a serial connection to the printer board, you opened a serial connection to the MKS-PI instead.
This serial connection is similar to a SSH connection - it asks for a username and password:

The username should be either root or mks and password makerbase. At least those are the default credentials - maybe Elegoo changed them.

OctoPrint isn't designed to communicate with other singleboard computers so that won't work.

What can you do know?
You could go to the manufacturers website and look for a guide on how to use the printer.
I guess you have to plug an ethernet cable into the MKS PI to configure it. You probably can use wifi later if you want to.
It should also be possible to install OctoPrint on the MKS PI later, but I can't really help you with that, because I neither know the device or Klipper.

Did you read my post ^^ ?

According to Elegoo's support people, it's supposed to work. They even have a button to set up the Neptune 4 in Octoprint in their version of Cura.

Supposedly, this is a linux driver issue (CH340) which I really don't feel like trying to fix at this point. Fluidd is good enough.

Thanks for the input!

That was not the case in your scenario. The issue was that you connected the Odroid to the MKS-PI and not to the printers mainboard.

It only has one board

I'm not able to find any pictures of the mainboard, so I can't tell you for sure what's going on.
If you looked inside and there is really just one board, that means they used a sbc with integrated printer mainboard.

If that's the case we need to know hat they did on the software side and if there is any way to passthrough the serial connection.
Because of the micro-controller intragation the serial connection is probably just internal and can only be accessed by the sbc part of the mainboard.

I'm "talking" with Elegoo about this and I'll update if I get any more info. I was going to just let it go, but it seems I can't. lol

You don't have to but I think it would be nice to get it working :slight_smile:

All I can tell you for certain is that we didn't have a CH340 driver issue. The port was detected and we were able to establish a connection.

For the hell of it, I installed OctoPi through the Pi Imager on an old Pi2 just to see if that would connect. Nope. Waiting to hear back from Elegoo.

This has to be a hardware/firmware issue. I had a wifi dongle, thought I'd give that a shot. Well, it worked and I was able to connect to my wifi just fine as well as see others. Sweet, 1st try! Turned it back on later and no wifi networks are seen in NetworkManager.

Got new firmware. Wifi dongle is back to working, still no connection to the printer.

Update: Nope. Back to square one. It's like scanning for the printer screws up the USB port.