2398 Starting EtherCAT master done |
2398 Starting EtherCAT master done |
2399 \end{lstlisting} |
2399 \end{lstlisting} |
2400 |
2400 |
2401 %------------------------------------------------------------------------------ |
2401 %------------------------------------------------------------------------------ |
2402 |
2402 |
2403 \section{Monitoring and Debugging} |
2403 \section{Debug Interfaces} |
2404 \label{sec:debug} |
2404 \label{sec:debug} |
2405 \index{Monitoring} |
2405 \index{Debug Interfaces} |
2406 |
2406 |
2407 EtherCAT buses can always be monitored by inserting a switch between master |
2407 EtherCAT buses can always be monitored by inserting a switch between master |
2408 and slaves. This allows to connect another PC with a network monitor like |
2408 and slaves. This allows to connect another PC with a network monitor like |
2409 Wireshark~\cite{wireshark}, for example. |
2409 Wireshark~\cite{wireshark}, for example. |
2410 |
2410 |
2411 For convenience, so-called ``debug interfaces'' are supported. Debug interfaces |
2411 For convenience, so-called ``debug interfaces'' are supported. Debug |
2412 allow to monitor EtherCAT traffic with a network monitor (like Wireshark or |
2412 interfaces allow to monitor EtherCAT traffic with a network monitor (like |
2413 tcpdump) running on the same machine. To use this functionality, the master |
2413 Wireshark or tcpdump) running on the master machine without using external |
2414 sources have to be configured with the \lstinline+--enable-debug-if+ switch |
2414 hardware. To use this functionality, the master sources have to be configured |
2415 (see sec.~\ref{sec:installation}). |
2415 with the \lstinline+--enable-debug-if+ switch (see |
2416 |
2416 sec.~\ref{sec:installation}). |
2417 Every EtherCAT master registers two read-only network interfaces. These are |
2417 |
2418 named \textit{ecdbgmX} (main device) and \textit{ecdbgbX} (backup device for |
2418 Every EtherCAT master registers a read-only network interface per attached |
2419 future use), where X is the master index. The debug interfaces are listed in |
2419 device. The interfaces are named \textit{ecdbgmX} for the main device, and |
2420 the below output: |
2420 \textit{ecdbgbX} for the backup device (for future use), where X is the master |
|
2421 index. The below listing shows one debug interface among some standard |
|
2422 interfaces: |
2421 |
2423 |
2422 \begin{lstlisting} |
2424 \begin{lstlisting} |
2423 # `\textbf{ip link}` |
2425 # `\textbf{ip link}` |
2424 1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue |
2426 1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue |
2425 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 |
2427 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 |
2426 4: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000 |
2428 4: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000 |
|
2429 link/ether 00:13:46:3b:ad:d7 brd ff:ff:ff:ff:ff:ff |
|
2430 8: ecdbgm0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast qlen 1000 |
2427 link/ether 00:04:61:03:d1:01 brd ff:ff:ff:ff:ff:ff |
2431 link/ether 00:04:61:03:d1:01 brd ff:ff:ff:ff:ff:ff |
2428 8: ecdbgm0: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast |
2432 \end{lstlisting} |
2429 qlen 1000 |
2433 |
2430 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff |
2434 While a debug interface is enabled, all frames sent or received to or from the |
2431 9: ecdbgb0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000 |
2435 physical device are additionally forwarded to the debug interface by the |
2432 link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff |
2436 corresponding master. Interfaces can be enabled with the below command: |
2433 \end{lstlisting} |
|
2434 |
|
2435 While a debug interface is enabled, the corresponding master forwards all |
|
2436 frames sent and received to or from the bus to that interface. Interfaces can |
|
2437 be enabled for example with the command: |
|
2438 |
2437 |
2439 \begin{lstlisting} |
2438 \begin{lstlisting} |
2440 # `\textbf{ip link set dev ecdbgm0 up}` |
2439 # `\textbf{ip link set dev ecdbgm0 up}` |
2441 \end{lstlisting} |
2440 \end{lstlisting} |
2442 |
2441 |