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

Looking for Argon One case details

Sun May 31, 2020 3:21 am

Hello everyone,

I have an argon one case on order and I was looking for schematics or details about the fan and power button. I was looking at the scripts I see how things work but not what they are.

For example if you don't have the script installed does the power but do anything? Or is it just a button connected to the GPIO?

My other question is does anyone know what the fan controller is?

The reason I'm asking is I'd like to write my own software maybe something for the desktop.

Thanks

User avatar
B.Goode
Posts: 10583
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Looking for Argon One details

Sun May 31, 2020 7:24 am

DarkElvenAngel wrote:
Sun May 31, 2020 3:21 am
Hello everyone,

I have an argon one case on order and I was looking for schematics or details about the fan and power button. I was looking at the scripts I see how things work but not what they are.

For example if you don't have the script installed does the power but do anything? Or is it just a button connected to the GPIO?

My other question is does anyone know what the fan controller is?

The reason I'm asking is I'd like to write my own software maybe something for the desktop.

Thanks


https://www.argon40.com/contact

User avatar
procount
Posts: 2250
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Looking for Argon One details

Sun May 31, 2020 9:11 am

I have a couple of these cases.
Without the script installed, the power button turns it on and off. Reboot requires the script.
Fan control requires the script too, but to be honest, the passive case cooling is normally sufficient.
I am also interested in an alternative script to control it that doesn't use python.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

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

Re: Looking for Argon One details

Sun May 31, 2020 7:31 pm

I have contacted Argon40 we'll see what if any information they will share.

@procount, when you say the power button turns it on and off I take it you mean the power shuts off completely? Is there a delay like you hold the button for this to happen? If that's the case there could be a microcontroller in there.

I'm hoping to write a daemon in C with an overlay to configure it.

Soon enough my case will arrive and I can start to tinker.

User avatar
procount
Posts: 2250
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Looking for Argon One details

Sun May 31, 2020 7:38 pm

Yes, there is a microcontroller in there that communicates over i2c.
Holding the button for ~5 secs will forcibly shutdown the power.
For a soft shutdown (~2-5 secs) or a reboot (double-click) you need the script to be running to recognise the GPIO pin (although argon told me something different on the kickstarter comments).
The fan just needs a % of full-speed to be written to an I2C register to control the speed.
Everything you need is in their script. I just haven't had time to convert it to a 'C' program yet.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

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

Re: Looking for Argon One details

Sun May 31, 2020 8:30 pm

procount wrote:
Sun May 31, 2020 7:38 pm
Yes, there is a microcontroller in there that communicates over i2c.
Holding the button for ~5 secs will forcibly shutdown the power.
For a soft shutdown (~2-5 secs) or a reboot (double-click) you need the script to be running to recognise the GPIO pin (although argon told me something different on the kickstarter comments).
The fan just needs a % of full-speed to be written to an I2C register to control the speed.
Everything you need is in their script. I just haven't had time to convert it to a 'C' program yet.
Thanks that's great info. I did read the script and without a unit in hand much was guess work should not be difficult to get something written.

One other thing I was just thinking of.
If you shutdown the pi from the desktop or the cli, does the case power off?

User avatar
procount
Posts: 2250
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Looking for Argon One details

Wed Jun 03, 2020 8:37 am

DarkElvenAngel wrote:
Sun May 31, 2020 8:30 pm
If you shutdown the pi from the desktop or the cli, does the case power off?
I just tried it with the script installed, and yes it all powered off. Not sure without the script, but probably not.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

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

Re: Looking for Argon One details

Wed Jun 03, 2020 1:16 pm

procount wrote:
Wed Jun 03, 2020 8:37 am
DarkElvenAngel wrote:
Sun May 31, 2020 8:30 pm
If you shutdown the pi from the desktop or the cli, does the case power off?
I just tried it with the script installed, and yes it all powered off. Not sure without the script, but probably not.
I have the power reboot part ported to C just waiting on the case to work on the fan controller.
I'm thinking of writing a device-tree overlay to configure the thing, then it is all looked after in config.txt

Case and the new pi might arrive tomorrow but things don't always to plan.

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

Re: Looking for Argon One details

Wed Jun 10, 2020 12:19 am

UPDATE:
I finally received my Pi for the argon one case so now I can get down to some serious testing and coding.

