# Node creation request - RasPi Argon hat

**URL:** <https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028>\
**Category:** General\
**Created:** [13 July 2022 05:30 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028 "2022-07-13T05:30:45Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [13 July 2022 05:30 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/1 "2022-07-13T05:30:45Z")

</div>

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.

> **[GitHub - Argon40Tech/Argon-ONE-i2c-Codes: This is a list of i2c Codes...](https://github.com/Argon40Tech/Argon-ONE-i2c-Codes)**
>
> This is a list of i2c Codes utilized by Argon ONE Raspberry Pi Cases - GitHub - Argon40Tech/Argon-ONE-i2c-Codes: This is a list of i2c Codes utilized by Argon ONE Raspberry Pi Cases

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).

Just asking.  
Thanks.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 July 2022 07:59 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/2 "2022-07-13T07:59:37Z")

</div>

Have you tried using node-red-contrib-i2c?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [13 July 2022 08:00 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/3 "2022-07-13T08:00:21Z")

</div>

No... I have maybe seen it, but never looked into it.

That's an idea, I guess.

I guess I will have to look at the existing code (or use that command that scans the I2C bus) to get the address.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [13 July 2022 08:21 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/4 "2022-07-13T08:21:42Z")

</div>

(Sorry.....)

I got that set of nodes, and I am not getting how to use them.

`IN` and `OUT` are ambiguous to me to what they do.

I wrote a basic bit of stuff and all I can seem to do is turn the fan on or off.  
Turning it on requires a high-ish number to be sent.

The address is `26` (decimal) but I am missing something in determining how to _monitor_ what that address is doing.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 July 2022 09:04 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/5 "2022-07-13T09:04:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 July 2022 09:06 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/6 "2022-07-13T09:06:01Z")

</div>

> [@Trying\_to\_learn](#):
>
> I am missing something in determining how to _monitor_ what that address is doing.

From what I read in the documentation, there is no 'monitor' command.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [13 July 2022 09:06 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/7 "2022-07-13T09:06:46Z")

</div>

Oh, ok....

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.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 July 2022 09:21 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/8 "2022-07-13T09:21:47Z")

</div>

> [@Trying\_to\_learn](#):
>
> 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:

```auto
# 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`

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [13 July 2022 09:36 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/9 "2022-07-13T09:36:37Z")

</div>

Yes, so there is that command sent:  
`i2cset -y 1 0x1a 0xfe`

So that is sending `0xfe` on port `0x1a`.

So.... Wouldn't the `IN` node see that when it is sent?  
Or more so: anything sent to port `0x1a`? (Given that is the address set in the node?)

But when I open the `IN` node (`node-red-contrib-i2c`) wants a `COMMAND` set/stipulated/defined/declared.....

I don't understand how that works.

I get it that you would do that on the `OUT` node, but not the `IN` node.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 July 2022 09:42 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/10 "2022-07-13T09:42:40Z")

</div>

> # i2c in
> 
> Reads data from a local I2C port.
> 
> It will put a buffer object into the `msg.payload`.

Which of the commands in the `Argon40Tech/Argon-ONE-i2c-Codes` are commands that will `read` the hat?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [13 July 2022 09:50 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/11 "2022-07-13T09:50:06Z")

</div>

> [@zenofmud](#):
>
> Which of the commands in the `Argon40Tech/Argon-ONE-i2c-Codes` are commands that will `read` the hat?

Reading what I see on the `github` link, there isn't one.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 July 2022 10:15 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/12 "2022-07-13T10:15:21Z")

</div>

Right you are! The `i2c in` node will be of no use in your case. So which node do you think you should use to send a command?

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [13 July 2022 10:19 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/13 "2022-07-13T10:19:13Z")

</div>

I'm not wanting to send a command.

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`.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [13 July 2022 10:27 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/14 "2022-07-13T10:27:18Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [13 July 2022 10:31 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/15 "2022-07-13T10:31:20Z")

</div>

Seems I shall have to let this go to the keeper.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [27 July 2022 10:31 UTC](https://discourse.nodered.org/t/node-creation-request-raspi-argon-hat/65028/16 "2022-07-27T10:31:49Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
