0

I have bought this serial adapter

enter image description here

On linux debian is recognized

lspci -k

02:00.0 Serial controller: Device 1c00:3253 (rev 10)
    Subsystem: Device 1c00:3253
    Kernel driver in use: serial 

setserial report ok

setserial -g /dev/ttyS0
/dev/ttyS0, UART: 16850, Port: 0xe8c0, IRQ: 16
setserial -g /dev/ttyS1
/dev/ttyS1, UART: 16850, Port: 0xe8c8, IRQ: 16

so I activated with systemd the serial login

cp /lib/systemd/system/serial-getty@.service /etc/systemd/system/serial-getty@ttyS0.service
ln -s /etc/systemd/system/serial-getty@ttyS0.service /etc/systemd/system/getty.target.wants/
systemctl daemon-reload
systemctl start serial-getty@ttyS0.service

cp /lib/systemd/system/serial-getty@.service /etc/systemd/system/serial-getty@ttyS1.service
ln -s /etc/systemd/system/serial-getty@ttyS1.service /etc/systemd/system/getty.target.wants/
systemctl daemon-reload
systemctl start serial-getty@ttyS1.service

I have enabled both ports to try but... none works. Minicom -D from external pc or internal pc don't work, report only a black frozen screen without serial activity I have set the usual 9600 8N1 without software/hw control and with software/hw control but nothing work. Even send the classical echo commands doesn't work

echo "proof" > /dev/ttyS0
cat -V < /dev/ttyS0 

Why doesn't work?

EDIT: searching on internet I see this board need an external(sic!) driver, and of course because they don't update the code for the latest kernel compile it is a little difficult

EDIT-2: I found an outdated driver

https://github.com/wd5gnr/WCH4SDriver.git

Of course don't compile..

root/WCH4SDriver/wch_serial.c: In function ‘ser_wait_modem_status’:
/root/WCH4SDriver/wch_serial.c:1340:9: error: implicit declaration of function ‘signal_pending’; did you mean ‘timer_pending’? [-Werror=implicit-function-declaration]
     if (signal_pending(current))
         ^~~~~~~~~~~~~~
         timer_pending
/root/WCH4SDriver/wch_serial.c: In function ‘ser_open’:
/root/WCH4SDriver/wch_serial.c:2109:8: error: ‘struct tty_struct’ has no member named ‘alt_speed’
     tty->alt_speed = 0;
        ^~
/root/WCH4SDriver/wch_serial.c: In function ‘wch_ser_register_ports’:
/root/WCH4SDriver/wch_serial.c:3116:7: error: implicit declaration of function ‘init_timer’; did you mean ‘init_timers’? [-Werror=implicit-function-declaration]
       init_timer(&sp->timer);
       ^~~~~~~~~~
       init_timers
/root/WCH4SDriver/wch_serial.c:3118:26: error: assignment to ‘void (*)(struct timer_list *)’ from incompatible pointer type ‘void (*)(long unsigned int)’ [-Werror=incompatible-pointer-types]
       sp->timer.function = wch_ser_timeout;

EDIT-3: With this guide finally I get the driver working, two new dev are created by the driver wch.ko /dev/ttyWCH0 and /dev/ttyWCH1 but with minicom I still cannot get the login...

elbarna
  • 12,695
  • For anyone who finds this question in the future: That's not how one activates a template service unit instance in systemd. See https://unix.stackexchange.com/a/248313/5132 , https://unix.stackexchange.com/a/475043/5132 , and https://unix.stackexchange.com/a/431948/5132 for starters. – JdeBP Dec 18 '19 at 12:49
  • I find it highly unprobable that you need any extra driver for that adaptor -- I've used similarly looking ones without problems. Your problem is either with systemd/minicom/etc, or trying to use a straight cable instead of a cross-over ("null-modem") one when connecting the two PCs via their serial ports. –  Dec 18 '19 at 14:34

1 Answers1

0

Solution found: inverted cable mounted! Someone has inverted one of the serial port cable. Now after replace cable in correct order all works fine No external drivers needed

elbarna
  • 12,695