# Exec node 433utils

**URL:** <https://discourse.nodered.org/t/exec-node-433utils/11991>\
**Category:** General\
**Created:** [9 June 2019 00:17 UTC](https://discourse.nodered.org/t/exec-node-433utils/11991 "2019-06-09T00:17:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![p33k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/p33k/32/9211_2.png) [@p33k](https://discourse.nodered.org/u/p33k)\
**Post date:** [9 June 2019 00:17 UTC](https://discourse.nodered.org/t/exec-node-433utils/11991/1 "2019-06-09T00:17:45Z")

</div>

Hi,  
I used node-rcswitch with an 433mhz module for power sockets a long time. after an update to node 10 rcswitch doesn't work anymore.  
I'm looking for another way to use my 433mhz power sockets now.  
with 433Utils I can do it in the terminal directly like this:  
`sudo ~/433Utils/RPi_utils/./codesend 4543571`

but when I input that in an exec node in node-red it doesn't work. it says "rc-1 rc-2 when set to spawn or error-1 when set to the other option.

what am I doing wrong? how can I execute the command above via the exec node?  
thanks in advance

---

<div class="post-metadata">

**Author:** ![p33k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/p33k/32/9211_2.png) [@p33k](https://discourse.nodered.org/u/p33k)\
**Post date:** [9 June 2019 08:33 UTC](https://discourse.nodered.org/t/exec-node-433utils/11991/2 "2019-06-09T08:33:58Z")

</div>

I guess the path was wrong.  
`sudo /home/pi/433Utils/RPi_utils/./codesend xxxxxxx`  
does the trick...

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [10 June 2019 17:45 UTC](https://discourse.nodered.org/t/exec-node-433utils/11991/3 "2019-06-10T17:45:31Z")

</div>

In your previous post, the path started with `~/`, which is the same as `/home/pi` when node-red is running as user 'pi'. So it seems your node-red instance is _not_ running as user 'pi' anymore?

Also, the path you say works includes that `/./` (the current dir), which is meaningless. I would try using `/home/pi/433Utils/RPi_utils/codesend`

Finally, you should be able to send the command without using `sudo ...` -- what are the permissions on that `codesend` command? I'm guessing it needs root access to connect to some serial port or something? Usually, making the node-red user part of the 'dialout' group will also allow writing to the serial device -- alternately, you can use the setuid permission on the command, which is a bit safer than executing a command using sudo.

---

<div class="post-metadata">

**Author:** ![p33k](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/p33k/32/9211_2.png) [@p33k](https://discourse.nodered.org/u/p33k)\
**Post date:** [10 June 2019 22:31 UTC](https://discourse.nodered.org/t/exec-node-433utils/11991/4 "2019-06-10T22:31:27Z")

</div>

thanks for clearing that up. node-red is running as an adapter in iobroker, so its probably the iobroker user and not pi.  
you are totally right about the /./ ,works without it and it works directly without sudo.  
If someone is looking for a nodejs \>10 alternative for RC Switch too: instead of 433 utils codesend I use this library now: [https://github.com/xkonni/raspberry-remote](https://github.com/xkonni/raspberry-remote)  
because the code scheme in more straight forward.

I'm running commands like this in the exec node now:

```auto
/home/pi/raspberry-remote/send 11111 1 1

```

Thanks for your feedback
