# Problems with the exec bloc

**URL:** <https://discourse.nodered.org/t/problems-with-the-exec-bloc/7276>\
**Category:** General\
**Created:** [26 January 2019 18:04 UTC](https://discourse.nodered.org/t/problems-with-the-exec-bloc/7276 "2019-01-26T18:04:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![GridexX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gridexx/32/5142_2.png) [@GridexX](https://discourse.nodered.org/u/GridexX)\
**Post date:** [26 January 2019 18:04 UTC](https://discourse.nodered.org/t/problems-with-the-exec-bloc/7276/1 "2019-01-26T18:04:33Z")

</div>

Hello Everybody 😀,

I just found a python script to control my new led matrix the MAX7219  
The script is working fine but when i tried to launch it with the exec bloc it send the error : command failed

I don't know how to fix that, please can someone help me ?

My flow :

```auto
[{"id":"1c52dee0.05af61","type":"change","z":"ed38ec92.4e1d2","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"-c 'rf1(\" & payload & \")'\"","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":180,"y":320,"wires":[["4be02acf.9e1b2c"]]}]

```

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [26 January 2019 18:15 UTC](https://discourse.nodered.org/t/problems-with-the-exec-bloc/7276/2 "2019-01-26T18:15:55Z")

</div>

Not seeing where the exec fits with that flow or what you are invoking ?  
What does the second output (stderr) show ?  
Do you need -u to unbuffer the output ?

Is this a one off command or does the python app expect more input ? in which case the `node-red-node-daemon` node may be more appropriate as that takes a continuous stream of commands on stdin.

---

<div class="post-metadata">

**Author:** ![GridexX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gridexx/32/5142_2.png) [@GridexX](https://discourse.nodered.org/u/GridexX)\
**Post date:** [26 January 2019 18:55 UTC](https://discourse.nodered.org/t/problems-with-the-exec-bloc/7276/3 "2019-01-26T18:55:00Z")

</div>

No it's just a timestamp that will be activate if ireceive a message on my phone;

Here are the 3 output in order :

```
26/01/2019 à 19:49:37[node: 513f2a71.342e2c](http://192.168.0.18:1880/#)

msg.payload : string[0]

""

26/01/2019 à 19:49:37[node: ff6d8c11.8d04a8](http://192.168.0.18:1880/#)msg.payload : string[186]

"usage: matrix_demo.py [-h] [--cascaded CASCADED]↵ [--block-orientation {0,90,-90}] [--rotate {0,1,2,3}]↵matrix_demo.py: error: unrecognized arguments: 1548528575364↵"

26/01/2019 à 19:49:37[node: f55d01ec.e0cac](http://192.168.0.18:1880/#)msg.payload : Object

object

code: 2

message: "Command failed: python /home/pi/matrix_demo.py 1548528575364↵usage: matrix_demo.py [-h] [--cascaded CASCADED]↵ [--block-orientation {0,90,-90}] [--rotate {0,1,2,3}]↵matrix_demo.py: error: unrecognized arguments: 1548528575364↵" 

```

I'm sorry i dont know what mean unbuffer, I just need to execut my script not to get an ouptput back.  
Ok i will try daemon but can you tell me if my command is right, I have found so many different way to execute a script but no one work with me...

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [26 January 2019 19:12 UTC](https://discourse.nodered.org/t/problems-with-the-exec-bloc/7276/4 "2019-01-26T19:12:16Z")

</div>

the second of those gives you the error message and the problem you need to fix.

```auto
usage: matrix_demo.py [-h] [--cascaded CASCADED]↵ [--block-orientation {0,90,-90}] [--rotate {0,1,2,3}]
matrix_demo.py: error: unrecognized arguments: 1548528575364

```

You aren't calling the command with the correct arguments... you are just passing it a timestamp

Maybe you don't need the  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/d16f5909694790460db7ea9285e562a14a796d47.png)

---

<div class="post-metadata">

**Author:** ![GridexX](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/gridexx/32/5142_2.png) [@GridexX](https://discourse.nodered.org/u/GridexX)\
**Post date:** [26 January 2019 19:40 UTC](https://discourse.nodered.org/t/problems-with-the-exec-bloc/7276/5 "2019-01-26T19:40:25Z")

</div>

Ok I just uncheck the append and it works !  
Thank you a lot 😙