It's a very fine case and I already have manual control over the fan I could write a script or alias for it but it's very simple

Code: Select all

i2cset -y1 0x1A 0x00 $FANSPEED
will set the speed of the fan from 0 - 100.

a shutdown service could be added that would issue

Code: Select all

i2cset -y1 0x1A 0x00 0xFF
This will power off the case I'm not sure I like the timing of this I wonder if it's adjustable? Never run that command from the terminal as it kills power to the pi and could corrupt your SD card!

I'm working on my daemon to bring the fan on when needed. I have the button control in front of me and they don't seem like what I would want. I like the power button overlay press the button and shutdown! I could just use the overlay.

watch this thread I will be posting updates and once it exists a link to the gitlab repo with my daemon, and most likely scripts and services as well for options.

Quick edit update.

The power button isn't directly connected to the GPIO the microcontroller must translate the button patterns and then it pulses the GPIO.

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

Re: Looking for Argon One details

Tue Jun 16, 2020 1:34 am

Update,

After some very hard work and some crazy debugging I've finished the basic daemon code.

I am now testing the code to be sure it is working. I have control of the fan with hysteresis, currently no way to change the set points unless recompiled, and Power button will work as described in the manual double tap to reboot, and hold down for power off.

I have try a few times to contact argon40 and have no replies all protocols have been reverse engineered from the device itself and the supplied python code.

I have a replacement script for the shutdown that doesn't require python but does use i2c-tools I could easily write a little program to send the shutdown command to the case if required.

The fan, I added hysteresis the fan will spin up after it is 1 degree higher than the set point but will not spin down until it's 3 degrees lower than the set point. This should stop the fan going on and off.

I'm working on added the config file, so the set points can be adjusted. And I'm working on the makefile.

Once all this is done I'm thinking to publish the code to gitlab.

I'll update again once I've made more progress.

User avatar
procount
Posts: 2250
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Looking for Argon One details

Tue Jun 16, 2020 7:20 am

I'm glad you added hysteresis. Maybe it could be an overlay parameter too so that it is adjustable?
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

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

Re: Looking for Argon One details

Wed Jun 17, 2020 7:35 pm

procount wrote:
Tue Jun 16, 2020 7:20 am
I'm glad you added hysteresis. Maybe it could be an overlay parameter too so that it is adjustable?
Okay device overlay is working

Code: Select all

dtoverlay=argonone,fantemp_0=40,hysteresis=2

Code: Select all

Wed Jun 17 15:20:19 2020 [INFO] Startup ArgonOne Daemon ver 0.5 beta
Wed Jun 17 15:20:19 2020 [INFO] Loading Configuration
Wed Jun 17 15:20:19 2020 [INFO] Reading values for Device-Overlay
Wed Jun 17 15:20:19 2020 [INFO] Fan Speeds set to 10% 55% 100%
Wed Jun 17 15:20:19 2020 [INFO] Fan Temps set to 40 60 65
Wed Jun 17 15:20:19 2020 [INFO] Hysteresis set to 2
Wed Jun 17 15:20:19 2020 [INFO] GPIO initialized
Wed Jun 17 15:20:19 2020 [ERROR] Permissions error, Root access require for power operations
Wed Jun 17 15:20:19 2020 [INFO] RPI MODEL 4B 8GB rev 1.4
Wed Jun 17 15:20:19 2020 [INFO] Lock file created
Wed Jun 17 15:20:19 2020 [INFO] I2C Initialized
Wed Jun 17 15:20:19 2020 [INFO] Now running as a daemon
Wed Jun 17 15:20:19 2020 [INFO] Set GPIO 4 to mode INPUT
Wed Jun 17 15:20:19 2020 [INFO] Set GPIO 4 pull up/down to DOWN
Wed Jun 17 15:20:19 2020 [INFO] Now waitting for button press
Wed Jun 17 15:20:19 2020 [INFO] Monitoring line 4 on /dev/gpiochip0
Wed Jun 17 15:20:21 2020 [INFO] Successfully opened /dev/vcio for temprature sensor
Wed Jun 17 15:20:33 2020 [INFO] Set fan to 10%
As the log output shows the daemon will not fail if it can't do a function it can still control the fan in user mode.

