DarkElvenAngel
Posts: 1750
Joined: Tue Mar 20, 2018 9:53 pm

Re: Argon One Replacement Daemon

Tue Jun 08, 2021 5:01 pm

EctoOne wrote: Thanks for explaining the config.txt options, I never really understood what the uart thing is supposed to be (and I still don't know) but it is good to know that I personally don't need it. Since I don't use the power button at all.
So the UART is used by the Argon One as a power on signal GPIO 14 (UART TX) will be high as long as the pi is on and drop low when it's off. This was used in the past to see if the pi was running or in it's shutdown state. It's something I've seen used with power buttons. With the UART active you don't get the 10 count on the green LED to tell you shutdown it simply shuts off and without it it will shutdown after about 10 seconds.

EctoOne
Posts: 8
Joined: Wed Jan 06, 2021 8:01 pm

Re: Argon One Replacement Daemon

Tue Jun 08, 2021 5:37 pm

DarkElvenAngel wrote:
Tue Jun 08, 2021 5:01 pm
EctoOne wrote: Thanks for explaining the config.txt options, I never really understood what the uart thing is supposed to be (and I still don't know) but it is good to know that I personally don't need it. Since I don't use the power button at all.
So the UART is used by the Argon One as a power on signal GPIO 14 (UART TX) will be high as long as the pi is on and drop low when it's off. This was used in the past to see if the pi was running or in it's shutdown state. It's something I've seen used with power buttons. With the UART active you don't get the 10 count on the green LED to tell you shutdown it simply shuts off and without it it will shutdown after about 10 seconds.
Thanks again for the explanation. I only understand half of it but yeah... :D

I never really tinkered with my Pis which is why I don't really know much about all the tech stuff. One Pi 3 is just running OSMC as media player 24/7, so no need for a power button. And my Pi 4 in the the Argon case is running mostly headless which I access via xrdp from my tablet. And I always shut it down when I'm done working on it.
And both of them are plugged into a remote controlled power socket. So I can fully power them off and they boot up when I power them. That is why I was happy to get one of the newer Argon models with the jumper to activate the always power on thing. I know this was possible before but from what I've seen not on all models. If this wasn't a thing, the case would almost be worthless to me. In fact I'm trying to figure out if the Argon Nanosound ONE case has this feature, because then I would probably get it to replace my Pi 3.

EctoOne
Posts: 8
Joined: Wed Jan 06, 2021 8:01 pm

Re: Argon One Replacement Daemon

Sat Jun 19, 2021 12:11 am

Would it be possible that the line INFO: Running under normal user some features may not work. would respect the silent/quiet option?

I'm currently working on a script and it is kinda annoying to see that line flooding my terminal while figuring out some stuff.

DarkElvenAngel
Posts: 1750
Joined: Tue Mar 20, 2018 9:53 pm

Re: Argon One Replacement Daemon

Sat Jun 19, 2021 1:36 am

EctoOne wrote:
Sat Jun 19, 2021 12:11 am
Would it be possible that the line INFO: Running under normal user some features may not work. would respect the silent/quiet option?

I'm currently working on a script and it is kinda annoying to see that line flooding my terminal while figuring out some stuff.
Yes it should already do that. I'll take a look... what version a do you have? The silent and quiet argument should be surpressing the message. At least in the newest version.

Okay there is a bug here the arguments aren't parsed at that point I will fix this.

Okay I've patched the bug it's not a perfect patch if the daemon isn't running then it will print to the console. You could force the stderr to /dev/null to get ride of that message should you need to. You'll need to pull the updates and check out 0.3.x then you can rebuild the cli with

Code: Select all

make cli
sudo make install-cli
This version will be moved to stable master in about a week this will depend on how the open issues pan out.

Hopefully this is helpful.

If you don't mind my asking what is your script for?

EctoOne
Posts: 8
Joined: Wed Jan 06, 2021 8:01 pm

Re: Argon One Replacement Daemon

Sat Jun 19, 2021 8:08 am

Awesome. Thanks for the quick fix.

I was messing around with yad and noticed that it can create a tray icon with a simple menu. So I was using your argonone-cli to try some stuff before I go into something more complex.

I'm not a pro a scripting but this is what I came up with so far:

Code: Select all

#!/bin/bash

MENU="Auto!argonone-cli -qa|\
Cooldown: To 50° at 50%!argonone-cli -qc 50 -f 50|\
Cooldown: To 60° at 100%!argonone-cli -qc 60 -f 100|\
Manual: 50%!argonone-cli -qm -f 50|\
Manual: 100%!argonone-cli -qm -f 100|\
Quit!quit!gtk-quit|"

### Check for dependencies
declare -i DEPCOUNT=0
for DEP in {yad,argonone-cli,notify-send}; do
	command -v "$DEP" &> /dev/null || { echo "ERROR: Dependency '$DEP' not met."; DEPCOUNT+=1; }
done
[ $DEPCOUNT -eq 0 ] || exit 1

### Left click action
function on_click() {
	notify-send -t 3000 -i indicator-sensors-fan "ArgonOne" "<i>Mode</i>:			<b>$( argonone-cli -qd | grep "Fan Mode" | cut -f4 -d " " )</b>\n<i>Temperature</i>:	<b>$( argonone-cli -qd | grep "System Temperature" | cut -f3 -d " " )</b>\n<i>Fan Speed</i>:		<b>$( argonone-cli -qd | grep "Fan Status" | cut -f5 -d " " )</b>"
}
export -f on_click

### Start YAD
yad --notification --menu="$MENU" --command="bash -c on_click" --text="ArgonOne" --image="indicator-sensors-fan"
It creates a tray icon, and a left click shows a notification with the current mode, temperature and fan speed. Right click opens a menu which has some quick settings.

DarkElvenAngel
Posts: 1750
Joined: Tue Mar 20, 2018 9:53 pm

Re: Argon One Replacement Daemon

Sat Jun 19, 2021 1:06 pm

That's very cool never used yad just looked it

For lxde used on Raspberry Pi OS there is a panel plug in I wrote but it only works for lxde. Does yad work on other desktop environments? Looks like it might.

The first version of the applet used argonone-cli but now I've got it using the shared memory directly. The applet was more of an afterthought when I saw someone else talking about one someone else was working on. I wanted something that I would want to use.

It's awesome that this project has inspired you to make something of your own too! Keep up the good work!

EctoOne
Posts: 8
Joined: Wed Jan 06, 2021 8:01 pm

Re: Argon One Replacement Daemon

Sat Jun 19, 2021 4:09 pm

I know about the applet, but I'm using Xfce4 as Desktop Environment, so I can't use it.

My script should work on other DEs, since yad is just a program to generate GTK interfaces for scripts. The only thing that might be an issue, is that this version probably needs a certain Icon set. I don't know if the indicator-sensors-fan is available in other icon sets. The other dependency is libnotify to show the notification I think. If that's not available, it still should at least show the menu to switch between modes.

And like I said, was more of a test. Since I wanted to try the tray option from yad and since the weather has become warmer, I thought why not use your tool to grab/set some info. I mean it probably won't really use it, since I already have another script which I use with the Xfce4 Generic Monitor applet that also reads the fan speed and displays it (among other things) in my Taskbar. But it still is a quick way to switch modes if I ever need to.

DarkElvenAngel
Posts: 1750
Joined: Tue Mar 20, 2018 9:53 pm

Re: Argon One Replacement Daemon

Sat Jun 26, 2021 5:45 pm

UPDATE:

I have just added experimental support for OpenWRT. So if you have OpenWRT and an Argon case or hat let me know if it works for you.

This OS is very different from others on the supported list it has a different install method. See the README

DarkElvenAngel
Posts: 1750
Joined: Tue Mar 20, 2018 9:53 pm

Re: Argon One Replacement Daemon

Tue Jul 06, 2021 1:12 am

UPDATE:
VERSION 0.3.2 is now out.
New in this version is the ability to disable the power button portion of the daemon, and use the sysfs for the temperature.
These are useful if you don't need the power button or your OS doesn't have the device support needed for the power button to function. Some distributions don't have the /dev/vcio so you need to use a different method of getting the CPU temperature sysfs normally has this and can be used as an alternative.

OpenWRT is now supported it requires some extra steps to get working but it's only a few commands.

What's Next
Alpine Linux support. I'm very near to getting this together. There are bugs in the current set-up.

DarkElvenAngel
Posts: 1750
Joined: Tue Mar 20, 2018 9:53 pm

Re: Argon One Replacement Daemon

Fri Jul 09, 2021 11:41 pm

UPDATE:
VERSION 0.3.3 is now in testing. With 0.3.3 a new feature is added at compile time you can change the daemon to run in the foreground this can be useful for advanced users. Limited support for Alpine Linux comes to the project.

Alpine Linux is a very simple distribution in terms of tools it uses as such it's not completely compatible with the ArgonOne cases. What this means is that the OS has no known means at this time to differentiate between a shutdown and reboot so the case will not be sent the power down signal and would require the long press of the power button to fully power it down after the pi has completed it's shutdown. There is a work around but it's far from perfect and could potentially break the system.

The daemon will run fine on this OS and both the fan and button work as expected. This means that the ARTIK hat is fully supported.

sbfreddie
Posts: 1
Joined: Wed Jul 14, 2021 2:46 pm

Re: Argon One Replacement Daemon

Wed Jul 14, 2021 2:54 pm

Hi:
I have installed both your pieces of your software on my RPI4B running Rasbian with Argon One case.
However when I set the fan settings (following your online instructions at Git) they do not persist after reboot or powering off than on again.
Any suggestion as to what I my have missed in the setup.

Thanks,
Ed

DarkElvenAngel
Posts: 1750
Joined: Tue Mar 20, 2018 9:53 pm

Re: Argon One Replacement Daemon

Thu Jul 15, 2021 1:04 pm

sbfreddie wrote:
Wed Jul 14, 2021 2:54 pm
Hi:
I have installed both your pieces of your software on my RPI4B running Rasbian with Argon One case.
However when I set the fan settings (following your online instructions at Git) they do not persist after reboot or powering off than on again.
Any suggestion as to what I my have missed in the setup.

Thanks,
Ed
Are you using the CLI tool to change your settings or in the config.txt?

Can you post the what you have done?

Return to “Advanced users”