# DAEMON msg delay

**URL:** <https://discourse.nodered.org/t/daemon-msg-delay/47134>\
**Category:** General\
**Created:** [14 June 2021 11:54 UTC](https://discourse.nodered.org/t/daemon-msg-delay/47134 "2021-06-14T11:54:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Napest](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/napest/32/55656_2.png) [@Napest](https://discourse.nodered.org/u/Napest)\
**Post date:** [14 June 2021 11:54 UTC](https://discourse.nodered.org/t/daemon-msg-delay/47134/1 "2021-06-14T11:54:54Z")

</div>

At first I would like to thank you for the work you are doing on node-red. I simply love it. It is not very often when I got stuck with something, becouse of outstanding documentation, forum and intuitiveness of node-red itself.

I would like to ask for explaining the behavior of node-red-node-daemon. See the situation: I have an CMD.exe application, which has its own set of commands. Daemon starts normally - shows running. Than I inject for CMD.exe specific commands:

| **INJECT** | **RECEIVED** |
| Command A | nothing |
| Command B | Response for Command A |
| Command C | Responce for Command B |

ect.

This is only working when "Add [enter] to every message sent ?" is checked. But it seems to me, that daemon adds [enter] in the begining of the message, thus it delays the output. Maybe it is caused by the CMD.exe, but when I check the behavior of it using command line, it works as it should - returns response for sent command.

Is there a way, how to look under the hood of daemon node and see, what is exactly fullfilling and returning? Debug node shows only the result, not the process.  
Is there a way, how to send [enter] via inject node? (Found discussion related to this, but the solution was to use ECHO - in this case it seems not to be possible).

Best regards, thanks in advanced  
Stepan

---

<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:** [14 June 2021 13:02 UTC](https://discourse.nodered.org/t/daemon-msg-delay/47134/2 "2021-06-14T13:02:58Z")

</div>

HI,

for Enter - rather than inject a type String... which will indeed take the \n character and send \ followed by n - try the JSON type as the "Command A\n" will send Command A(Enter).

Also does you cmd.exe buffer up it outputs ? certainly python apps do and so they only send results when the buffer is full or they finish unless told to send output unbuffered.

---

<div class="post-metadata">

**Author:** ![Napest](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/napest/32/55656_2.png) [@Napest](https://discourse.nodered.org/u/Napest)\
**Post date:** [15 June 2021 12:59 UTC](https://discourse.nodered.org/t/daemon-msg-delay/47134/3 "2021-06-15T12:59:44Z")

</div>

Hi,

this was pretty good tip, thank you for that. However the output is still one msg delayad. Eventhough I am now able to use [enter] alone, it does not output anything until Command, which outputs valid result, is applied. I am sure, that it is not buffering the output, but I will try to use -u suffix to prove that.

Neverthless by knowing the delay is present, it is possible to use it seamlessly.

Thank you for your help.

---

<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:** [14 August 2021 13:00 UTC](https://discourse.nodered.org/t/daemon-msg-delay/47134/4 "2021-08-14T13:00:13Z")

</div>

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