Running Virtual EtherCAT device on virtual Linux #345
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
'lo' is not a suitable interface for this usecase: as soon as a frame is sent in this interface, the simulator will loop on it indefinitely because both sides (simulator and client, here scanTopology) are both connected to TX and RX together. However, while reading the code and the README I encounters a few bugs in theses tools: PR #346 shall fixed theses. If possible, the best way to connect the network simulator is to use the tap socket: Otherwise you can create a linux tap interface or start the simulator on another system to use a real network interface (or use two interface on the same machine to create a real loopback). |
Beta Was this translation helpful? Give feedback.
-
|
Thank you so much! Now, I can do the simulation on a Raspberry Pi. I have a question about another thing. I tried to simulate my actual EtherCAT slave, so I import the XML file, and the EEPROM BIN file of my own EtherCAT device. Then, I create a JSON file point to those files. But when I run the network simulator or the od_generator, it give me "Segmentation fault". I don't think the problems come from my XML file or BIN file because my EtherCAT device with these files are still working well with the TwinCAT. Can you please try to take a look into this problem? I also attached the XML file, the BIN file and the JSON file of my EtherCAT device. |
Beta Was this translation helpful? Give feedback.

'lo' is not a suitable interface for this usecase: as soon as a frame is sent in this interface, the simulator will loop on it indefinitely because both sides (simulator and client, here scanTopology) are both connected to TX and RX together.
However, while reading the code and the README I encounters a few bugs in theses tools: PR #346 shall fixed theses.
If possible, the best way to connect the network simulator is to use the tap socket:
tap:server for the network simulator
tap:client for the standard master (here scanTopology)
Otherwise you can create a linux tap interface or start the simulator on another system to use a real network interface (or use two interface on the same machine…