Ubuntu 22.04安装IGH

查看设备是否支持

硬件

shell 复制代码
$ sudo lshw -class network -short
H/W path           Device     Class          Description
========================================================
/0/100/1c/0        enp1s0     network        I211 Gigabit Network Connection
/0/100/1c.1/0      enp2s0     network        RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
/0/100/1c.2/0      enp3s0     network        RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller

查看RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller使用的驱动

端口enp2s0连接的EtherCAT设备

shell 复制代码
$ ethtool -i enp2s0 | grep driver
driver: r8169

系统

实时内核

shell 复制代码
$ uname -a
Linux demo-O-E-M 5.15.0-1053-realtime #59-Ubuntu SMP PREEMPT_RT Fri Jan 12 20:29:00 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

测试实时性

shell 复制代码
$ sudo cyclictest -t 5 -p 99
# /dev/cpu_dma_latency set to 0us
policy: fifo: loadavg: 3.68 2.48 1.44 1/802 2688596

T: 0 (2687390) P:99 I:1000 C: 170479 Min:      3 Act:    4 Avg:    4 Max:      73
T: 1 (2687391) P:99 I:1500 C: 113653 Min:      3 Act:    4 Avg:    4 Max:      24
T: 2 (2687392) P:99 I:2000 C:  85239 Min:      3 Act:    4 Avg:    4 Max:      24
T: 3 (2687393) P:99 I:2500 C:  68191 Min:      4 Act:    4 Avg:    4 Max:      40
T: 4 (2687394) P:99 I:3000 C:  56826 Min:      4 Act:    4 Avg:    4 Max:      23

安装IGH主站

下载源码

shell 复制代码
$ git clone https://gitlab.com/etherlab.org/ethercat.git
$ cd ethercat
$ ./bootstrap
$ ./configure --enable-generic --enable-8139too=no --enable-r8169=yes
$ make
$ make modules
$ sudo make install
$ sudo make modules_install
$ sudo depmod

安装

shell 复制代码
# modprobe ec_generic ec_master
# lsmod | grep ec_
ec_generic             16384  0
ec_master             348160  1 ec_generic

配置

复制代码
$ vim /usr/local/etc/ethercat.conf
MASTER0_DEVICE="68:ed:a6:08:b1:77"

测试

shell 复制代码
# ethercat master
Master0
  Phase: Idle
  Active: no
  Slaves: 1
  Ethernet devices:
    Main: 68:ed:a6:08:b1:77 (attached)
      Link: UP
      Tx frames:   33700
      Tx bytes:    2099856
      Rx frames:   33700
      Rx bytes:    2099856
      Tx errors:   0
      Tx frame rate [1/s]:    186    186    184
      Tx rate [KByte/s]:     10.9   11.2   11.2
      Rx frame rate [1/s]:    186    186    184
      Rx rate [KByte/s]:     10.9   11.2   11.2
    Common:
      Tx frames:   33700
      Tx bytes:    2099856
      Rx frames:   33700
      Rx bytes:    2099856
      Lost frames: 0
      Tx frame rate [1/s]:    186    186    184
      Tx rate [KByte/s]:     10.9   11.2   11.2
      Rx frame rate [1/s]:    186    186    184
      Rx rate [KByte/s]:     10.9   11.2   11.2
      Loss rate [1/s]:          0      0      0
      Frame loss [%]:         0.0    0.0    0.0
  Distributed clocks:
    Reference clock:   Slave 0
    DC reference time: 0
    Application time:  0
                       2000-01-01 00:00:00.000000000
# ethercat slave
0  0:0  PREOP  +  SV660_1Axis_00916

TODO

文中使用ec_generic通用驱动,需换为ec_r8169

-->

编辑ethercat配置文件

shell 复制代码
# vim /usr/local/etc/sysconfig/ethercat
MASTER0_DEVICE="68:ed:a6:08:b1:77"
DEVICE_MODULES="r8169"
# /usr/local/etc/init.d/ethercat restart

问题: 虽然ethercat master也能够正常工作,但是ifconfig却看不到网卡了

相关推荐
sayang_shao1 小时前
STM32H7+FreeRTOS+LwIP移植EtherCAT开源主站SOEM
stm32·soem·ethercat·canopen
水冗水孚2 小时前
😱😱😱CPU和内存飙到100%——我的火山引擎服务器被印度的ip恶意植入挖矿程序了!😡😡😡
服务器·ubuntu·centos
gnawkhhkwang2 小时前
Linux 调度器函数sched_*系统调用及示例
linux·服务器
帅帅梓2 小时前
Linux lvm逻辑卷管理
linux·运维·数据库
科大饭桶3 小时前
Linux系统编程Day5 -- Vim工具的使用
linux·运维·服务器·c语言·c++
I'm a winner3 小时前
基于 Ubuntu 的 Linux 系统中 Vivado 2020.1 下载安装教程
linux·ubuntu·fpga开发
风车带走过往3 小时前
centos通过DockerCompose搭建开源MediaCMS
linux·开源·centos
努力自学的小夏4 小时前
RK3568 Linux驱动学习——字符设备驱动开发
linux·驱动开发·笔记·学习
小孙姐4 小时前
Linux-Day10.系统安全保护&web服务管理
linux·运维·服务器
AOwhisky4 小时前
云计算一阶段Ⅱ——11. Linux 防火墙管理
linux·运维·云计算