[[知恵袋]] *** Switch をつないでみる [#b42fea1c] root@pc0443:/home/sekigawa# tail -f /var/log/syslog Aug 4 08:47:03 pc0443 NetworkManager[869]: <info> [1754264822.9820] dhcp4 (enx8857ee65eb42): nameserver '192.168.3.1' Aug 4 08:47:03 pc0443 NetworkManager[869]: <info> [1754264822.9821] dhcp4 (enx8857ee65eb42): state changed bound -> bound Aug 4 08:47:03 pc0443 systemd[1]: Starting Network Manager Script Dispatcher Service... Aug 4 08:47:03 pc0443 systemd[1]: Started Network Manager Script Dispatcher Service. Aug 4 08:47:03 pc0443 dhclient[1162]: bound to 192.168.3.108 -- renewal in 36087 seconds. Aug 4 09:04:22 pc0443 systemd[1]: Started Run anacron jobs. Aug 4 09:04:22 pc0443 anacron[12818]: Anacron 2.3 started on 2025-08-04 Aug 4 09:04:22 pc0443 anacron[12818]: Normal exit (0 jobs run) Aug 4 09:17:02 pc0443 CRON[12833]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly) Aug 4 09:46:55 pc0443 systemd[1]: Started Session 87 of user sekigawa. Aug 4 09:48:23 pc0443 kernel: [254282.904905] usb 3-8: new full-speed USB device number 7 using xhci_hcd Aug 4 09:48:23 pc0443 kernel: [254283.054214] usb 3-8: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.64 Aug 4 09:48:23 pc0443 kernel: [254283.054220] usb 3-8: New USB device strings: Mfr=0, Product=2, SerialNumber=0 Aug 4 09:48:23 pc0443 kernel: [254283.054224] usb 3-8: Product: USB Serial Aug 4 09:48:23 pc0443 mtp-probe: checking bus 3, device 7: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-8" Aug 4 09:48:23 pc0443 mtp-probe: bus: 3, device: 7 was not an MTP device Aug 4 09:48:24 pc0443 kernel: [254283.150915] usbcore: registered new interface driver usbserial_generic Aug 4 09:48:24 pc0443 kernel: [254283.150922] usbserial: USB Serial support registered for generic Aug 4 09:48:24 pc0443 kernel: [254283.162031] usbcore: registered new interface driver ch341 Aug 4 09:48:24 pc0443 kernel: [254283.162055] usbserial: USB Serial support registered for ch341-uart Aug 4 09:48:24 pc0443 kernel: [254283.162076] ch341 3-8:1.0: ch341-uart converter detected Aug 4 09:48:24 pc0443 kernel: [254283.162451] usb 3-8: ch341-uart converter now attached to ttyUSB0 Aug 4 09:48:24 pc0443 upowerd[2772]: unhandled action 'bind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-8 Aug 4 09:48:24 pc0443 snapd[899]: hotplug.go:200: hotplug device add event ignored, enable experimental.hotplug Aug 4 09:48:24 pc0443 upowerd[2772]: unhandled action 'bind' on /sys/devices/pci0000:00/0000:00:14.0/usb3/3-8/3-8:1.0 Aug 4 09:48:26 pc0443 ModemManager[876]: <info> Couldn't check support for device '/sys/devices/pci0000:00/0000:00:14.0/usb3/3-8': not supported by any plugin root@pc0443:/home/sekigawa# ls /dev/ttyUSB* /dev/ttyUSB0 *** 制御文 [#d9b9e0c0] # 扇風機ON echo -ne "1" > /dev/ttyUSB0 # 扇風機OFF echo -ne "0" > /dev/ttyUSB0 これだと安定しない^ これだと安定しない~ baud rate の設定や改行コードを入れるように変更 fan_on.sh #!/bin/bash stty -F /dev/ttyUSB0 9600 cs8 -cstopb -parenb -icanon -echo printf "1\r" > /dev/ttyUSB0 fan_off.sh #!/bin/bash stty -F /dev/ttyUSB0 9600 cs8 -cstopb -parenb -icanon -echo printf "0\r" > /dev/ttyUSB0