- Posts: 50
- Thank you received: 4
Parallel port stepper control and etherCAT I/O
4 years 1 week ago #255054
by O.R
Replied by O.R on topic Parallel port stepper control and etherCAT I/O
I installed ethercat master again and now ethercat.conf is not empty.
Not sure what is a correct MAC address for MASTER0 device.
Code:
sorvi@debian:~$ sudo apt-get install ethercat-dkms libethercat libethercat-dev ethercat-master
[sudo] password for sorvi:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
dkms linux-headers-4.19.0-22-amd64 linux-headers-4.19.0-22-common
linux-headers-amd64
Suggested packages:
python3-apport menu
The following NEW packages will be installed:
dkms ethercat-dkms ethercat-master libethercat libethercat-dev
linux-headers-4.19.0-22-amd64 linux-headers-4.19.0-22-common
linux-headers-amd64
0 upgraded, 8 newly installed, 0 to remove and 42 not upgraded.
Need to get 11.0 MB of archives.
After this operation, 127 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
WARNING: The following packages cannot be authenticated!
ethercat-dkms libethercat ethercat-master libethercat-dev
Install these packages without verification? [y/N] y
Get:1 http://deb.debian.org/debian buster/main amd64 dkms all 2.6.1-4 [74.4 kB]
Get:2 http://security.debian.org/debian-security buster/updates/main amd64 linux-headers-4.19.0-22-common all 4.19.260-1 [8,582 kB]
Get:3 https://download.opensuse.org/repositories/home:/bone11111:/branches:/science:/EtherLab/Debian_10 ./ ethercat-dkms 1.5.2-34 [1,058 kB]
Get:4 https://download.opensuse.org/repositories/home:/bone11111:/branches:/science:/EtherLab/Debian_10 ./ libethercat 1.5.2-34 [20.8 kB]
Get:5 https://download.opensuse.org/repositories/home:/bone11111:/branches:/science:/EtherLab/Debian_10 ./ ethercat-master 1.5.2-34 [138 kB]
Get:6 https://download.opensuse.org/repositories/home:/bone11111:/branches:/science:/EtherLab/Debian_10 ./ libethercat-dev 1.5.2-34 [19.5 kB]
Get:7 http://security.debian.org/debian-security buster/updates/main amd64 linux-headers-4.19.0-22-amd64 amd64 4.19.260-1 [1,107 kB]
Get:8 http://security.debian.org/debian-security buster/updates/main amd64 linux-headers-amd64 amd64 4.19+105+deb10u17 [7,012 B]
Fetched 11.0 MB in 5s (2,368 kB/s)
Selecting previously unselected package dkms.
(Reading database ... 136195 files and directories currently installed.)
Preparing to unpack .../0-dkms_2.6.1-4_all.deb ...
Unpacking dkms (2.6.1-4) ...
Selecting previously unselected package ethercat-dkms.
Preparing to unpack .../1-ethercat-dkms_1.5.2-34_all.deb ...
Unpacking ethercat-dkms (1.5.2-34) ...
Selecting previously unselected package libethercat.
Preparing to unpack .../2-libethercat_1.5.2-34_amd64.deb ...
Unpacking libethercat (1.5.2-34) ...
Selecting previously unselected package ethercat-master.
Preparing to unpack .../3-ethercat-master_1.5.2-34_amd64.deb ...
Unpacking ethercat-master (1.5.2-34) ...
Selecting previously unselected package libethercat-dev.
Preparing to unpack .../4-libethercat-dev_1.5.2-34_amd64.deb ...
Unpacking libethercat-dev (1.5.2-34) ...
Selecting previously unselected package linux-headers-4.19.0-22-common.
Preparing to unpack .../5-linux-headers-4.19.0-22-common_4.19.260-1_all.deb ...
Unpacking linux-headers-4.19.0-22-common (4.19.260-1) ...
Selecting previously unselected package linux-headers-4.19.0-22-amd64.
Preparing to unpack .../6-linux-headers-4.19.0-22-amd64_4.19.260-1_amd64.deb ...
Unpacking linux-headers-4.19.0-22-amd64 (4.19.260-1) ...
Selecting previously unselected package linux-headers-amd64.
Preparing to unpack .../7-linux-headers-amd64_4.19+105+deb10u17_amd64.deb ...
Unpacking linux-headers-amd64 (4.19+105+deb10u17) ...
Setting up dkms (2.6.1-4) ...
Setting up linux-headers-4.19.0-22-common (4.19.260-1) ...
Setting up ethercat-dkms (1.5.2-34) ...
Loading new ethercat-dkms-1.5.2 DKMS files...
Building for 4.19.0-21-rt-amd64
Module build for kernel 4.19.0-21-rt-amd64 was skipped since the
kernel headers for this kernel does not seem to be installed.
Adding Module to DKMS build system
Error! DKMS tree already contains: ethercat-dkms-1.5.2
You cannot add the same module/version combo more than once.
Doing initial module build
Error! Your kernel headers for kernel 4.19.0-21-rt-amd64 cannot be found.
Please install the linux-headers-4.19.0-21-rt-amd64 package,
or use the --kernelsourcedir option to tell DKMS where it's located
Installing initial module
Error! Your kernel headers for kernel 4.19.0-21-rt-amd64 cannot be found.
Please install the linux-headers-4.19.0-21-rt-amd64 package,
or use the --kernelsourcedir option to tell DKMS where it's located
Done.
Setting up linux-headers-4.19.0-22-amd64 (4.19.260-1) ...
Setting up libethercat (1.5.2-34) ...
Setting up libethercat-dev (1.5.2-34) ...
Setting up ethercat-master (1.5.2-34) ...
Configuration file '/etc/ethercat.conf'
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** ethercat.conf (Y/I/N/O/D/Z) [default=N] ? y
Installing new version of config file /etc/ethercat.conf ...
ethercat.service is a disabled or a static unit, not starting it.
Setting up linux-headers-amd64 (4.19+105+deb10u17) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for libc-bin (2.28-10+deb10u1) ...
sorvi@debian:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether 00:27:0e:14:35:a7 brd ff:ff:ff:ff:ff:ff
3: wlx1caff76aebba: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 1c:af:f7:6a:eb:ba brd ff:ff:ff:ff:ff:ff
inet 192.168.1.90/24 brd 192.168.1.255 scope global dynamic noprefixroute wlx1caff76aebba
valid_lft 85092sec preferred_lft 85092sec
inet6 fe80::4114:2ffa:3d45:136e/64 scope link noprefixroute
valid_lft forever preferred_lft forever
sorvi@debian:~$ sudo geany /etc/ethercat.conf
Not sure what is a correct MAC address for MASTER0 device.
Code:
#------------------------------------------------------------------------------
#
# EtherCAT master configuration file for use with ethercatctl.
#
# $Id$
#
# vim: spelllang=en spell tw=78
#
#------------------------------------------------------------------------------
#
# Main Ethernet devices.
#
# The MASTER<X>_DEVICE variable specifies the Ethernet device for a master
# with index 'X'.
#
# Specify the MAC address (hexadecimal with colons) of the Ethernet device to
# use. Example: "00:00:08:44:ab:66"
#
# Alternatively, a network interface name can be specified. The interface
# name will be resolved to a MAC address using the 'ip' command.
# Example: "eth0"
#
# The broadcast address "ff:ff:ff:ff:ff:ff" has a special meaning: It tells
# the master to accept the first device offered by any Ethernet driver.
#
# The MASTER<X>_DEVICE variables also determine, how many masters will be
# created: A non-empty variable MASTER0_DEVICE will create one master, adding a
# non-empty variable MASTER1_DEVICE will create a second master, and so on.
#
# Examples:
# MASTER0_DEVICE="00:00:08:44:ab:66"
# MASTER0_DEVICE="eth0"
#
MASTER0_DEVICE=""
#MASTER1_DEVICE=""
#
# Backup Ethernet devices
#
# The MASTER<X>_BACKUP variables specify the devices used for redundancy. They
# behaves nearly the same as the MASTER<X>_DEVICE variable, except that it
# does not interpret the ff:ff:ff:ff:ff:ff address.
#
#MASTER0_BACKUP=""
#
# Ethernet driver modules to use for EtherCAT operation.
#
# Specify a non-empty list of Ethernet drivers, that shall be used for
# EtherCAT operation.
#
# Except for the generic Ethernet driver module, the init script will try to
# unload the usual Ethernet driver modules in the list and replace them with
# the EtherCAT-capable ones. If a certain (EtherCAT-capable) driver is not
# found, a warning will appear.
#
# Possible values: 8139too, e100, e1000, e1000e, r8169, generic, ccat, igb.
# Separate multiple drivers with spaces.
#
# Note: The e100, e1000, e1000e, r8169, ccat and igb drivers are not built by
# default. Enable them with the --enable-<driver> configure switches.
#
# Attention: When using the generic driver, the corresponding Ethernet device
# has to be activated (with OS methods, for example 'ip link set ethX up'),
# before the master is started, otherwise all frames will time out.
#
DEVICE_MODULES=""
#
# Flags for loading kernel modules.
#
# This can usually be left empty. Adjust this variable, if you have problems
# with module loading.
#
#MODPROBE_FLAGS="-b"
#------------------------------------------------------------------------------
Please Log in or Create an account to join the conversation.
4 years 1 week ago - 4 years 1 week ago #255060
by CORBETT
Replied by CORBETT on topic Parallel port stepper control and etherCAT I/O
Ok good deal....
Now just do a "ip addr" from the command line and record your MAC address
It should be in the "eth0" section
Then back in the ethercat cofig file under the section with
MASTER0_DEVICE=""
add your address you saw with "ip addr" (buster) or "ifconfig" (Wheezy)
Here is an example of one of my old computers. Sometimes it will be Letters mixed in with the numbers.
MASTER0_DEVICE="03:36:4b:c4:52:66"
*EDIT*
Also, you need to fill in for the device module section
In the ethercat config file, scroll down to the part with
DEVICE_MODULES=""
Add e1000e to start with and see if it works. I usually always get e1000 or e1000e to work most always. May need to put "generic"
it will look like this
DEVICE_MODULES="e1000e"
You may need to do a restart after adding the address. Don't forget to save the file after you put in the MAC address and device name.
*EDIT*
Don't forget to finish out the commands after doing the above mentioned
sudo systemctl enable ethercat.service
sudo systemctl start ethercat.service
sudo systemctl status ethercat.service
sudo chmod 666 /dev/EtherCAT0
EtherCAT should be running after the above... just do a "ethercat master" and you should see it pop up.
Now just do a "ip addr" from the command line and record your MAC address
It should be in the "eth0" section
Then back in the ethercat cofig file under the section with
MASTER0_DEVICE=""
add your address you saw with "ip addr" (buster) or "ifconfig" (Wheezy)
Here is an example of one of my old computers. Sometimes it will be Letters mixed in with the numbers.
MASTER0_DEVICE="03:36:4b:c4:52:66"
*EDIT*
Also, you need to fill in for the device module section
In the ethercat config file, scroll down to the part with
DEVICE_MODULES=""
Add e1000e to start with and see if it works. I usually always get e1000 or e1000e to work most always. May need to put "generic"
it will look like this
DEVICE_MODULES="e1000e"
You may need to do a restart after adding the address. Don't forget to save the file after you put in the MAC address and device name.
*EDIT*
Don't forget to finish out the commands after doing the above mentioned
sudo systemctl enable ethercat.service
sudo systemctl start ethercat.service
sudo systemctl status ethercat.service
sudo chmod 666 /dev/EtherCAT0
EtherCAT should be running after the above... just do a "ethercat master" and you should see it pop up.
Last edit: 4 years 1 week ago by CORBETT. Reason: make it clearer
Please Log in or Create an account to join the conversation.
4 years 1 week ago #255076
by rodw
Replied by rodw on topic Parallel port stepper control and etherCAT I/O
Corbet has things well covered
when you type:
look for a line that looks something like this
the MAC address is 00:0c:29:11:47:23 in this example
But also I noticed that you were getting an error about linux-headers not being found. Ethercat is fussy about kernel versions. Thats why in the sticky in a subsequent post we said to install them by typing
when you type:
Code:
ip a, (or ip addr)
Code:
link/ether 00:0c:29:11:47:23 brd ff:ff:ff:ff:ff:ff
But also I noticed that you were getting an error about linux-headers not being found. Ethercat is fussy about kernel versions. Thats why in the sticky in a subsequent post we said to install them by typing
Code:
sudo apt install -y linux-headers-$(uname -r)
The following user(s) said Thank You: CORBETT
Please Log in or Create an account to join the conversation.
4 years 6 days ago #255122
by O.R
Replied by O.R on topic Parallel port stepper control and etherCAT I/O
I installed headers again and "generic" device module worked after restart, i can now see installed slave modules
Code:
sorvi@debian:~$ ethercat slaves
0 0:0 PREOP + EK1100 EtherCAT-Koppler (2A E-Bus)
1 0:1 PREOP + EL2004 4K. Dig. Ausgang 24V, 0.5A
2 0:2 PREOP + EL1004 4K. Dig. Eingang 24V, 3ms
3 0:3 PREOP + EL1124 4K. Dig. Eingang 5V, 2.2�s, Sensorversorgung
sorvi@debian:~$
The following user(s) said Thank You: rodw
Please Log in or Create an account to join the conversation.
4 years 6 days ago #255156
by CORBETT
Replied by CORBETT on topic Parallel port stepper control and etherCAT I/O
Good deal... It's always an awesome feeling when you finally get something working. image missing /media/kunena/emoticons/smile.png
Please Log in or Create an account to join the conversation.
4 years 6 days ago #255159
by rodw
Replied by rodw on topic Parallel port stepper control and etherCAT I/O
Great work!
It seems that your problems mostly came from not following the process we mapped out and skipping a few key steps.
But sharing your console results allowed us to drill into the issues..
I will say though that it is not a trivial exercise and its hard to see the error reports sometimes among other data.
I spent many hurs sorting it out too.
It seems that your problems mostly came from not following the process we mapped out and skipping a few key steps.
But sharing your console results allowed us to drill into the issues..
I will say though that it is not a trivial exercise and its hard to see the error reports sometimes among other data.
I spent many hurs sorting it out too.
Please Log in or Create an account to join the conversation.
Time to create page: 0.236 seconds