Now that I can set some of the configurations from the overlay I need to put better error checking on to them. right now no fan speed above 100% will be accepted. Temperature also has an upper limit set at 80, but I don't have checks yet for the setting so that each stage is higher than the last to ensure the fan route will not get stuck because of erroneous values. Still a bit of work to do here but I'm getting there.

User avatar
Hackswell
Posts: 22
Joined: Thu May 28, 2020 11:33 pm

Re: Looking for Argon One details

Fri Jun 19, 2020 5:28 pm

Sounds like it's coming along very nicely, DarkElf! Thanks for working on this!

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

Re: Looking for Argon One details

Mon Jun 22, 2020 9:40 pm

Update:

Getting close now, I've sorted out some issues with systemd. Unfortunately this broke running with user permission and now root is required. I'm going to say this is okay as it's meant to run in the background, and the user doesn't really need to do anything.

The makefile file is coming along and now it can build the overlay, and daemon, and it also has the install steps.

My to do list is getting shorter, I still need uninstaller and to sort out bad values passed in the configuration. I also am thinking about having the installer add the overlay to /boot/config.txt automatically.

Then it's code clean up ready for publish.

I'm not sure how useful the fan configuration utility was since I'm using a device tree overlay to set up the values it makes such a script more of a pain to write. However if this is something that is desired I can see what I can do.

Any other ideas or features requests?

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

Re: Looking for Argon One details

Thu Jun 25, 2020 2:58 am

Update:

I have finished the installer and uninstaller. Everything is in the make file I had to write one bash script to setup the overlay into config.txt.

I've replaced the need for i2c-tools to be installed and wrote a little c program to tell the case to power off at shutdown.

The build sequence along with install. I purposely didn't run install with sudo to show the output. Added the ps -aux to show how much memory is need for the daemon.

Code: Select all

pi@raspberrypi:~/Projects/argononed$  make all
MAKE: Daemon
MAKE: Overlay
Make: Complete
pi@raspberrypi:~/Projects/argononed$  make install
makefile:22: *** "(Un)Installing requires elevated privileges".  Stop.
pi@raspberrypi:~/Projects/argononed$  sudo make install
Installing daemon Successful
Installing services
argononed.service ... Successful
argonone-shutdown ... Successful
Refresh services list
Enable Service Successful
Starting Service Successful
Installing overlay Successful
Search config.txt for overlay ... FOUND
Install Complete
pi@raspberrypi:~/Projects/argononed$  ps -aux | head -n1; ps -aux | grep argononed
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root     11365  0.0  0.0  11256    92 ?        Ssl  17:26   0:05 /usr/bin/argononed
pi       18457  0.0  0.0   7480   572 pts/0    S+   22:50   0:00 grep --color=auto argononed
pi@raspberrypi:~/Projects/argononed$
Just finishing up some last details and I'll post the project to my GitLab Repo.


PiUser10
Posts: 42
Joined: Mon Dec 30, 2013 9:20 am

Re: Looking for Argon One details

Thu Jun 25, 2020 3:46 pm

Great job , super addition to the argon one case. :D

Two minor issues I came across were

1) sudo make install came up with error

bash: .setup-overlay.sh: No such file or directory
make: *** [makefile:69: install-overlay] Error 127

did notice setup-overlay.sh was not set to executable so may need a chmod ?
also maybe '@bash .setup-overlay.sh' may need to be '@bash ./setup-overlay.sh' ?

2) Got all the config.txt parameters to work (3 fan temps and 3 fan speeds) but hysteresis or Hysteresis
does not appear to take as the /var/log file always prints 'Hysteresis set to 3' , I was trying to set it to 10
with dtparam=argonone,hysteresis=10

Otherwise all working well here.

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

Re: Looking for Argon One details

Thu Jun 25, 2020 3:57 pm

PiUser10 wrote: Great job , super addition to the argon one case. :D

Two minor issues I came across were

1) sudo make install came up with error

bash: .setup-overlay.sh: No such file or directory
make: *** [makefile:69: install-overlay] Error 127

did notice setup-overlay.sh was not set to executable so may need a chmod ?
also maybe '@bash .setup-overlay.sh' may need to be '@bash ./setup-overlay.sh' ?

2) Got all the config.txt parameters to work (3 fan temps and 3 fan speeds) but hysteresis or Hysteresis
does not appear to take as the /var/log file always prints 'Hysteresis set to 3' , I was trying to set it to 10
with dtparam=argonone,hysteresis=10

