{"id":28103,"library":"pysoem","title":"pysoem","description":"Cython wrapper for the SOEM (Simple Open EtherCAT Master) library. Provides Python bindings to control EtherCAT networks. Current version 1.1.13. Release cadence: irregular, several minor releases per year.","status":"active","version":"1.1.13","language":"python","source_language":"en","source_url":"https://github.com/bnjmnp/pysoem","tags":["ethercat","soem","industrial-automation","cython"],"install":[{"cmd":"pip install pysoem","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Required at build time if installing from source; pre-built wheels available for most platforms.","package":"Cython","optional":true}],"imports":[{"note":"Primary class for EtherCAT master operations.","symbol":"Master","correct":"from pysoem import Master"},{"note":"Module-level configuration object (e.g., timeouts, GIL behavior).","symbol":"settings","correct":"from pysoem import settings"},{"note":"Emergency message type constant.","symbol":"EMERGENCY","correct":"from pysoem import EMERGENCY"}],"quickstart":{"code":"import time\nfrom pysoem import Master\n\nmaster = Master()\nmaster.open(os.environ.get('ETHERCAT_INTERFACE', 'eth0'))\nmaster.config_init()\n\n# Map PDOs (example)\nfor slave in master.slaves:\n    print(slave.name)\n\nmaster.config_map()\nmaster.state = 'OP'\nmaster.write_state()\nmaster.receive_processdata()\ntime.sleep(0.1)\n\nmaster.close()","lang":"python","description":"Basic EtherCAT master setup: open interface, configure slaves, map PDOs, set operational state."},"warnings":[{"fix":"Set pysoem.settings.always_release_gil = False if you need the GIL held for legacy reasons, or pass release_gil=False to individual calls.","message":"In version 1.1.11, the default release_gil behavior changed. New functions and a global setting 'always_release_gil' were added. Code relying on GIL being held during SDO operations may need to explicitly set release_gil=False.","severity":"breaking","affected_versions":">=1.1.11"},{"fix":"Ensure config_init() is called exactly once per master instance.","message":"The config_init() method may fail if called multiple times without a proper re-initialization. Bug fixed in 1.1.6, but still advisable to call config_init() only once per session.","severity":"gotcha","affected_versions":">=1.1.6"},{"fix":"Set config_func and setup_func on each slave before calling config_init(), or upgrade to 1.1.8+.","message":"Properties 'config_func' and 'setup_func' can be None if not initialized. Accessing them before assignment can cause null pointer errors (fixed in 1.1.8). Always set them before use or check for None.","severity":"gotcha","affected_versions":"<1.1.8"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Run 'pip install pysoem' in the correct virtual environment. Ensure pip is up to date.","cause":"Missing installation or wrong Python environment.","error":"ModuleNotFoundError: No module named 'pysoem'"},{"fix":"Upgrade to the latest version: 'pip install --upgrade pysoem'. Check import path: from pysoem import Master.","cause":"Trying to use an older version of pysoem (pre-1.0) where the API was different, or a corrupted installation.","error":"AttributeError: 'Master' object has no attribute 'config_init'"},{"fix":"Verify network connection and slave state. Ensure master.state is 'OP'. Check that the slave supports the SDO.","cause":"Network issues, slave not responding, or incorrect SDO index/subindex.","error":"pysoem.slaves[0].sdo_read(0x1000, 1) -> OSError: SDO read failed"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}