I used your configuration to get my vscode dev container up and running, but I cannot get any info from the EtherCAT slaves using SOEM's simpletest
tool. No matter what I do, it's always says no slaves found. I double checked it with TwinCAT and I can definitely detect them. I always get the following:
SOEM (Simple Open EtherCAT Master)
Simple test
Starting simple test
ec_init on eth0 succeeded.
No slaves found!
End simple test, close socket
End program
devcontainer.json
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
{
"name": "Docker PREEMPT_RT real-time",
"dockerComposeFile": "compose.yaml",
"service": "docker_realtime",
"workspaceFolder": "/workspace/framework",
"shutdownAction": "stopCompose",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "gcc -v",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
"remoteUser": "root"
}
compose.yaml
version: "3.9"
services:
docker_realtime:
build:
context: .
dockerfile: Dockerfile
container_name: realtime_docker
tty: true
cap_add:
- SYS_NICE
ulimits:
rtprio: 99
rttime: -1
memlock: 8428281856
network_mode: host
volumes:
- ..:/workspace/framework
Dockerfile
FROM mcr.microsoft.com/devcontainers/cpp:0-ubuntu-22.04
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="3.22.2"
# Optionally install the cmake for vcpkg
COPY ./reinstall-cmake.sh /tmp/
RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
fi \
&& rm -f /tmp/reinstall-cmake.sh
# [Optional] Uncomment this section to install additional vcpkg ports.
# RUN su vscode -c "${VCPKG_ROOT}/vcpkg install <your-port-name-here>"
# [Optional] Uncomment this section to install additional packages.
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends net-tools iputils-ping