Otherwise all working well here.
I fixed the makefile they way a typo I didn't think a hidden file was a good thing.

Hysteresis can't be more than 5 this was a limit I had to set to keep the default values from running a muck if only the hysteresis is changed.

If you want to change the limit its line 141 of argononed.c the 5 is your limit.

Thanks for giving it a go

Just git pull and everything should be working
Last edited by DarkElvenAngel on Thu Jun 25, 2020 4:01 pm, edited 1 time in total.

User avatar
Hackswell
Posts: 22
Joined: Thu May 28, 2020 11:33 pm

Re: Looking for Argon One details

Thu Jun 25, 2020 4:01 pm

DarkElvenAngel wrote:
Thu Jun 25, 2020 2:31 pm
Code is now live at https://gitlab.com/DarkElvenAngel/argononed
W00t! Thanks! I'll try to check it out when I get home.

Just a few questions/review on your code:
  • Everything seems hard-coded to 3 and only 3 temperature/fan settings. I believe in the original python script, it was an uncapped list. 3 should be fine for almost anyone, but technically, it is losing functionality/configurability. Future enhancement would be a sorted linked list possibly?
  • Line 141: In Read_config(): if (datain.hysteresis < 5) hysteresis = datain.hysteresis;
    Why is hysteresis capped at below 5?
  • char *filename = (char*)"/dev/i2c-1";
    Are we guaranteed that the i2c bus will always be 1? With address 0x1a? Just checking.
  • Does this daemon change the button press timing for reboot and shutdown? Looks like reboot is ~2s hold on power button, and poweroff is ~4s? If this is the case, why isn't poweroff just any timing >= 3.9s, rather than 3.9s <= delay <= 4.1s?

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

Re: Looking for Argon One details

Thu Jun 25, 2020 4:18 pm

Hackswell wrote:
Thu Jun 25, 2020 4:01 pm
DarkElvenAngel wrote:
Thu Jun 25, 2020 2:31 pm
Code is now live at https://gitlab.com/DarkElvenAngel/argononed
W00t! Thanks! I'll try to check it out when I get home.

Just a few questions/review on your code:
  • Everything seems hard-coded to 3 and only 3 temperature/fan settings. I believe in the original python script, it was an uncapped list. 3 should be fine for almost anyone, but technically, it is losing functionality/configurability. Future enhancement would be a sorted linked list possibly?
  • Line 141: In Read_config(): if (datain.hysteresis < 5) hysteresis = datain.hysteresis;
    Why is hysteresis capped at below 5?
  • char *filename = (char*)"/dev/i2c-1";
    Are we guaranteed that the i2c bus will always be 1? With address 0x1a? Just checking.
  • Does this daemon change the button press timing for reboot and shutdown? Looks like reboot is ~2s hold on power button, and poweroff is ~4s? If this is the case, why isn't poweroff just any timing >= 3.9s, rather than 3.9s <= delay <= 4.1s?
Thanks for the review,

I'll answer your question in order.
1. I could add more set points if that is something that has enough requests. In my testing it seemed like the fan speed changes are not that different and at the default values I wasn't able to get the CPU hot enough to trigger past the first set point. That's only in my test and I only have one unit so...

2. The cap is in place in case the default values are being used because the if you set it too high it will start jumping between set points because they will overlap.

3. Yes the case only works on a pi 4 or 3 and they both only have /dev/i2c-1 for the case interface. The overlay activates this interface, This can be address if in future there is change the software already reads the pi's information.

4. The button isn't directly read by the pi the micro controller in the case reads the button and then send out either a 20ms or 40ms pulse to the pi on gpio 4. I need a range of values here because of timing issues reading the pulse widths from user space this could be improved with a kernel module, and that adds a layer of complexity to the project.

Further to the button I was unable to get any information from Argon40 and had to reverse engineer the protocols for the button and fan controllers. As far as I know there is no to change the defaults I did ask them more than once.


This is the first release and I'm sure things can be improved. The configuration settings in particular the hysteresis cap could be reflective of the accepted values to insure there is no overlap. The device overlay can be expanded to add more set-points.

Thank you again for having a look and let me know how you get on.

edit: sorry missed a question.

