# Basic Node-RED telnet question

**URL:** <https://discourse.nodered.org/t/basic-node-red-telnet-question/12054>\
**Category:** General\
**Created:** [10 June 2019 23:11 UTC](https://discourse.nodered.org/t/basic-node-red-telnet-question/12054 "2019-06-10T23:11:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hazymat](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/hazymat/32/108159_2.png) [@hazymat](https://discourse.nodered.org/u/hazymat)\
**Post date:** [10 June 2019 23:11 UTC](https://discourse.nodered.org/t/basic-node-red-telnet-question/12054/1 "2019-06-10T23:11:26Z")

</div>

Sorry if this is a rather basic question...

My projector is connected to the LAN. I'd like to switch it on over telnet.

I can do this in Windows as follows:

- When I connect, it prompts for a password which I type in e.g. `1234 [enter]`
- It returns `Hello`.
- I then type `C00 [enter]` to switch the projector on
- I can type `C02 [enter] C02 [enter]` to switch it off (once to request power off, second time to confirm)

I have a basic function node like this:

```auto
msg.payload = '\n';
node.send(msg);
msg.payload = '1234\n';
node.send(msg);
msg.payload = 'C00\n';
node.send(msg);

```

plugged in to the TCP request node, set to return Never - keep the request open.

But it doesn't seem to work. I've set the output of the TCP request node to a function:

```auto
msg.payload = msg.payload.toString();
return msg;

```

then to a debug node, and I see:

> 6/11/2019, 12:09:43 AM[node: b0162d2f.c5451](http://10.1.1.37:1880/red/#)msg.payload : string[12]
> 
> "↵PASSWORD: "
> 
> 6/11/2019, 12:09:43 AM[node: b0162d2f.c5451](http://10.1.1.37:1880/red/#)msg.payload : string[12]
> 
> "\*\*\*\*\*\*\*\*\*\*\*\*"

Any idea what's going on here?

---

<div class="post-metadata">

**Author:** ![Urs-Eppenberger](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/urs-eppenberger/32/28_2.png) [@Urs-Eppenberger](https://discourse.nodered.org/u/Urs-Eppenberger)\
**Post date:** [11 June 2019 06:30 UTC](https://discourse.nodered.org/t/basic-node-red-telnet-question/12054/2 "2019-06-11T06:30:59Z")

</div>

Nice idea, cool. Without access to the device it is a little guesswork from my side. But here I go anyway:

From the answers in the debug output, this looks promising.  
One thing to try is, send \r\n instead of just \n

Another thing to try: you hammer out password and command quickly one after the other. Sometimes the receiving devices can't handle it all. Adding a short delay might help.

And then there is the obvious but more complex issue. Send one string, wait for the answer, then send the next string. But I suggest to try the first two ideas first.  
Kind regards,  
Urs.
