Giter Club home page Giter Club logo

argon1's People

Contributors

spapadim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

argon1's Issues

Post-install fails (on minimal Debian Buster) when gpio-group is missing

Using the current image from https://raspi.debian.net/, install of argon1_0.2.1_all.deb fails:

Setting /usr/bin/argonone-shutdown to suid argonone
Adding user argonone to gpio and i2c groups
usermod: group 'gpio' does not exist
dpkg: error processing package argon1 (--install):
installed argon1 package post-installation script subprocess returned error exit status 6

After adding gpio goup (i2c was there), post-install is happy.

P.S. Putting this in a Debian package is the right thing to do. Thank you!

xfce4-panel

Can you make a xfce4-panel compatible version?
or am I just being stupid.

Either way, I can't find it in the add/remove items, no matter how many times I log out.

.deb file

I cannot find this .deb file described in the first step of installation

Turn off pypy3compile in postinst script for .DEB

PyPy3 does not seem to like type annotations in assignments (although it's ok with function/method annotations). As a result, if pypy3 is installed on the system, /usr/bin/pypy3compile is invoked, which spits out the following error during .DEB installation:

Failed to byte-compile /usr/lib/python3/dist-packages/argonone/__init__.py:   
File "/usr/lib/python3/dist-packages/argonone/__init__.py", line 103
    thresholds: List[float] = []
              ^
SyntaxError: invalid syntax

The installed package still works, of course, but the message is rather annoying.

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

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.

FAN is not turned on for V2 case (normal HDMI)

Edited to be more explicit.
in /lib/python3/dist-packages/argonone/init.py the method _bus_write needs to be modified like this:

From:

   def _bus_write(self, value: int, register: int = _SMBUS_REGISTER):
     # Could raise IOError, according to "official" scripts
     self._bus.write_byte_data(_SMBUS_ADDRESS, register, int(value))

To:

   def _bus_write(self, value: int, register: int = _SMBUS_REGISTER):
     # Could raise IOError, according to "official" scripts
     self._bus.write_byte_data(_SMBUS_ADDRESS, int(value), register)

Not exactly sure why this is reversed, but it only works like this in my case...
Command guide for argonone case: https://github.com/Argon40Tech/Argon-ONE-i2c-Codes

The initial version is sending the value 0x00 (register value which is 0xd3 in my case but it seems to be irrelevant) which turns off the fan being 0%.

The I2C command for argon case is
i2cset -y _SMBUS_DEV _SMBUS_ADDRESS value
i2cset -y 1 0x1a 0x00
i2cset -y 1 0x1a 0x0A
i2cset -y 1 0x1a 0x32
...
i2cset -y 1 0x1a 0x64

Where 0x00, 0x0A, 0x32 ... 0x64 are the hexadecimal values for the fan speed percentage: 0%, 10%, ... 100%

You can send this command from terminal and check for FAN activation (it can be heard even at low revolutions).

Are you sure the initial version spins the fan? Maybe they changed the call for V2 case?
The display part is working without problems, IO errors not returned, but fan does not turn at all

Temperature not displayed in LXPanel Plugin

The readme says you can configure the LXPanel Plugin to display temperature as well as percentage. Currently it is only displaying percentage. I can find no way to configure it to display temperature. I tried right-click and left-click.

The argonctl temp command seems to be working. It outputs a temperature that corresponds to the fan % displayed by the plugin. It is just not displaying it next to the icon on the task bar.

Is this a future enhancement or should the readme be explaining how to configure display of the temperature?

Thanks for the great plugin by the way! Nice one.

*.deb files will not install

I am trying to install the two *.deb files but am getting errors. For example, the argon1 errors are:

openhab@openHAB-4:~/argon1$ sudo apt install ./argon1_0.2.1_all.deb
Reading package lists... Error!
E: Sub-process Popen returned an error code (2)
E: Encountered a section with no Package: header
E: Problem with MergeList /home/openhab/argon1/argon1_0.2.1_all.deb
E: The package lists or status file could not be parsed or opened.

Similar errors occur when using dpkg. Am I doing something wrong, or ...?

Fix power button handling

What can I say, I rarely turn off my Pis, so this wasn't tested (pressed button once, turned off, end of story, basically).

It seems the "protocol" (if one can call it that) for this is a bit funny. First, board will kill power anyway, even if there is no software running (presumably so customers that didn't install script won't complain, at cost of causing hard crash which usually doesn't lead to data loss or corruption). Second, it seems that a "set fan speed to zero" (over I2C) serves as an "ACK" of the button press (the press itself is signalled via a GPIO pulse, with it's duration encoding type of press). If an "ACK" is received by the board, then it won't kill power, unless a "set fan speed to 255" (note invalid speed value) is sent to explicitly request power-off?

That's my best guess so far, but still need to verify the "protocol". This is complicated a bit by the fact that, if I mis-guess what the board does/expects, then the hard-crash that the board causes will often lead to lost log messages (so I often have to guess blindly.. argh!).

While at it, might refactor hardware protocol class a bit.

AttributeError: 'ArgonOneBoard' object has no attribute '_bus' (I2C interfaces are not automatically enabled)

The packages requires I2C interfaces on RPi to be enabled, but it doesn't do it itself. Instead, user has to enable them manually in raspi-config. If this is not done, argononed crashes with the following message:

Sep 16 00:01:15 Kerensky argonone[1523]: INFO: Loading config file from /etc/argonone.yaml
Sep 16 00:01:15 Kerensky argonone[1523]: /usr/lib/python3/dist-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.
Sep 16 00:01:15 Kerensky argonone[1523]: config = yaml.load(fp)
Sep 16 00:01:15 Kerensky argonone[1523]: Traceback (most recent call last):
Sep 16 00:01:15 Kerensky argonone[1523]: File "/usr/bin/argononed", line 11, in
Sep 16 00:01:15 Kerensky argonone[1523]: load_entry_point('argon1==0.1', 'console_scripts', 'argononed')()
Sep 16 00:01:15 Kerensky argonone[1523]: File "/usr/lib/python3/dist-packages/argonone/cmdline.py", line 175, in argondaemon_main
Sep 16 00:01:15 Kerensky argonone[1523]: daemon = ArgonDaemon()
Sep 16 00:01:15 Kerensky argonone[1523]: File "/usr/lib/python3/dist-packages/argonone/init.py", line 541, in init
Sep 16 00:01:15 Kerensky argonone[1523]: self._argon_board = ArgonOneBoard(initial_speed=0, bus_mutex=Lock())
Sep 16 00:01:15 Kerensky argonone[1523]: File "/usr/lib/python3/dist-packages/argonone/init.py", line 78, in init
Sep 16 00:01:15 Kerensky argonone[1523]: self._bus = smbus.SMBus(_SMBUS_DEV)
Sep 16 00:01:15 Kerensky argonone[1523]: FileNotFoundError: [Errno 2] No such file or directory
Sep 16 00:01:15 Kerensky argonone[1523]: Exception ignored in: <function ArgonOneBoard.del at 0xb56dad18>
Sep 16 00:01:15 Kerensky argonone[1523]: Traceback (most recent call last):
Sep 16 00:01:15 Kerensky argonone[1523]: File "/usr/lib/python3/dist-packages/argonone/init.py", line 154, in del
Sep 16 00:01:15 Kerensky argonone[1523]: self.close()
Sep 16 00:01:15 Kerensky argonone[1523]: File "/usr/lib/python3/dist-packages/argonone/init.py", line 151, in close
Sep 16 00:01:15 Kerensky argonone[1523]: self._bus.close()
Sep 16 00:01:15 Kerensky argonone[1523]: AttributeError: 'ArgonOneBoard' object has no attribute '_bus'

Argon one fan control installation on DietPi V7.4.2 with solution

Here are the steps I took to get the argon1_0.2.1_all.deb package working on DietPi V7.4.2.
All steps are done with the user dietpi
sudo adduser pi Add user "pi". During the process, the password for the user "pi" is set
mkdir download Create the directory "download" in the home directory of the user dietpi
Put the file "argon1_0.2.1_all.deb" on a USB stick formatted with FAT32 and plug it into the Rapberry Pi.
sudo dietpi-drive_manager Mount the USB stick with the drive manager in a directory (for example -> /mnt/USB-stick).
USB-Stick ist mounted:
USB-Stick
sudo dietpi-software -> Browse Software -> select file manager "mc" (package no. 3) -> install.
sudo mc Start the file manager
Use "mc" to copy the argon1_0.2.1_all.deb file from the USB stick to the "download" directory.
/mnt/USB-Stick/ -> /home/dietpi/download/
Leave "mc"
Install the following packages
sudo apt-get install --reinstall python3-pkg-resources
sudo apt install python3-gi python3-gi-cairo gir1.2-gtk-3.0
cd download Change to the "download" folder
sudo apt install ./argon1_0.2.1_all.deb The fan control is installed
sudo mc Mark the file /lib/python3/dist-packages/argonone/init.py -> Edit -> Select editor "nano".
The following entry must be changed in the file so that the fan also starts when the temperature is reached:

Old:
def _bus_write(self, value: int, register: int = _SMBUS_REGISTER):
# Could raise IOError, according to "official" scripts
self._bus.write_byte_data(_SMBUS_ADDRESS, register, int(value))
New:
def _bus_write(self, value: int, register: int = _SMBUS_REGISTER):
# Could raise IOError, according to "official" scripts
self._bus.write_byte_data(_SMBUS_ADDRESS, int(value), register) <-----

Ctrl & o -> Enter -> Ctrl & x Save the file under the same name and exit the editor
Leave "mc"
sudo adduser dietpi argonone
sudo reboot
sudo cat /etc/group
• i2c has entered the user "argonone"
• gpio has entered the user "argonone"
• argonone has entered the user "pi" & "dietpi"
All of the following commands should now work without an error message
argonctl speed
argonctl temp
argonctl pause
argonctl set_speed 50
argonctl resume
speed
sudo systemctl status argonone looks like this now
dämon2

I wish you success

lxpanel app

An LXDE panel app would have been nice, but is non-trivial because:

  • XML-RPC and/or it's Python implementation don't seem to support callbacks, and resorting to double-polling is ridiculous
  • There are no Python bindings for lxpanel

It seems best path is to replace XML-RPC with D-BUS first, and then write lxpanel app.

Fooling around with D-BUS and with multi-package DEBs could be interesting, but going back to C.. not so much. So, this is unlikely to happen, but noting in case I'm looking for another "distraction" in the future (or anyone wants to fork and give a stab?)

Argon One fan control installation on Ubuntu v21.04 with solution

Here are the steps I took to get the .deb package to work on ubuntu V21.04.
sudo apt update
sudo apt upgrade
User "pi" will be created
sudo adduser pi
The group "gpio" will be created
sudo addgroup gpio
The package for gpio will be installed
sudo apt install python3-lgpio
Save the file "argon1_0.2.1_all.deb" from the github page https://github.com/spapadim/argon1 in the directory "Downloads" on the raspberry pi. Change to the "Downloads" directory.
cd Downloads
Confirm the queries with Yes and OK
sudo apt install ./argon1_0.2.1_all.deb
sudo apt install rpi.gpio-common -> Has already been up to date with me
Add users to the "dialout" group
sudo adduser {USER} dialout -> {USER} = current user
sudo adduser argonone dialout
sudo adduser pi dialout
cd /lib/python3/dist-packages/argonone/
sudo nano __init__.py Open file with editor
Important!! Make the change according to Post # 14 and save the file under the same name.
reboot
After the restart, enter the following command to check
sudo systemctl status argonone -> quit with q
There should be a green dot in the output and no error message
Dämon
With that the demon runs!
The function can now be tested with the argonctl {xyz} commands, see original description.
Have fun testing.

dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'net.clusterhack.ArgonOne': no such name

Hey thanks for creating this, I just got it installed on ubuntu 20.04 but getting the following when i try to use it:

jimmyff@spritz:~$ argonctl speed
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 177, in activate_name_owner
    return self.get_name_owner(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 361, in get_name_owner
    return self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'net.clusterhack.ArgonOne': no such name

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/argonctl", line 11, in <module>
    load_entry_point('argon1==0.1', 'console_scripts', 'argonctl')()
  File "/usr/lib/python3/dist-packages/argonone/cmdline.py", line 150, in argonctl_main
    with dbus_proxy() as dbus:
  File "/usr/lib/python3.8/contextlib.py", line 113, in __enter__
    return next(self.gen)
  File "/usr/lib/python3/dist-packages/argonone/__init__.py", line 627, in dbus_proxy
    proxy = system_bus.get_object('net.clusterhack.ArgonOne',
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 241, in get_object
    return self.ProxyObjectClass(self, bus_name, object_path,
  File "/usr/lib/python3/dist-packages/dbus/proxies.py", line 250, in __init__
    self._named_service = conn.activate_name_owner(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 182, in activate_name_owner
    self.start_service_by_name(bus_name)
  File "/usr/lib/python3/dist-packages/dbus/bus.py", line 277, in start_service_by_name
    return (True, self.call_blocking(BUS_DAEMON_NAME, BUS_DAEMON_PATH,
  File "/usr/lib/python3/dist-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name net.clusterhack.ArgonOne was not provided by any .service files

Using the .deb package on Ubuntu

Should the debian package work properly on Ubuntu 20.04?
If yes, will it work on both 32 bit and 64 bit?
Update:
I got the same error as here #4

argon1:armhf not installable on 64 bit Bookworm

Hi. Any chance of fixing the lxplug installer? It fails on 64-bit Bookworm.

It worked fine on my 32-bit Buster, but now I done a clean install of 64-bit Bookworm, I get this error:
sudo apt install ./lxplug-argon1_0.2.1_armhf.deb

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'lxplug-argon1:armhf' instead of './lxplug-argon1_0.2.1_armhf.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
lxplug-argon1:armhf : Depends: lxpanel:armhf but it is not going to be installed
Depends: argon1:armhf (>= 0.2) but it is not installable
E: Unable to correct problems, you have held broken packages.

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.