Skip to main content

A rocker extension to install EtherCAT Master IgH (EtherLab) inside a Docker image.

Project description

etherlab_rocker

Publish to PyPI PyPI version

A rocker extension that installs the EtherCAT Master IgH (EtherLab) userspace library from source inside a Docker image and forwards the master device and configuration into the container.

The extension clones a chosen tag or branch of EtherLab EtherCAT master from https://gitlab.com/etherlab.org/ethercat.git, builds it with --disable-kernel (userspace-only), and installs it under /usr/local/etherlab.

In addition, the /dev/EtherCAT<idx> device is exposed to the container via --device and the EtherLab config/etc/sysconfig/ethercat is bind-mounted (read-only) into the container automatically.

Missing features:

  • Multiple EtherCAT devices (multi-master setup);
  • EtherLab repos URL as an argument;
  • Master launch at startup, i.e., run sudo /etc/init.d/ethercat start in host.

Prerequisites: kernel module on the host

Because this extension builds EtherLab with --disable-kernel, no kernel module is compiled inside the container. The ec_master kernel module must be built and loaded on the host machine before starting the container. The userspace library communicates with the master through the exposed /dev/EtherCAT* device.

Installation

From PyPI

pip install etherlab-rocker

From source (development)

git clone https://github.com/tpoignonec/etherlab_rocker.git

# Virtual environment
sudo apt install python3-venv
python3 -m venv .venv
source .venv/bin/activate

# Install package
pip install -e ./etherlab_rocker

Usage

sudo apt-get install python3-rocker

rocker --etherlab [--etherlab-version <version>] [--ethercat-master-idx <idx>] <base-image> [command]

Arguments

Argument Default Description
--etherlab Enable the extension (required)
--etherlab-version stable-1.5 Any git tag or branch of the EtherLab repository (e.g. stable-1.5, 1.6.1, etc.). Use none to skip installation and only forward devices and config
--ethercat-master-idx 0 Index of the /dev/EtherCAT<idx> device to forward into the container. Set to -1 to disable device forwarding

Examples

Basic — install EtherLab stable-1.5 (default) and open a shell:

rocker --etherlab ubuntu:24.04 bash

Use a specific tag or branch:

rocker --etherlab --etherlab-version stable-1.6 ubuntu:24.04 bash

Explicit master device index:

rocker --etherlab --ethercat-master-idx 1 ubuntu:24.04 bash

Note that no value is the same as 0.

Skip installation (use a pre-built image that already has EtherLab):

rocker --etherlab --etherlab-version none my-prebuilt-image bash

Disable device forwarding (build/test only, no hardware):

rocker --etherlab --ethercat-master-idx -1 ubuntu:24.04 bash

Test the connection to the EtherCAT master

Once inside the container:

# List slaves on the bus
ethercat slaves

# Show master state
ethercat master

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

etherlab_rocker-0.1.0.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

etherlab_rocker-0.1.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file etherlab_rocker-0.1.0.tar.gz.

File metadata

  • Download URL: etherlab_rocker-0.1.0.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for etherlab_rocker-0.1.0.tar.gz
Algorithm Hash digest
SHA256 997c603f4123e1c67d3efb6e92a8b71bdf4f69f024668058b92008bcf59208ce
MD5 beb9082394a5573e868959f06cc492d0
BLAKE2b-256 9348d689c0db44e33a24b79429ba328bcc35504099d03770438cb250a6b4a02a

See more details on using hashes here.

Provenance

The following attestation bundles were made for etherlab_rocker-0.1.0.tar.gz:

Publisher: publish.yaml on tpoignonec/etherlab_rocker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file etherlab_rocker-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for etherlab_rocker-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f3125f36afa0ecb2e73975f274bb22f242ff19bc2f2e07c02f73328712b1fb4c
MD5 ff94e84d661ee2d336a94b3ee936cca7
BLAKE2b-256 c22b9a82ca59d296713f4c1f43b350d4d29abf6c2ff65d04f7ad27b4dd32d2af

See more details on using hashes here.

Provenance

The following attestation bundles were made for etherlab_rocker-0.1.0-py3-none-any.whl:

Publisher: publish.yaml on tpoignonec/etherlab_rocker

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page