I2c and argonone case issues

Is it fine ? How did you get it ? (deb package via alien?)

I have not tried it, but it looks interesting. I am hoping it gets added to the repo. I am not so great with pkgbuilds. Hoping someone who is much better comes along and makes one. :wink:

I have built some packages today and I have no clue if it will work with out having a argonone case.

The package argon1 installed here and when I tried to enable argonone.service It could not import python-smbus module so I had to go to aur and build smbus-git but it required i2c-tools-git so I had to build it also from aur. Now I am down to it not importing ā€œimport RPi.GPIO as GPIOā€. I know you have built that from git and I have other rat killing I have to do today. So try what I have so far.

I did not messed with the applet part yet but it looks like it is made for lxde and may not work universally for all DE environments as is.

Install the 3 packages in the tarball and add your self to the argonone group then enable argonone.service then reboot.

https://drive.google.com/file/d/1dFiLtOHjkXCqJQpJEbzJy1s7iYb7uezE/view?usp=sharing

1 Like

Wow, thank you very much for giving this a try.

$ /usr/bin/argononed
Traceback (most recent call last):
  File "/usr/bin/argononed", line 33, in <module>
    sys.exit(load_entry_point('argon1==0.1', 'console_scripts', 'argononed')())
  File "/usr/bin/argononed", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/argonone/__init__.py", line 9, in <module>
    import RPi.GPIO as GPIO
ModuleNotFoundError: No module named 'RPi'

Edit: Ah, but this image does not have the new GPIO. I will switch to the correct image and try again.

That is what I get here also. I thought you had python-raspberry-gpio installed you built.

pip can install RPi.GPIO also.

On my image with the latest RPi.GPIO

$ /usr/bin/argononed
Traceback (most recent call last):
  File "/usr/bin/argononed", line 33, in <module>
    sys.exit(load_entry_point('argon1==0.1', 'console_scripts', 'argononed')())
  File "/usr/bin/argononed", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/argonone/__init__.py", line 17, in <module>
    import yaml
ModuleNotFoundError: No module named 'yaml'

I installed python-yaml-5.3.1-4 and tried it again, this time:

$ /usr/bin/argononed
INFO: Loading config file from /etc/argonone.yaml
/usr/lib/python3.9/site-packages/argonone/__init__.py:529: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  config = yaml.load(fp)
Traceback (most recent call last):
  File "/usr/bin/argononed", line 33, in <module>
    sys.exit(load_entry_point('argon1==0.1', 'console_scripts', 'argononed')())
  File "/usr/lib/python3.9/site-packages/argonone/cmdline.py", line 175, in argondaemon_main
    daemon = ArgonDaemon()
  File "/usr/lib/python3.9/site-packages/argonone/__init__.py", line 541, in __init__
    self._argon_board = ArgonOneBoard(initial_speed=0, bus_mutex=Lock())
  File "/usr/lib/python3.9/site-packages/argonone/__init__.py", line 78, in __init__
    self._bus = smbus.SMBus(_SMBUS_DEV)
PermissionError: [Errno 13] Permission denied
Exception ignored in: <function ArgonOneBoard.__del__ at 0xffffac00d0d0>
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/argonone/__init__.py", line 154, in __del__
    self.close()
  File "/usr/lib/python3.9/site-packages/argonone/__init__.py", line 151, in close
    self._bus.close()
AttributeError: 'ArgonOneBoard' object has no attribute '_bus'

So I see a permission error, what the heckā€¦
$ sudo /usr/bin/argononed

INFO: Loading config file from /etc/argonone.yaml
/usr/lib/python3.9/site-packages/argonone/__init__.py:529: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  config = yaml.load(fp)
INFO: Daemon starting
INFO: D-Bus server initialization
INFO: Power button monitoring and control thread starting
INFO: DBG: calling .wait_for_button
INFO: Fan control and temperature monitoring thread starting
INFO: D-Bus server thread starting
INFO: DBG: button_press = None
INFO: DBG: calling .wait_for_button
INFO: DBG: button_press = None
INFO: DBG: calling .wait_for_button
INFO: DBG: button_press = None
INFO: DBG: calling .wait_for_button
INFO: DBG: button_press = None

