On 25.01.2024 17:11:45, Uwe Bonnes wrote: > can anybody help to set up an SLCAN adapter via systemd? If you have the option of using a proper CAN adapter, e.g. a candlelight compatible one, you should do so. You won't have much fun with slcan based devices. > By hand and for the given adapter I can do > slcand -o -s8 -t hw -S 3000000 \ > /dev/serial/by-id/usb-Black_Sphere_Technologies_Black_Magic_Probe_STLINK-V3_v1.7.1-353-gbb84e8ec_004100483038510D34333935-if06 > > and > > ip link set up slcan > > and it works as expected. However automativ setup at plug would be fine. You can create a systemd "service" that uses "BindsTo" to bind to your USB Serial Adapter. Have a look at the output of "systemctl" to get the corresponding "device". This service would be automatically started, if you plug the device. It looks something like this (untested, not sure about the quoting): "BindsTo=sys-devices-pci0000:00-0000:00:14.0-usb2-2\x2d1-2\x2d1.3-2\x2d1.3.2-2\x2d1.3.2:1.0-ttyUSB0-tty-ttyUSB0.device" Use "slcand" as "ExecStart" in that service. Marc -- Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung Nürnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Attachment:
signature.asc
Description: PGP signature