I'm not sure how many people who have one, but there is a nice "hat" for the RasPi which has a fan on it.
Seems support isn't too good (not a problem) but I was wondering if it would be possible to make a node (for node-red) that would indicate if the fan is on/off (and at a push the speed).
Did you look at the readme where it tells you what the command should look like?
Start by running the i2c Scan' node connected to a debug` node (set to display the complee msg object) and see if you can identify the address of the fan.
So the code I write scans that address (26) and .......
The i2c Scan node tells me the address of the Hat. That doesn't help me with finding out if the fan is on or off.
Ok, (from your second post).
No there is no "monitor" command.
But (I don't know).... Could I listen to that port and when it sees the command sent, it knows the fan is on.
(Yeah, it has to parse the message... But that's a given)
I get that.
But I have no idea how to do that.
I don't understand what the main two nodes do... The IN and OUT node.
Could I use/set the IN node with the correct address set, and when things happen to that address I see what is/was sent to it?
And wouldn't that be the IN node?
I set it's address to 26 and... all should work.
But that node wants a command and bytes (size)....
To me that doesn't make sense.
But - as usual - I am way out of my depth with how this works.
so take a deep breath and start at the beginning. The documentation says:
# How to Send i2c Codes to the Argon ONE MCU
Example: **Setting Argon ONE to Mode 2 (Always ON)**
Type in the Terminal the code below:
i2cset -y 1 0x01a 0xfe
so what does that command say? Well the first thing to do is find out what each part is. To do that, open a terminal window on that pi and enter man i2cset and find out what each part of that line means. So do it and tell me what you find.
p.s. I think that 0x01a is a typo in their documentation and should be 0x1a
I'm wanting to make a node that listens to what is going on and detects if the fan is on or off.
But..... After looking at the code:
I don't think there is a way to do it as all the Magic happens on that board.
I think.
Though..... The code (python script) runs in the real memory.
So .... to get that script to share what's going on WRT the fan (is it on/off) that script would have to be modified.
But to what is again: beyond me.
As I don't know how to make something that gives the information to node-red.
Well from what I read from the Github page you posted, there is nothing in that device that will send you any information. Maybe you could put some other sensor on the output of the fan to register if it is on or not.
Maybe there is another fan out there that wil tell you if it is on or off.