The software appears to be happy now. I will try messing with it to see if the fan functions.

This software does seem to work, if the service is started as root. As user argonone, as defined in the service file, the above permission error. I am not sure what group grants the required permission.

I modified the argonone.service file to run as user and group of rootā€¦ it runs and seems to function.

With my user account:

$ argonctl speed

40

$ argonctl temp

41.381

Great!

So making the change in the service file was the only change you made?

After compiling the argon1 git the files needed were in different places so I dissected his armv7 .deb file to see were all of the files were placed to make the PKGBUILD. All of the groups, argonoe user and permissions were set in the .debā€™s posinst which I converted to archā€™s .install format. So I am at a loss why the permission error unless it is in the difference with a debā€™s install process as opposed to archā€™s.

Is it any better than the package you were using?

No other change, other than needing to install python-yaml, probably should be a dependency.
Package does conflict with argoneone-git, both install /usr/bin/argononed

I like it, but more time to mess with it. Like adding queries to my conky script. The basic use is much nicer, with the argonctl command.

Is there a option to disable INFO?

argonone[2619]: INFO: DBG: button_press = None
argonone[2619]: INFO: DBG: calling .wait_for_button
argonone[2619]: INFO: Adjusting fan speed to 40 for temperature 40.407

journalctl gets too many info messages like these.

The code has been modified with this commit aimed directly where the error occurs with the user argonone. It would seem the issue could be related to the i2c group.

I manually applied the patch:

WARNING: i2c device not accessible. Ensure user is a member of the i2c group

I wonder if /dev/i2c-1 is owned by root:i2c on debian?

And I noticed there is a hardcoded path to /usr/bin/vcgencmd which does not exist for me, I have it in /opt/vc/bin/

Edit: I found this, so it might be that is a permission error for the device.

I created a udev rule so the /dev/i2c-1 device is created with i2c as the group and 0666 permissions. My account can now successfully run

$ i2cdetect -F 1

I think this is a step forward.

Now when I try to start the daemon as user argonone, it still fails, but now in a new location:

