Cannot connect over TTYS5

Basic Information:

Printer Model: Biqu B1 SE Plus
MCU / Printerboard: Big Tree Tech (BTT) SKR2
klippy.log
klippy (7).log (707.2 KB)

Describe your issue:

Attempting to connect an Orange Pi Zero 2 to SKR2 board via serial connection.

Firstly, I enabled UART5 via DT overlays in /boot/orangepiEnv.txt and created a loopback for tx/rx on the OPi. I get correct echo response using serialTest utility in the wiringOP package.

Next flashed printer to use PA9 PA10 selected in make menuconfig

changed printer.cfg to point to /dev/ttyS5

[mcu]
serial: /dev/ttyS5

Next I connected to the PA9 to RX on the OPi header and PA10 to TX on the Opi and GND to GND. I tried flipping PA9 and PA10 in case the manual was wrong. Both ways I was unable to connect.
both gave me the same error

mcu 'mcu': Unable to open serial port: Could not configure port: (5, 'Input/output error')
webhooks client 281473459220880: New connection
webhooks client 281473459220880: Client info {'program': 'Moonraker', 'version': 'v0.8.0-29-g80920dd'}
mcu 'mcu': Unable to open serial port: Could not configure port: (5, 'Input/output error')

I reran make menuconfig and decided to try different UART pins PD8 and PD9
flashed to SKR2

received a new error

mcu 'mcu': Wait for identify_response
Traceback (most recent call last):
  File "/home/orangepi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/orangepi/klipper/klippy/serialhdl.py", line 261, in send_with_response
    return src.get_response([cmd], self.default_cmd_queue)
  File "/home/orangepi/klipper/klippy/serialhdl.py", line 318, in get_response
    self.serial.raw_send_wait_ack(cmds[-1], minclock, reqclock,
  File "/home/orangepi/klipper/klippy/serialhdl.py", line 253, in raw_send_wait_ack
    self._error("Serial connection closed")
  File "/home/orangepi/klipper/klippy/serialhdl.py", line 61, in _error
    raise error(self.warn_prefix + (msg % params))
serialhdl.error: mcu 'mcu': Serial connection closed

Next I attempted to use tio to see if when i powered on printer, I would get any data, which I do

tio /dev/ttyS5
[tio 14:55:26] tio v1.32
[tio 14:55:26] Press ctrl-t q to quit
[tio 14:55:26] Connected
[tio 14:55:29] Statistics:
[tio 14:55:29]  Sent 0 bytes, received 0 bytes
�j
[tio 14:55:32] Statistics:
[tio 14:55:32]  Sent 0 bytes, received 6 bytes
�	M�	M�@	M�	M�	M�����	M������]����]��M����]	M�@��]	M��]	M���	M���M�	M����	M����]�]���M�@��M�	M��]��M���]�	M����M�	M�����]�]��	M��]	M�	M�P����]��]�]��������	M�	M��]
[tio 15:03:47] Disconnected

Not sure where to go from here.

https://www.klipper3d.org/Installation.html
https://www.klipper3d.org/FAQ.html

Did you check which serial port your Pi zero uses? https://www.cyberciti.biz/faq/find-out-linux-serial-ports-with-setserial/

From line 12072 in your klippy.log is written: mcu ‘mcu’: Unable to open serial port: [Errno 13] could not open port /dev/ttyS0: [Errno 13] Permission denied: ‘/dev/ttyS0’

That is not ttyS5!

What did you define in your printer.cfg?

PA9 and PA10 should be ok.

Good idea.

This thread may help BIGTREETECH-GTR V1.0 menu config - #11 by phongshader

Good luck, hcet14

  1. Connect your SKR 2 and Pi with a generic USB cable (the square socket directly left of your microSD card slot on the SKR 2).
  2. Configure your Klipper firmware to use serial over USB via PA11/PA12
  3. If your MCU says STM32F429 on it, use the 32KiB bootloader
  4. Flash your board by compiling the firmware, moving the firmware.bin to your SD card, and putting that SD card in your mainboard. The make flash command unfortunately doesn’t work here.
  5. Get a terminal up on your Pi. With both the Pi/SKR turned on/connected, disconnect and reconnect the USB from the SKR. Type dmesg | tail to see what serial port that your Pi attached the USB device to. It’ll be like /dev/ttyUSB0 or something. Use that in your printer.cfg’s serial= line. Alternatively, a device mounted at /dev/serial/by-id/<some-usb-iface-here> will work too.
  6. Restart Klipper.

Side note: your /dev/ttyS0 isn’t accessible by Klipper. You might want to sort out the permission issue on that port.

Cheers!

Oh i got it sorted. I knew it was ttyS5, but but I ended up trying S0 and S1 as well.

It did eventually get sorted, sorry I didn’t return with the note.

While on /dev/ttyS5 i was getting the error message about lines and so on.

I rebooted a bunch of times then decided i would just put the machine back where it was.

Shut down the pi uncleanly (just yanked the plug out) put it back where it goes and plugged it in, had lunch, left it a long time and it worked.

I don’t have any solution, it just started working after an unclean shutdown, moving it, and having lunch.