spapadim / argon1

Rewrite of Argon One case fan and button support
MIT License
82 stars 16 forks source link

FileNotFoundError: [Errno 2] No such file or directory for smbus.SMBus(_SMBUS_DEV) #7

Open ptalbert opened 4 years ago

ptalbert commented 4 years ago

Great program, thank you!

I was getting this error when starting the argonone service:

Sep 21 12:37:40 raspberrypi argonone[9701]: INFO: Loading config file from /etc/argonone.yaml
Sep 21 12:37:40 raspberrypi argonone[9701]: Traceback (most recent call last):
Sep 21 12:37:40 raspberrypi argonone[9701]:   File "/usr/bin/argononed", line 11, in <module>
Sep 21 12:37:40 raspberrypi argonone[9701]:     load_entry_point('argon1==0.1', 'console_scripts', 'argononed')()
Sep 21 12:37:40 raspberrypi argonone[9701]:   File "/usr/lib/python3/dist-packages/argonone/cmdline.py", line 175, in argondaemon_main
Sep 21 12:37:40 raspberrypi argonone[9701]:     daemon = ArgonDaemon()
Sep 21 12:37:40 raspberrypi argonone[9701]:   File "/usr/lib/python3/dist-packages/argonone/__init__.py", line 541, in __init__
Sep 21 12:37:40 raspberrypi argonone[9701]:     self._argon_board = ArgonOneBoard(initial_speed=0, bus_mutex=Lock())
Sep 21 12:37:40 raspberrypi argonone[9701]:   File "/usr/lib/python3/dist-packages/argonone/__init__.py", line 78, in __init__
Sep 21 12:37:40 raspberrypi argonone[9701]:     self._bus = smbus.SMBus(_SMBUS_DEV)
Sep 21 12:37:40 raspberrypi argonone[9701]: FileNotFoundError: [Errno 2] No such file or directory

The smbus python module gave this error because the i2c kernel modules were not loaded. The raspi-config program offers a nice way to have them automatically loaded and then the service runs without issue.

I don't know if it is appropriate for the deb package installation to take care of this but otherwise maybe the README could mention it.

spapadim commented 4 years ago

Thanks, glad you find useful. Yes, .DEB (but not setup.py, I believe its not meant for that) creates special user for daemon and adds it to i2c group, so under "normal" use this should not happen. But it does not hurt to check..

On Mon, Sep 21, 2020, 7:05 AM ptalbert notifications@github.com wrote:

Great program, thank you!

I was getting this error when starting the argonone service:

Sep 21 12:37:40 raspberrypi argonone[9701]: INFO: Loading config file from /etc/argonone.yaml Sep 21 12:37:40 raspberrypi argonone[9701]: Traceback (most recent call last): Sep 21 12:37:40 raspberrypi argonone[9701]: File "/usr/bin/argononed", line 11, in Sep 21 12:37:40 raspberrypi argonone[9701]: load_entry_point('argon1==0.1', 'console_scripts', 'argononed')() Sep 21 12:37:40 raspberrypi argonone[9701]: File "/usr/lib/python3/dist-packages/argonone/cmdline.py", line 175, in argondaemon_main Sep 21 12:37:40 raspberrypi argonone[9701]: daemon = ArgonDaemon() Sep 21 12:37:40 raspberrypi argonone[9701]: File "/usr/lib/python3/dist-packages/argonone/init.py", line 541, in init Sep 21 12:37:40 raspberrypi argonone[9701]: self._argon_board = ArgonOneBoard(initial_speed=0, bus_mutex=Lock()) Sep 21 12:37:40 raspberrypi argonone[9701]: File "/usr/lib/python3/dist-packages/argonone/init.py", line 78, in init Sep 21 12:37:40 raspberrypi argonone[9701]: self._bus = smbus.SMBus(_SMBUS_DEV) Sep 21 12:37:40 raspberrypi argonone[9701]: FileNotFoundError: [Errno 2] No such file or directory

The smbus python module gave this error because the i2c kernel modules were not loaded. The raspi-config program offers a nice way to have them automatically loaded and then the service runs without issue.

I don't know if it is appropriate for the deb package installation to take care of this but otherwise maybe the README could mention it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/spapadim/argon1/issues/7, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABBFUGYWA7EP33OEDLG7Z53SG4XODANCNFSM4RUMTTPQ .