argonone[1451]: INFO: Loading config file from /etc/argonone.yaml
argonone[1451]: /usr/lib/python3.9/site-packages/argonone/__init__.py:537: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as>
argonone[1451]:   config = yaml.load(fp)
argonone[1451]: Traceback (most recent call last):
argonone[1451]:   File "/usr/bin/argononed", line 33, in <module>
argonone[1451]:     sys.exit(load_entry_point('argon1==0.1', 'console_scripts', 'argononed')())
argonone[1451]:   File "/usr/lib/python3.9/site-packages/argonone/cmdline.py", line 175, in argondaemon_main
argonone[1451]:     daemon = ArgonDaemon()
argonone[1451]:   File "/usr/lib/python3.9/site-packages/argonone/__init__.py", line 549, in __init__
argonone[1451]:     self._argon_board = ArgonOneBoard(initial_speed=0, bus_mutex=Lock())
argonone[1451]:   File "/usr/lib/python3.9/site-packages/argonone/__init__.py", line 94, in __init__
argonone[1451]:     GPIO.setup(_SHUTDOWN_BCM_PIN, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
argonone[1451]: RuntimeError: Not running on a RPi!

Hmm, interesting error. :slight_smile:
But now it is a gpio related issueā€¦ so now I bet I need to figure out what group gpio does on debian.
There are /dev/gpio* devices, could be a similar issue.

Edit: Yes, exactly the same issue. I created a udev rule for /dev/gpiomem so that it is owned by root:gpio and 0666 permissions. And now the daemon mostly runs as the user argonone.

$ systemctl status argonone

ā— argonone.service - Fan and power control for ArgonOne case
     Loaded: loaded (/usr/lib/systemd/system/argonone.service; enabled; vendor preset: disabled)
     Active: active (running) since Sun 2021-02-21 21:04:46 CST; 1s ago
   Main PID: 1333 (argononed)
      Tasks: 3 (limit: 9064)
     CGroup: /system.slice/argonone.service
             ā””ā”€1333 /usr/bin/python /usr/bin/argononed

argonone[1333]: INFO: Adjusting fan speed to 70 for temperature 44.303
argonone[1333]: Traceback (most recent call last):
argonone[1333]:   File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
argonone[1333]: INFO: D-Bus server thread starting
argonone[1333]:     self.run()
argonone[1333]:   File "/usr/lib/python3.9/site-packages/argonone/__init__.py", line 290, in run
argonone[1333]:     button_press = self._argon_board.wait_for_button()
argonone[1333]:   File "/usr/lib/python3.9/site-packages/argonone/__init__.py", line 144, in wait_for_button
argonone[1333]:     if GPIO.wait_for_edge(_SHUTDOWN_BCM_PIN, GPIO.RISING, timeout=timeout) is None:
argonone[1333]: RuntimeError: Error waiting for edge

An issue with the power button to be resolved.

I found in another place that python-dbus is required also. Do you have it installed?

I will have to wait until I get home this evening to check into this.

Yes, I have python-dbus installed.

This error is beyond me, or at least beyond where I care to go.

INFO: D-Bus server thread starting
Exception in thread Thread-2:
Traceback (most recent call last):
  File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.9/site-packages/argonone/__init__.py", line 290, in run
    button_press = self._argon_board.wait_for_button()
  File "/usr/lib/python3.9/site-packages/argonone/__init__.py", line 144, in wait_for_button
    if GPIO.wait_for_edge(_SHUTDOWN_BCM_PIN, GPIO.RISING, timeout=timeout) is None:
RuntimeError: Error waiting for edge

The software does seem to work properly, if run as root. Personally, I do not care if root runs the process or not, so the addition of a user, groups, and udev rules are not ā€œplusesā€ for me. Adding more -git packages is less than ideal too.

I do like the interface and it seems to work. I do wish the code had more error checking. It spouts a ton of error messages if you attempt a query and the daemon is not running. And not one of the messages says anything about the non-existent daemon, all python junk about failed calls.

The bottom line is, both software packages get the job done.

Iā€™m a little concerned that it has been 8 months since this guy has done any work on it. Also I compiled the lxde code today and it looks strictly to be a lxpanel item only. All I saw produced was a module and had to install lxpanel to compile. No stand alone bin.

In considering this further, I would say pass on this package. I appreciate your effort in putting the package together. It looks nice from the outside, and if I was running Pi OS, I would use it. Just not a great fit on Manjaro.

I noticed there is a new package in the AUR, argonone-c-git.
I have it installed and it is much more to my personal taste.

It adds a DT file and you can configure it like this:

dtoverlay=argonone,fantemp0=35,fanspeed0=33,fantemp1=40,fanspeed1=66,fantemp2=45,fanspeed2=100,hysteresis=3
(see below)

And you can check the settings:

$ sudo argonone-cli -d

>> DECODEING MEMORY <<
Fan Status ON Speed 66%
System Temperature 43Ā°
Hysteresis set to 3Ā°
Fan Speeds set to 33% 66% 100%
Fan Temps set to 35Ā° 40Ā° 65Ā°
Fan Mode [ AUTO ] 
Fan Speed Override 0% 
Target Temperature 0Ā°

Edit: Hmm, I just noticed the 3rd Fan Temp is set at 65, it should be 45. So not perfect, yet.

Edit 2: Opened this ticket.

Edit 3: Not a bug, my configuration line exceeded the 80 character limit.

The correct way to configure:

dtoverlay=argonone
dtparam=fantemp0=35
dtparam=fanspeed0=33
dtparam=fantemp1=40
dtparam=fanspeed1=66
dtparam=fantemp2=45
dtparam=fanspeed2=100
dtparam=hysteresis=2
1 Like