Can't connect to printer

This had been working fine for months. Then I started to have problems. so I just updated to Octoprint 1.3.9

What is the problem? ------------------------------------
The pi is alive and apparently well. I can see video on port 8080. I am also able to upload files. When I try to connect to the printer, I get error msgs:

Connecting to: /dev/ttyAMA0Changing monitoring state from "Offline" to "Opening serial port"Connected to: Serial<id=0xb01c4830, open=True>(port='/dev/ttyAMA0', baudrate=115200, bytesize=8, parity='N', stopbits=1, timeout=10.0, xonxoff=False, rtscts=False, dsrdtr=False), starting monitorChanging monitoring state from "Opening serial port" to "Connecting"Send: N0 M110 N0*125Unexpected error while reading serial port, please consult octoprint.log for details: IOError: '[Errno 25] Inappropriate ioctl for device' @ comm.py:_readline:2581Changing monitoring state from "Connecting" to "Offline (Error: IOError: '[Errno 25] Inappropriate ioctl for device' @ comm.py:_readline:2581)"Connection closed, closing down monitor

What did you already try to solve it? ------------------------------------
Tried AUTO for both port and Baud but no joy.
Set baud=115200 which is what I had been using sucessfully; no joy.
Set port to /dev/ttyAMA0 - no joy.
Pulled SD card from pi and reprog it, no joy.

Additional information about your setup (OctoPrint version, OctoPi version, printer, firmware, octoprint.log, serial.log or output on terminal tab, ...) ------------------------------------

Printer is a CR10

from octoprint.log:
2018-09-14 15:39:02,545 - octoprint.util.comm - INFO - Changing monitoring state from "Detecting baudrate" to "Offline"
2018-09-14 15:39:09,512 - octoprint.util.comm - INFO - Changing monitoring state from "Offline" to "Opening serial port"
2018-09-14 15:39:09,568 - octoprint.util.comm - INFO - Changing monitoring state from "Opening serial port" to "Connecting"
2018-09-14 15:39:09,608 - octoprint.util.comm - INFO - M110 detected, setting current line number to 0
2018-09-14 15:39:09,614 - octoprint.util.comm - ERROR - Unexpected error while reading from serial port
Traceback (most recent call last):
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/comm.py", line 2581, in _readline
ret = self._serial.readline()
File "/home/pi/oprint/local/lib/python2.7/site-packages/octoprint/util/comm.py", line 4599, in readline
data += bytearray(self.read(self.in_waiting))
File "/home/pi/oprint/local/lib/python2.7/site-packages/serial/serialposix.py", line 467, in in_waiting
s = fcntl.ioctl(self.fd, TIOCINQ, TIOCM_zero_str)
IOError: [Errno 25] Inappropriate ioctl for device
2018-09-14 15:39:09,668 - octoprint.util.comm - INFO - Changing monitoring state from "Connecting" to "Offline (Error: IOError: '[Errno 25] Inappropriate ioctl for device' @ comm.py:_readline:2581)"
2018-09-14 15:41:18,896 - tornado.access - WARNING - 404 GET /currentsetting.htm (::ffff:192.168.1.139) 51.49ms
2018-09-14 15:46:30,021 - tornado.access - WARNING - 404 GET /currentsetting.htm (::ffff:192.168.1.139) 47.62ms

What's the baudrate of the CR10? If it's 250000, then pyserial can't do that by default. If you imaged with the OctoPi download, then you should have the correct pyserial that would connect at this rate. If you didn't image with OctoPi, then read the link.

I've tried both AUTO and manually set the baud to 115200 (which is what CR10 forum says to use).

Things to try:

  • Verify that the DC power adapter is 5V @ 2.5A
  • Verify that the serial cable is connected firmly, that it has either ferrite cores or internal metallic shielding

You indicated that you "started to have problems" but you didn't indicate whether they were similar to those you're having now. Have you added anything (Bluetooth devices, USB devices)?

It acts as if it's having a difficult time talking to the printer over the serial connection. If your webcam is a USB device, try disconnecting it. (There are two UARTs in the Raspi: a good one and a cheap one.)

Try all this in OctoPrint's Safe Mode. Does it work now? If so, it sounds like one of your plugins is getting in the way.

Did you change your CR-10 firmware? Is it set to 115200 baud rate also?

The system previously worked with baud=115200. No hardware has changed on the printer, cable, pi, etc (unless there is a yet to be discovered failure). Pi ps is 5v5a and measures 5v.

I watch the terminal window. When Baud=Auto, it still only tries 115200. Should I see it trying all baud rates?

Is there a preferred power up sequence?

I do know that for a FlashForge Creator Pro here at work I need to specifically indicate the connection details in the config.yaml -> Serial section.

SOLVED
THe problem was that the port needs to be /dev/ttyUSB0 which DOESN"T appear when I look with: ls /dev/tty*

Thanks folks for responding.

Hello @iabarry!

Could you please have a look here? Thanks a lot!