nliviu
Posts: 49
Joined: Tue Jun 23, 2020 1:24 pm
Location: Romania

Re: Looking for Argon One details

Fri Jun 26, 2020 6:54 pm

Nice work @DarkElvenAngel!

I've noticed it stopped

Code: Select all

Fri Jun 26 19:17:28 2020 [INFO] Startup ArgonOne Daemon ver 0.1.5
Fri Jun 26 19:17:28 2020 [INFO] Loading Configuration
Fri Jun 26 19:17:28 2020 [INFO] Reading values from device-tree
Fri Jun 26 19:17:28 2020 [INFO] Hysteresis set to 3
Fri Jun 26 19:17:28 2020 [INFO] Fan Speeds set to 10% 55% 100%
Fri Jun 26 19:17:28 2020 [INFO] Fan Temps set to 55 60 65
Fri Jun 26 19:17:28 2020 [INFO] GPIO initialized
Fri Jun 26 19:17:28 2020 [INFO] RPI MODEL 4B 2GB rev 1.1
Fri Jun 26 19:17:28 2020 [INFO] Lock file created
Fri Jun 26 19:17:28 2020 [INFO] I2C Initialized
Fri Jun 26 19:17:28 2020 [INFO] Now running as a daemon
Fri Jun 26 19:17:28 2020 [INFO] Set GPIO 4 to mode INPUT
Fri Jun 26 19:17:28 2020 [INFO] Set GPIO 4 pull up/down to DOWN
Fri Jun 26 19:17:28 2020 [INFO] Now waitting for button press
Fri Jun 26 19:17:28 2020 [INFO] Monitoring line 4 on /dev/gpiochip0
Fri Jun 26 19:17:30 2020 [INFO] Successfully opened /dev/vcio for temprature sensor
Fri Jun 26 20:05:47 2020 [INFO] Set fan to 10%
Fri Jun 26 20:07:17 2020 [INFO] Set fan to 0%
Fri Jun 26 20:09:29 2020 [INFO] Set fan to 10%
Fri Jun 26 20:10:37 2020 [INFO] Set fan to 0%
Fri Jun 26 20:13:03 2020 [INFO] Set fan to 10%
Fri Jun 26 20:14:23 2020 [INFO] Set fan to 0%
Fri Jun 26 20:17:31 2020 [INFO] Set fan to 10%
Fri Jun 26 20:19:41 2020 [INFO] Set fan to 0%
Fri Jun 26 20:25:01 2020 [INFO] Set fan to 10%
Fri Jun 26 20:26:37 2020 [INFO] Set fan to 0%
Fri Jun 26 20:31:25 2020 [INFO] Set fan to 10%
Fri Jun 26 20:33:15 2020 [INFO] Set fan to 0%
Fri Jun 26 20:37:01 2020 [INFO] Set fan to 10%
Fri Jun 26 20:38:24 2020 [INFO] Set fan to 0%
Fri Jun 26 20:41:11 2020 [INFO] Pulse received -239595411ms
Fri Jun 26 20:41:11 2020 [INFO] Cleanning up
Fri Jun 26 20:41:11 2020 [INFO] Successfully closed temprature sensor
Fri Jun 26 20:41:11 2020 [INFO] I2C Closed
Fri Jun 26 20:41:11 2020 [INFO] Ready for shutdown
Fri Jun 26 20:41:11 2020 [INFO] Exiting
Noone pushed the button, I even disabled it with

Code: Select all

i2cset -y 1 0x01a 0xfe
The negative value in

Code: Select all

Pulse received -239595411ms
seems related to uint/int conversions in int monitor_device()

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

Re: Looking for Argon One details

Fri Jun 26, 2020 7:03 pm

nliviu wrote:
Fri Jun 26, 2020 6:54 pm
Nice work @DarkElvenAngel!

I've noticed it stopped

Code: Select all

