# Exec node not working as expected

**URL:** <https://discourse.nodered.org/t/exec-node-not-working-as-expected/96461>\
**Category:** General\
**Tags:** exec, flowfuse\
**Created:** [7 April 2025 21:28 UTC](https://discourse.nodered.org/t/exec-node-not-working-as-expected/96461 "2025-04-07T21:28:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dudleyjosh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dudleyjosh/32/105799_2.png) [@dudleyjosh](https://discourse.nodered.org/u/dudleyjosh)\
**Post date:** [7 April 2025 21:28 UTC](https://discourse.nodered.org/t/exec-node-not-working-as-expected/96461/1 "2025-04-07T21:28:15Z")

</div>

I was trying to create a flow on a Raspberry Pi to adjust the master volume of the Pi using an Exec node and the command `amixer -q -M sset Master 50%` which works as expected from the command line but errors when using the Exec node.

The device is running as a FlowFuse remote instance and when I run the command `amixer controls` directly from the command line to see the various sound interfaces, I get a completely different response than when I run the same command using the Exec node from Node-RED... any ideas?

 ![Screenshot 2025-04-07 at 5.03.12 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/7/c76704be4b2f4f9b7d3f89f8ec852754d32298cd.png)  
 ![Screenshot 2025-04-07 at 5.02.43 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/5/d59e2381116ad20fc53233f6c12a137d46e38aba.png)

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [7 April 2025 21:43 UTC](https://discourse.nodered.org/t/exec-node-not-working-as-expected/96461/2 "2025-04-07T21:43:30Z")

</div>

Try this: [Exec node - help with how it spawns - #3 by Steve-Mcl](https://discourse.nodered.org/t/exec-node-help-with-how-it-spawns/95957/3)

Note: since it is a device agent instance, put the env in the device settings -\> env vars and replace the 1000 with the Sid of the account that runs the device agent

 ![Screenshot_20250407-224727](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/e/2e4f70a6daafa528e231b1ce96435e775f7b1d37.png)

---

<div class="post-metadata">

**Author:** ![dudleyjosh](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dudleyjosh/32/105799_2.png) [@dudleyjosh](https://discourse.nodered.org/u/dudleyjosh)\
**Post date:** [9 April 2025 19:44 UTC](https://discourse.nodered.org/t/exec-node-not-working-as-expected/96461/3 "2025-04-09T19:44:13Z")

</div>

@Steve-Mcl this worked and allows me to adjust the volume from the device-agent flow 🙂

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![hardillb](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hardillb/32/12373_2.png) [@hardillb](https://discourse.nodered.org/u/hardillb)\
**Post date:** [9 April 2025 21:28 UTC](https://discourse.nodered.org/t/exec-node-not-working-as-expected/96461/4 "2025-04-09T21:28:13Z")

</div>

OK, I was close with the DBUS and PULSE env vars, just needed XDG instead

---

<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:** [23 April 2025 21:28 UTC](https://discourse.nodered.org/t/exec-node-not-working-as-expected/96461/5 "2025-04-23T21:28:44Z")

</div>

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