# Node red bigexec not working long string

**URL:** <https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718>\
**Category:** General\
**Created:** [26 May 2023 13:29 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718 "2023-05-26T13:29:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![azxo1](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@azxo1](https://discourse.nodered.org/u/azxo1)\
**Post date:** [26 May 2023 13:29 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/1 "2023-05-26T13:29:29Z")

</div>

Hello everyone!  
I would like to ask for your help below. I installed espeak on Rasperry pi 4. Thus, in Node Red, I can read a text payload on the raspberry via BigExec. This works with a shorter text, but no longer with a longer text. I have already set the BigExec buffer size to 10000000. Why doesn't it work with longer text? (sorry for my poor English)

```auto
[{ "id": "44a416b5b24ce976", "type": "inject", "z": "b0bfefcd25edc510", "name": "short string", "props": [ { "p": "payload" }], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "Sajnálom,énegymesterségesintelligenciavagyok,ésnemtudokpontosidőtadni,mertnemtudom,hogyholvagymost.Kérlek,ellenőrizdazeszközödönvagyazinternetenapontosidőtBudapesten", "payloadType": "str", "x": 640, "y": 880, "wires": [[ "eef0ac55bf76b8a5"] ] }, { "id": "d0ff7686ea0a5720", "type": "inject", "z": "b0bfefcd25edc510", "name": "long string", "props": [{ "p": "payload" }], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "Szia!Azalábbiakbantalálszegyegyszerű,definomkenyérreceptet:Hozzávalók:-500gliszt(lehetőlegbúzaliszt)-10gélesztő-1teáskanálsó-2,5dllangyosvízElkészítés:1.Alisztetésasótkeverdösszeegytálban.2.Azélesztőtmorzsoldbelealangyosvízbe,majdhagydállni5percig,amígfeloldódikéshaboslesz.3.Öntsdazélesztősvizetaliszthez,majdgyúrdösszeatésztát.Amikormáregyenletes,simatésztátkapsz,hagydpihenni10-15percig.4.Ezutángyúrdtovábbatésztát10-15percig,amígrugalmaséssimalesz.5.Formázdatésztátegygombóccá,majdteddegylisztezetttálba,éshagydállni1-2órát,amígatésztaduplájáranő.6.Melegítsdelőasütőt220fokra.7.Atésztátteddegysütőpapírralbélelttepsibe,majdvágjbelenéhánybevágástatetejébe.Haszeretnéd,szórdmegegykisliszttelatetejét.8.Süsd30-40percig,amígakenyéraranybarnárasül.Jóétvágyatkívánok!", "payloadType": "str", "x": 640, "y": 820, "wires": [[ "eef0ac55bf76b8a5"] ] }, { "id": "eef0ac55bf76b8a5", "type": "bigexec", "z": "b0bfefcd25edc510", "name": "", "command": "espeak -vhu+f5 -k5 -s150 -a 100 -g10", "commandArgs": "$1", "minError": 1, "minWarning": 1, "cwd": "", "shell": true, "extraArgumentProperty": "", "envProperty": "", "format": "base64", "limiter": true, "payloadIs": "argument", "x": 860, "y": 840, "wires": [[], [], [] ] } ]

```

This also only works with short text:

````auto
[
    {
        "id": "50dbddd457304cc9",
        "type": "bigexec",
        "z": "b0bfefcd25edc510",
        "name": "",
        "command": "/home/GalZoli/speech.sh",
        "commandArgs": "$1",
        "minError": 1,
        "minWarning": 1,
        "cwd": "",
        "shell": true,
        "extraArgumentProperty": "",
        "envProperty": "",
        "format": "utf8",
        "limiter": true,
        "payloadIs": "argument",
        "x": 960,
        "y": 1260,
        "wires": [
            [],
            [],
            []
        ]
    },
    {
        "id": "d0ff7686ea0a5720",
        "type": "inject",
        "z": "b0bfefcd25edc510",
        "name": "long string",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "Szia!Azalábbiakbantalálszegyegyszerű,definomkenyérreceptet:Hozzávalók:-500gliszt(lehetőlegbúzaliszt)-10gélesztő-1teáskanálsó-2,5dllangyosvízElkészítés:1.Alisztetésasótkeverdösszeegytálban.2.Azélesztőtmorzsoldbelealangyosvízbe,majdhagydállni5percig,amígfeloldódikéshaboslesz.3.Öntsdazélesztősvizetaliszthez,majdgyúrdösszeatésztát.Amikormáregyenletes,simatésztátkapsz,hagydpihenni10-15percig.4.Ezutángyúrdtovábbatésztát10-15percig,amígrugalmaséssimalesz.5.Formázdatésztátegygombóccá,majdteddegylisztezetttálba,éshagydállni1-2órát,amígatésztaduplájáranő.6.Melegítsdelőasütőt220fokra.7.Atésztátteddegysütőpapírralbélelttepsibe,majdvágjbelenéhánybevágástatetejébe.Haszeretnéd,szórdmegegykisliszttelatetejét.8.Süsd30-40percig,amígakenyéraranybarnárasül.Jóétvágyatkívánok!",
        "payloadType": "str",
        "x": 640,
        "y": 820,
        "wires": [
            [
                "eef0ac55bf76b8a5",
                "19ee9a6e1d8b779e",
                "6117a3c1.aea5ec",
                "50dbddd457304cc9"
            ]
        ]
    }
]```

````

speech.sh:

#!/bin/bash  
say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "[http://translate.google.com/translate\_tts?ie=UTF-8&client=tw-ob&q=$1&tl=hu](http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q=$1&tl=hu)";}  
say $1

```auto

```

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 May 2023 14:37 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/2 "2023-05-26T14:37:49Z")

</div>

In what way does it not work?

---

<div class="post-metadata">

**Author:** ![azxo1](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@azxo1](https://discourse.nodered.org/u/azxo1)\
**Post date:** [26 May 2023 14:38 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/3 "2023-05-26T14:38:38Z")

</div>

Read only the short text

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 May 2023 14:48 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/5 "2023-05-26T14:48:04Z")

</div>

Is there a reason you need to use BigExec?

---

<div class="post-metadata">

**Author:** ![azxo1](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@azxo1](https://discourse.nodered.org/u/azxo1)\
**Post date:** [26 May 2023 14:50 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/6 "2023-05-26T14:50:13Z")

</div>

I installed espeak. I created a speech.sh with the content above. I call this in Bigexec. The short text is read out on the speaker connected to the raspberry, but not the long text.

---

<div class="post-metadata">

**Author:** ![azxo1](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@azxo1](https://discourse.nodered.org/u/azxo1)\
**Post date:** [26 May 2023 14:52 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/7 "2023-05-26T14:52:10Z")

</div>

I can pass an argument to espeak in big exec. ($1)

---

<div class="post-metadata">

**Author:** ![azxo1](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@azxo1](https://discourse.nodered.org/u/azxo1)\
**Post date:** [26 May 2023 14:53 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/8 "2023-05-26T14:53:44Z")

</div>

[http://translate.google.com/translate\_tts?ie=UTF-8&client=tw-ob&q=Hello%20Colin!%20How%20are%20you?&tl=en](http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q=Hello%20Colin!%20How%20are%20you?&tl=en)

---

<div class="post-metadata">

**Author:** ![azxo1](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@azxo1](https://discourse.nodered.org/u/azxo1)\
**Post date:** [26 May 2023 14:55 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/9 "2023-05-26T14:55:56Z")

</div>

[https://espeak.sourceforge.net/index.html](https://espeak.sourceforge.net/index.html)

---

<div class="post-metadata">

**Author:** ![azxo1](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@azxo1](https://discourse.nodered.org/u/azxo1)\
**Post date:** [26 May 2023 15:19 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/10 "2023-05-26T15:19:18Z")

</div>

Actually TTS.  
script: /home/GalZoli/speech.sh

```auto
#!/bin/bash
say() { local IFS=+;/usr/bin/mplayer -ao alsa -really-quiet -noconsolecontrols "http://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q=$1&tl=hu";}
say $1

```

chmod u+x /home/GalZoli/speech.sh

sudo apt-get install mplayer , sudo apt-get install alsa-utils

```auto
[{ "id": "44a416b5b24ce976", "type": "inject", "z": "b0bfefcd25edc510", "name": "short string", "props": [ { "p": "payload" }], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "Sajnálom,énegymesterségesintelligenciavagyok,ésnemtudokpontosidőtadni,mertnemtudom,hogyholvagymost.Kérlek,ellenőrizdazeszközödönvagyazinternetenapontosidőtBudapesten", "payloadType": "str", "x": 640, "y": 880, "wires": [[ "eef0ac55bf76b8a5"] ] }, { "id": "d0ff7686ea0a5720", "type": "inject", "z": "b0bfefcd25edc510", "name": "long string", "props": [{ "p": "payload" }], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "Szia!Azalábbiakbantalálszegyegyszerű,definomkenyérreceptet:Hozzávalók:-500gliszt(lehetőlegbúzaliszt)-10gélesztő-1teáskanálsó-2,5dllangyosvízElkészítés:1.Alisztetésasótkeverdösszeegytálban.2.Azélesztőtmorzsoldbelealangyosvízbe,majdhagydállni5percig,amígfeloldódikéshaboslesz.3.Öntsdazélesztősvizetaliszthez,majdgyúrdösszeatésztát.Amikormáregyenletes,simatésztátkapsz,hagydpihenni10-15percig.4.Ezutángyúrdtovábbatésztát10-15percig,amígrugalmaséssimalesz.5.Formázdatésztátegygombóccá,majdteddegylisztezetttálba,éshagydállni1-2órát,amígatésztaduplájáranő.6.Melegítsdelőasütőt220fokra.7.Atésztátteddegysütőpapírralbélelttepsibe,majdvágjbelenéhánybevágástatetejébe.Haszeretnéd,szórdmegegykisliszttelatetejét.8.Süsd30-40percig,amígakenyéraranybarnárasül.Jóétvágyatkívánok!", "payloadType": "str", "x": 640, "y": 820, "wires": [[ "eef0ac55bf76b8a5"] ] }, { "id": "eef0ac55bf76b8a5", "type": "bigexec", "z": "b0bfefcd25edc510", "name": "", "command": "espeak -vhu+f5 -k5 -s150 -a 100 -g10", "commandArgs": "$1", "minError": 1, "minWarning": 1, "cwd": "", "shell": true, "extraArgumentProperty": "", "envProperty": "", "format": "base64", "limiter": true, "payloadIs": "argument", "x": 860, "y": 840, "wires": [[], [], [] ] } ]

```

But the longer text is not read aloud

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 May 2023 15:53 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/11 "2023-05-26T15:53:48Z")

</div>

> [@azxo1](#):
>
> I can pass an argument to espeak in big exec.

Can't you pass the string in the payload using the exec node?

---

<div class="post-metadata">

**Author:** ![azxo1](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@azxo1](https://discourse.nodered.org/u/azxo1)\
**Post date:** [26 May 2023 15:55 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/12 "2023-05-26T15:55:34Z")

</div>

But yes. Just copy the above example into Node-red and you will see it

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 May 2023 16:21 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/13 "2023-05-26T16:21:16Z")

</div>

Do you mean it fails with the builtin Exec node too?  
If so then connect debug nodes to all three outputs, set them to Output Complete Message and show us what you get when it fails

> [@azxo1](#):
>
> Just copy the above example into Node-red and you will see it

I have not got the nodes installed.

---

<div class="post-metadata">

**Author:** ![azxo1](https://avatars.discourse-cdn.com/v4/letter/a/b487fb/32.png) [@azxo1](https://discourse.nodered.org/u/azxo1)\
**Post date:** [27 May 2023 14:00 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/14 "2023-05-27T14:00:41Z")

</div>

Thank you very much, this might have solved one of my problems.

```auto
context.queue = context.queue || [];
context.busy = context.busy || false;

// if the msg is a trigger one release next message
if (msg.hasOwnProperty("trigger")) {
    if (context.queue.length > 0) {
        var m = context.queue.shift();
        return {payload:m};
    }
    else {
        context.busy = false;
    }
}
else {
    if (context.busy) {
        // if busy add to queue
        context.queue.push(msg.$1);
    }
    else {
        // otherwise we are empty so just pass through and set busy flag
        context.busy = true;
        return msg;
    }
}

return null;

```

---

<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:** [26 July 2023 14:01 UTC](https://discourse.nodered.org/t/node-red-bigexec-not-working-long-string/78718/15 "2023-07-26T14:01:17Z")

</div>

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