Re: Ovládání vřetena přes RS485
Napsal: 18. 1. 2021, 5:14
Opět díky za tipy, vyzkouším..
Největší české fórum o strojírenství, CNC strojích a 3D tiskárnách
https://forum.strojirenstvi.cz/
Kód: Vybrat vše
tomas@debian-cnc-home:~$ sudo stty -F /dev/ttyUSB0 -a
[sudo] password for tomas:
speed 2400 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 0; time = 0;
-parenb -parodd cs8 -hupcl cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
tomas@debian-cnc-home:~$
Kód: Vybrat vše
tomas@debian-cnc-home:~$ ls -l /dev/ttyUSB0
crw-rw---T 1 root dialout 188, 0 Jan 18 22:14 /dev/ttyUSB0
Kód: Vybrat vše
tomas@debian-cnc-home:~$ sudo udevadm info -a -n /dev/ttyUSB0
[sudo] password for tomas:
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7/2-1.7:1.0/ttyUSB0/tty/ttyUSB0':
KERNEL=="ttyUSB0"
SUBSYSTEM=="tty"
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7/2-1.7:1.0/ttyUSB0':
KERNELS=="ttyUSB0"
SUBSYSTEMS=="usb-serial"
DRIVERS=="ch341-uart"
ATTRS{port_number}=="0"
looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7/2-1.7:1.0':
KERNELS=="2-1.7:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="ch341"
ATTRS{bInterfaceClass}=="ff"
ATTRS{bInterfaceSubClass}=="01"
ATTRS{bInterfaceProtocol}=="02"
ATTRS{bNumEndpoints}=="03"
ATTRS{supports_autosuspend}=="1"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bInterfaceNumber}=="00"
looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.7':
KERNELS=="2-1.7"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{devpath}=="1.7"
ATTRS{idVendor}=="1a86"
ATTRS{speed}=="12"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="8"
ATTRS{busnum}=="2"
ATTRS{devnum}=="3"
ATTRS{configuration}==""
ATTRS{bMaxPower}==" 96mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="80"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="0"
ATTRS{bcdDevice}=="0254"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{version}==" 1.10"
ATTRS{urbnum}=="40"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="7523"
ATTRS{bDeviceClass}=="ff"
ATTRS{product}=="USB2.0-Serial"
looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2/2-1':
KERNELS=="2-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="01"
ATTRS{devpath}=="1"
ATTRS{idVendor}=="8087"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{busnum}=="2"
ATTRS{devnum}=="2"
ATTRS{configuration}==""
ATTRS{bMaxPower}==" 0mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="8"
ATTRS{bcdDevice}=="0000"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="35"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0020"
ATTRS{bDeviceClass}=="09"
looking at parent device '/devices/pci0000:00/0000:00:1d.0/usb2':
KERNELS=="usb2"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceProtocol}=="00"
ATTRS{devpath}=="0"
ATTRS{idVendor}=="1d6b"
ATTRS{speed}=="480"
ATTRS{bNumInterfaces}==" 1"
ATTRS{bConfigurationValue}=="1"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{authorized_default}=="1"
ATTRS{busnum}=="2"
ATTRS{devnum}=="1"
ATTRS{configuration}==""
ATTRS{bMaxPower}==" 0mA"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bNumConfigurations}=="1"
ATTRS{maxchild}=="3"
ATTRS{bcdDevice}=="0304"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{quirks}=="0x0"
ATTRS{serial}=="0000:00:1d.0"
ATTRS{version}==" 2.00"
ATTRS{urbnum}=="26"
ATTRS{manufacturer}=="Linux 3.4-9-rtai-686-pae ehci_hcd"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0002"
ATTRS{bDeviceClass}=="09"
ATTRS{product}=="EHCI Host Controller"
looking at parent device '/devices/pci0000:00/0000:00:1d.0':
KERNELS=="0000:00:1d.0"
SUBSYSTEMS=="pci"
DRIVERS=="ehci_hcd"
ATTRS{irq}=="20"
ATTRS{subsystem_vendor}=="0x103c"
ATTRS{broken_parity_status}=="0"
ATTRS{class}=="0x0c0320"
ATTRS{companion}==""
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{dma_mask_bits}=="32"
ATTRS{local_cpus}=="ff"
ATTRS{device}=="0x3b34"
ATTRS{uframe_periodic_max}=="100"
ATTRS{enable}=="1"
ATTRS{msi_bus}==""
ATTRS{local_cpulist}=="0-7"
ATTRS{vendor}=="0x8086"
ATTRS{subsystem_device}=="0x304a"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
tomas@debian-cnc-home:~$
Kód: Vybrat vše
user@debian:~/Downloads$ sudo ./modpoll/linux_i386/modpoll -m rtu -a 1 -b 4800 -p none -s 2 -t 4:mod /dev/ttyUSB0
modpoll 3.9 - FieldTalk(tm) Modbus(R) Master Simulator
Copyright (c) 2002-2020 proconX Pty Ltd
Visit https://www.modbusdriver.com for Modbus libraries and tools.
Protocol configuration: Modbus RTU, FC3
Slave configuration...: address = 1, start reference = 1, count = 1
Communication.........: /dev/ttyUSB0, 4800, 8, 2, none, t/o 1.00 s, poll rate 1000 ms
Data type.............: 32-bit module 10000, output (holding) register table
-- Polling slave... (Ctrl-C to stop)
[1]: 500
-- Polling slave... (Ctrl-C to stop)
[1]: 500
-- Polling slave... (Ctrl-C to stop)
[1]: 500
-- Polling slave... (Ctrl-C to stop)
[1]: 500
-- Polling slave... (Ctrl-C to stop)
[1]: 500
-- Polling slave... (Ctrl-C to stop)
^C
user@debian:~/Downloads$
Kód: Vybrat vše
user@debian:~$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Jan 18 22:28 /dev/ttyUSB0
user@debian:~$ sudo udevadm info -a -n /dev/ttyUSB0
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0/tty/ttyUSB0':
KERNEL=="ttyUSB0"
SUBSYSTEM=="tty"
DRIVER==""
looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0/ttyUSB0':
KERNELS=="ttyUSB0"
SUBSYSTEMS=="usb-serial"
DRIVERS=="ch341-uart"
ATTRS{port_number}=="0"
looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4/1-1.4:1.0':
KERNELS=="1-1.4:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="ch341"
ATTRS{bInterfaceClass}=="ff"
ATTRS{supports_autosuspend}=="1"
ATTRS{bNumEndpoints}=="03"
ATTRS{authorized}=="1"
ATTRS{bInterfaceNumber}=="00"
ATTRS{bInterfaceProtocol}=="02"
ATTRS{bInterfaceSubClass}=="01"
ATTRS{bAlternateSetting}==" 0"
looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.4':
KERNELS=="1-1.4"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{devpath}=="1.4"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bNumInterfaces}==" 1"
ATTRS{configuration}==""
ATTRS{version}==" 1.10"
ATTRS{bMaxPacketSize0}=="8"
ATTRS{bmAttributes}=="80"
ATTRS{idProduct}=="7523"
ATTRS{bConfigurationValue}=="1"
ATTRS{idVendor}=="1a86"
ATTRS{maxchild}=="0"
ATTRS{removable}=="removable"
ATTRS{devnum}=="5"
ATTRS{authorized}=="1"
ATTRS{bNumConfigurations}=="1"
ATTRS{ltm_capable}=="no"
ATTRS{quirks}=="0x0"
ATTRS{bDeviceClass}=="ff"
ATTRS{rx_lanes}=="1"
ATTRS{busnum}=="1"
ATTRS{tx_lanes}=="1"
ATTRS{bcdDevice}=="0254"
ATTRS{bMaxPower}=="96mA"
ATTRS{speed}=="12"
ATTRS{urbnum}=="161"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bDeviceSubClass}=="00"
ATTRS{product}=="USB2.0-Serial"
looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1/1-1':
KERNELS=="1-1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{busnum}=="1"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{bDeviceProtocol}=="01"
ATTRS{bcdDevice}=="0000"
ATTRS{removable}=="fixed"
ATTRS{devpath}=="1"
ATTRS{version}==" 2.00"
ATTRS{rx_lanes}=="1"
ATTRS{speed}=="480"
ATTRS{devnum}=="2"
ATTRS{idProduct}=="0020"
ATTRS{bMaxPower}=="0mA"
ATTRS{quirks}=="0x0"
ATTRS{authorized}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{urbnum}=="53"
ATTRS{bDeviceClass}=="09"
ATTRS{ltm_capable}=="no"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bNumInterfaces}==" 1"
ATTRS{tx_lanes}=="1"
ATTRS{bConfigurationValue}=="1"
ATTRS{configuration}==""
ATTRS{maxchild}=="6"
ATTRS{idVendor}=="8087"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bNumConfigurations}=="1"
looking at parent device '/devices/pci0000:00/0000:00:1a.0/usb1':
KERNELS=="usb1"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{devnum}=="1"
ATTRS{bmAttributes}=="e0"
ATTRS{bConfigurationValue}=="1"
ATTRS{removable}=="unknown"
ATTRS{idProduct}=="0002"
ATTRS{version}==" 2.00"
ATTRS{bcdDevice}=="0419"
ATTRS{avoid_reset_quirk}=="0"
ATTRS{speed}=="480"
ATTRS{urbnum}=="26"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{devpath}=="0"
ATTRS{tx_lanes}=="1"
ATTRS{ltm_capable}=="no"
ATTRS{authorized_default}=="1"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bMaxPower}=="0mA"
ATTRS{authorized}=="1"
ATTRS{maxchild}=="3"
ATTRS{quirks}=="0x0"
ATTRS{rx_lanes}=="1"
ATTRS{product}=="EHCI Host Controller"
ATTRS{interface_authorized_default}=="1"
ATTRS{configuration}==""
ATTRS{busnum}=="1"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bNumInterfaces}==" 1"
ATTRS{idVendor}=="1d6b"
ATTRS{serial}=="0000:00:1a.0"
ATTRS{bNumConfigurations}=="1"
ATTRS{bDeviceClass}=="09"
ATTRS{manufacturer}=="Linux 4.19.0-11-rt-amd64 ehci_hcd"
looking at parent device '/devices/pci0000:00/0000:00:1a.0':
KERNELS=="0000:00:1a.0"
SUBSYSTEMS=="pci"
DRIVERS=="ehci-pci"
ATTRS{subsystem_vendor}=="0x103c"
ATTRS{numa_node}=="-1"
ATTRS{broken_parity_status}=="0"
ATTRS{revision}=="0x05"
ATTRS{consistent_dma_mask_bits}=="32"
ATTRS{vendor}=="0x8086"
ATTRS{device}=="0x3b3c"
ATTRS{class}=="0x0c0320"
ATTRS{driver_override}=="(null)"
ATTRS{irq}=="20"
ATTRS{dma_mask_bits}=="32"
ATTRS{local_cpulist}=="0-3"
ATTRS{subsystem_device}=="0x304a"
ATTRS{d3cold_allowed}=="1"
ATTRS{enable}=="1"
ATTRS{ari_enabled}=="0"
ATTRS{msi_bus}=="1"
ATTRS{companion}==""
ATTRS{uframe_periodic_max}=="100"
ATTRS{local_cpus}=="0f"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
user@debian:~$
Mohu Tě poprosit opět o:
Kód: Vybrat vše
stty -F /dev/ttyUSB0 -a
Jasne, to me taky mohlo napadnout.zz912 píše: ↑19. 1. 2021, 7:04Mohu Tě poprosit opět o:Zajímalo by mě, zda tu bude něco jinak.Kód: Vybrat vše
stty -F /dev/ttyUSB0 -a
Kód: Vybrat vše
user@debian:~$ sudo stty -F /dev/ttyUSB0 -a
speed 9600 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 hupcl -cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc
Kód: Vybrat vše
user@debian:~$ sudo stty -F /dev/ttyUSB0 -a
speed 4800 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; discard = ^O; min = 0; time = 0;
-parenb -parodd -cmspar cs8 -hupcl cstopb cread clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
-isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke -flusho -extproc
user@debian:~$
Njn, uvidime, dik!
Kód: Vybrat vše
stty --version
To bohužel ne. Mohl by si udělat pokus, ale není to úplně na 5 minut.. Konkrétně zkusit to v LiveCD http://www.linuxcnc.org/iso/linuxcnc-2.7.14-wheezy.iso. Obnáší to stáhnout to ISO, dát ho na CD nebo fleshku, nabootovat do LiveCD, stáhnout, rozbalit a spustit https://www.modbusdriver.com/modpoll.html. Předtím bys musel ještě připojit nějaké modbus zařízení a rozchodit modpoll na stejném stroji v jiném systému, abys měl prověřený set parametrů.
Mrknu, napíšu..zz912 píše: ↑19. 1. 2021, 8:25 Můžeš se mrknout ještě na verze stty ve Wheezy a Busteru?Kód: Vybrat vše
stty --version
Kód: Vybrat vše
user@debian:~$ sudo stty --version
stty (GNU coreutils) 8.30
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
user@debian:~$
Kód: Vybrat vše
tomas@debian-cnc-home:~$ sudo stty --version
stty (GNU coreutils) 8.13
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David MacKenzie.
tomas@debian-cnc-home:~$
Chápu, v pohodě
Přesně tak, booster měl neakceptovatelné latence.
Na co přesně se tam mám zaměřit?zz912 píše: ↑19. 1. 2021, 8:30 Zkus se mrknout na tohle:
https://stackoverflow.com/questions/282 ... o-run-sudo
Jeden pobitevní: motor není na ladění modpollu potřebaMex píše: ↑19. 1. 2021, 9:46 Včera jsem pro řešení téhle kauzy udělal u sebe základní přepoklady.
Tedy konkrétně udělal jsem to nejpracnější z celého řešení - našel jsem měnič (víc než 2 hodiny hledání), motor a 2 převodníky. A pak nadrátoval motor. Ten, co vymýšlel dostupnost svorkovnice musel být asi původně gynekolog.
Nerozumím ti, ale věřím ti