Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to setup libethercat for only user space, #9

Closed
monishekar518 opened this issue Jun 25, 2024 · 5 comments
Closed

How to setup libethercat for only user space, #9

monishekar518 opened this issue Jun 25, 2024 · 5 comments

Comments

@monishekar518
Copy link

I would like to use libethercat as master and connect it to a virtual interface to scan and configure the slaves.

would this be possible ?

@robert-burger
Copy link
Owner

As libethercat is a user space library i don't understand your question and the relation to a virtual interface.

In principle libethercat doesn't care if the provided interface is virtual. How should this be configured? What slaves attached to where? How does your setup look like?

@monishekar518
Copy link
Author

So I want a set up a network like shown below.
Libethercat master <--> virtual nic <--> physical nic <--> slave

i am able to initalize but the master is not able to read the slaves and configure the slave on the network.
virtual interface is created as below.
#sudo modprobe dummy
#sudo ip link add eth0 type dummy
#sudo ip link set eth0 up

the binding between virtual to physical nic is operated using raw sockets.
I have created 2 threads,
thread 1 > binding function with 2 sockets, source as virtual nic and destination as physical nic, then forward frames
thread 2 > binding function with 2 sockets, source as physical nic and destination as virtual nic, then forward frames

Physical connection is connected to Beckhoff slave.

Could you please tell me why the master doesn't detect slaves with above setup.

@robert-burger
Copy link
Owner

In this case i don't think that the dummy driver is the right choice. As the name implies the dummy devices are not really working.

I think you should better have a look at tun/tap devices. For EtherCAT (layer 2 ethernet) a tap device should be the best choice here.

@monishekar518
Copy link
Author

But, I am able to capture the frames from master using raw sockets.

@robert-burger
Copy link
Owner

sorry that i come back to this that late.

did you resolve the issue in the meantime?

So you have wireshark/tcpdump logs and can see the EtherCAT frames in both direction captured at the physical nic AND the virtual nic?

@robert-burger robert-burger reopened this Jul 24, 2024
@robert-burger robert-burger closed this as not planned Won't fix, can't repro, duplicate, stale Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants