what do you mean broke system packages? what errors do you have? just please follow the instructions, I just tested it on a clean system and everything worked without errors
Thanks for the heads-up! Actually i already using a virtual environment. You can check it in the full guide in Step 8. This is done specifically to comply with PEP 668 and avoid breaking system-managed packages on Debian Bookworm.
By using python3 -m venv venv we ensure that pip only affects the isolated environment inside the plugin folder, keeping the global Volumio system clean.
To make the installation even more robust, I think i have to refine some steps based on your feedback
i‘m not sure but when the service starts it stops immediately with an error
may be i tried too much to work around that not really knowing what i do…
All good, just post here all error that you have.
Use:
sudo systemctl status es9018k2m.service
and
sudo journalctl -u es9018k2m.service -f
sudo systemctl status es9018k2m.service
● es9018k2m.service - ES9018K2M DAC WebSocket Controller
Loaded: loaded (/etc/systemd/system/es9018k2m.service; enabled; preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2026-01-04 18:42:57 CET; 1s ago
Process: 13678 ExecStart=/volumio/app/plugins/system_controller/i2s_dacs/scripts/venv/bin/python ES9018K2M_I2C_Volumio.py (code=exited, status=1/FAILURE)
Main PID: 13678 (code=exited, status=1/FAILURE)
CPU: 238ms
sudo journalctl -u es9018k2m.service -f
Jan 04 18:44:12 aoide2 systemd[1]: es9018k2m.service: Failed with result ‘exit-code’.
Jan 04 18:44:14 aoide2 systemd[1]: es9018k2m.service: Scheduled restart job, restart counter is at 6925.
Jan 04 18:44:14 aoide2 systemd[1]: Stopped es9018k2m.service - ES9018K2M DAC WebSocket Controller.
Jan 04 18:44:14 aoide2 systemd[1]: Started es9018k2m.service - ES9018K2M DAC WebSocket Controller.
Jan 04 18:44:14 aoide2 python[13865]: Traceback (most recent call last):
Jan 04 18:44:14 aoide2 python[13865]: File “/volumio/app/plugins/system_controller/i2s_dacs/scripts/ES9018K2M_I2C_Volumio.py”, line 6, in
Jan 04 18:44:14 aoide2 python[13865]: import smbus2
Great, now lets check if you have all dependencies.
cd /volumio/app/plugins/system_controller/i2s_dacs/scripts
source venv/bin/activate
pip list
post here what you see
(venv) volumio@aoide2:/volumio/app/plugins/system_controller/i2s_dacs/scripts$ pip list
Package Version
certifi 2022.9.24
chardet 5.1.0
charset-normalizer 3.0.1
dbus-fast 1.84.2
dbus-python 1.3.2
dnspython 2.3.0
idna 3.3
ntpsec 1.2.2
pip 23.0.1
pycryptodomex 3.11.0
PyGObject 3.42.2
requests 2.28.1
RPi.GPIO 0.7.1
setuptools 66.1.1
six 1.16.0
smbus2 0.6.0
urllib3 1.26.12
websocket-client 1.9.0
wheel 0.38.4
All seems fine, lets check log file:
cd /volumio/app/plugins/system_controller/i2s_dacs/scripts
nano es9018k2m_ws.log
scroll to bottom if its a lot of info here to see the latest logs
p.s. dont forget to deactivate venv: deactivate
No I didn’t try.
I just try to avoid the use of venv whenever possible,
If there is a python package available, that can avoid pip…
There is no file “es9018k2m_ws.log”
volumio@aoide2:/volumio/app/plugins/system_controller/i2s_dacs/scripts$ ls
ES9018K2M_I2C_Volumio.py aistereo-unmute.sh bassfly-init.sh bassmantis-init.sh bassowl-init.sh iqamp-unmute.sh venv volumio-zero-init.sh
volumio@aoide2:/volumio/app/plugins/system_controller/i2s_dacs/scripts$ nano es9018k2m_ws.log
GNU nano 7.2 es9018k2m_ws.log
[ New File ]
^G Help ^O Write Out ^W Where Is ^K Cut ^T Execute ^C Location M-U Undo M-A Set Mark M-] To Bracket M-Q Previous ^B Back
^X Exit ^R Read File ^\ Replace ^U Paste ^J Justify ^/ Go To Line M-E Redo M-6 Copy ^Q Where Was M-W Next ^F Forward
thank you anyway
what is the disadvantage of venv - if it’s easy to answer ?
Got it. Lets try manually run the script to see whats wrong:)
sudo systemctl stop es9018k2m.service
cd /volumio/app/plugins/system_controller/i2s_dacs/scripts
source venv/bin/activate
sudo /volumio/app/plugins/system_controller/i2s_dacs/scripts/venv/bin/python3 ES9018K2M_I2C_Volumio.py
lets see what it will say
volumio@aoide2:/volumio/app/plugins/system_controller/i2s_dacs/scripts$ sudo systemctl stop es9018k2m.service
volumio@aoide2:/volumio/app/plugins/system_controller/i2s_dacs/scripts$ cd /volumio/app/plugins/system_controller/i2s_dacs/scripts
volumio@aoide2:/volumio/app/plugins/system_controller/i2s_dacs/scripts$ source venv/bin/activate
(venv) volumio@aoide2:/volumio/app/plugins/system_controller/i2s_dacs/scripts$ sudo /volumio/app/plugins/system_controller/i2s_dacs/scripts/venv/bin/python3 ES9018K2M_I2C_Volumio.py
[sudo] password for volumio:
Traceback (most recent call last):
File “/volumio/app/plugins/system_controller/i2s_dacs/scripts/ES9018K2M_I2C_Volumio.py”, line 6, in
import smbus2
ModuleNotFoundError: No module named ‘smbus2’
Very basic,
- Python is marked as externally managed, which means pip is blocked.
- Pip doesn’t receive any security updates through APT, Python does
- APT ensures all dependencies are resolved, pip can override or downgrade libraries that system utilities depend on, causing breakage (bypass using venv)
So using Python packages covers above, no need to setup venv and/or call script through this venv.
In Buster PIP was just easy, with bookworm not really needed.
thank you, that’s plausible
anyway
sudo apt-get install python3-websocket python3-smbus2
didn’t do the trick
Strange, not sure whats wrong.
Probably try without sudo:
cd /volumio/app/plugins/system_controller/i2s_dacs/scripts
source venv/bin/activate
/volumio/app/plugins/system_controller/i2s_dacs/scripts/venv/bin/python3 ES9018K2M_I2C_Volumio.py
if error is the same, try to install this packages with --break-system-packages, outside of venv and check script again
sudo pip3 install smbus2 websocket-client --break-system-packages
volumio@aoide2:/volumio/app/plugins/system_controller/i2s_dacs/scripts$ source venv/bin/activate
(venv) volumio@aoide2:/volumio/app/plugins/system_controller/i2s_dacs/scripts$ /volumio/app/plugins/system_controller/i2s_dacs/scripts/venv/bin/python3 ES9018K2M_I2C_Volumio.py
Traceback (most recent call last):
File “/volumio/app/plugins/system_controller/i2s_dacs/scripts/ES9018K2M_I2C_Volumio.py”, line 6, in
import smbus2
ModuleNotFoundError: No module named ‘smbus2’
(venv) volumio@aoide2:/volumio/app/plugins/system_controller/i2s_dacs/scripts$ sudo pip3 install smbus2 websocket-client --break-system-packages
Looking in indexes: Simple index, piwheels - Simple index
Requirement already satisfied: smbus2 in /usr/local/lib/python3.11/dist-packages (0.6.0)
Requirement already satisfied: websocket-client in /usr/local/lib/python3.11/dist-packages (1.9.0)
WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: 12. Virtual Environments and Packages — Python 3.14.2 documentation
(venv) volumio@aoide2:/volumio/app/plugins/system_controller/i2s_dacs/scripts$ /volumio/app/plugins/system_controller/i2s_dacs/scripts/venv/bin/python3 ES9018K2M_I2C_Volumio.py
Traceback (most recent call last):
File “/volumio/app/plugins/system_controller/i2s_dacs/scripts/ES9018K2M_I2C_Volumio.py”, line 6, in
import smbus2
ModuleNotFoundError: No module named ‘smbus2’
(venv) volumio@aoide2:/volumio/app/plugins/system_controller/i2s_dacs/scripts$ deactivate
volumio@aoide2:/volumio/app/plugins/system_controller/i2s_dacs/scripts$ /volumio/app/plugins/system_controller/i2s_dacs/scripts/venv/bin/python3 ES9018K2M_I2C_Volumio.py
Traceback (most recent call last):
File “/volumio/app/plugins/system_controller/i2s_dacs/scripts/ES9018K2M_I2C_Volumio.py”, line 6, in
import smbus2
ModuleNotFoundError: No module named ‘smbus2’
i already tried " --break-system-packages" - that’s why i fear i already broke system files
WARNING: Running pip as the ‘root’ user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: 12. Virtual Environments and Packages — Python 3.14.2 documentation
wait wait
you need to deactivate venv before trying to install with break-system-packages
so in your case if you see (venv) volumio@aoide2:…:
deactivate
then
sudo pip3 install smbus2 websocket-client --break-system-packages
cd /volumio/app/plugins/system_controller/i2s_dacs/scripts
source venv/bin/activate
/volumio/app/plugins/system_controller/i2s_dacs/scripts/venv/bin/python3 ES9018K2M_I2C_Volumio.py
You dont break anything, dont worry ![]()