Fri Jun 26 19:17:28 2020 [INFO] Startup ArgonOne Daemon ver 0.1.5
Fri Jun 26 19:17:28 2020 [INFO] Loading Configuration
Fri Jun 26 19:17:28 2020 [INFO] Reading values from device-tree
Fri Jun 26 19:17:28 2020 [INFO] Hysteresis set to 3
Fri Jun 26 19:17:28 2020 [INFO] Fan Speeds set to 10% 55% 100%
Fri Jun 26 19:17:28 2020 [INFO] Fan Temps set to 55 60 65
Fri Jun 26 19:17:28 2020 [INFO] GPIO initialized
Fri Jun 26 19:17:28 2020 [INFO] RPI MODEL 4B 2GB rev 1.1
Fri Jun 26 19:17:28 2020 [INFO] Lock file created
Fri Jun 26 19:17:28 2020 [INFO] I2C Initialized
Fri Jun 26 19:17:28 2020 [INFO] Now running as a daemon
Fri Jun 26 19:17:28 2020 [INFO] Set GPIO 4 to mode INPUT
Fri Jun 26 19:17:28 2020 [INFO] Set GPIO 4 pull up/down to DOWN
Fri Jun 26 19:17:28 2020 [INFO] Now waitting for button press
Fri Jun 26 19:17:28 2020 [INFO] Monitoring line 4 on /dev/gpiochip0
Fri Jun 26 19:17:30 2020 [INFO] Successfully opened /dev/vcio for temprature sensor
Fri Jun 26 20:05:47 2020 [INFO] Set fan to 10%
Fri Jun 26 20:07:17 2020 [INFO] Set fan to 0%
Fri Jun 26 20:09:29 2020 [INFO] Set fan to 10%
Fri Jun 26 20:10:37 2020 [INFO] Set fan to 0%
Fri Jun 26 20:13:03 2020 [INFO] Set fan to 10%
Fri Jun 26 20:14:23 2020 [INFO] Set fan to 0%
Fri Jun 26 20:17:31 2020 [INFO] Set fan to 10%
Fri Jun 26 20:19:41 2020 [INFO] Set fan to 0%
Fri Jun 26 20:25:01 2020 [INFO] Set fan to 10%
Fri Jun 26 20:26:37 2020 [INFO] Set fan to 0%
Fri Jun 26 20:31:25 2020 [INFO] Set fan to 10%
Fri Jun 26 20:33:15 2020 [INFO] Set fan to 0%
Fri Jun 26 20:37:01 2020 [INFO] Set fan to 10%
Fri Jun 26 20:38:24 2020 [INFO] Set fan to 0%
Fri Jun 26 20:41:11 2020 [INFO] Pulse received -239595411ms
Fri Jun 26 20:41:11 2020 [INFO] Cleanning up
Fri Jun 26 20:41:11 2020 [INFO] Successfully closed temprature sensor
Fri Jun 26 20:41:11 2020 [INFO] I2C Closed
Fri Jun 26 20:41:11 2020 [INFO] Ready for shutdown
Fri Jun 26 20:41:11 2020 [INFO] Exiting
Noone pushed the button, I even disabled it with

Code: Select all

i2cset -y 1 0x01a 0xfe
The negative value in

Code: Select all

Pulse received -239595411ms
seems related to uint/int conversions in int monitor_device()
That's interesting do you have anything connected to the GPIO header?

How did you know that sending 0xfe disables the button?

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

Re: Looking for Argon One details

Fri Jun 26, 2020 7:14 pm

Okay your correct it was an a signed unsigned issue. I've corrected the mistake just going to look through and see if I have anymore like that. I think I will check the pulse length and if it's not valid I'll restart the button monitor

I'd be interested in knowing if you know anymore secrets about the protocol.

EDIT:
I've fixed the conversion problem, and added a filter to button monitor to reject unrecognised pulses. This should fix the problem it's currently in the testing branch until I'm sure the problem is solved.

EDIT 2: The button lockout trick will only work until the the daemon sends another command to the fan or possible only when sending 0x00 to turn the fan off. I would have to add something to keep the button disabled or just not monitor it.

nliviu
Posts: 49
Joined: Tue Jun 23, 2020 1:24 pm
Location: Romania

Re: Looking for Argon One details

Sat Jun 27, 2020 6:46 am

No, nothing connected to GPIO4.

Argon-ONE-i2c-Codes

camccar
Posts: 19
Joined: Thu May 28, 2020 1:07 pm

Re: Looking for Argon One details

Sat Jun 27, 2020 12:45 pm

DarkElvenAngel wrote:
Thu Jun 25, 2020 2:31 pm
Code is now live at https://gitlab.com/DarkElvenAngel/argononed
Hey thanks, this is much easier to read than the official argon code.

Return to “Advanced users”