So I’ve created a flow in an attempt to turn on a light and/or get the status of a light via node red.
I have my input injection that pasts a string to the function “tcp request”. This string matches the spec for passing information over tcp to my lighting controller. The first time I do the injection it works. The light turns on, the return message is what I expect. However, the next time I press the injection. Nothing occurs and it continues to show connected to the controller. It seems it get stuck in this connection. I have to stop node-red or redeploy and stop HA because now the requests or commands get backed up or something (not sure exactly).
May be a quirk or the receiving end. The TCP request does have a “close connection after each message” option. That ensures a fresh tcp connection each time which may work better.
I read my documentation again, and I think the problem is I’m not ending the message with the right character “\r”. I’ll try this when I get home, if that doesn’t work I’ll take a look at your suggestion.
this fixed it. my controller was expecting a different ending character. Thus after the first message, it was holding on to it because it wasn’t told the message was done. Adding the \r to the end of my message now allows it to work quickly. I had \n in their previously based on what others have stated, but since mine was expecting something different it didn’t work! Glad to know I wasn’t using it right.