Zayik / CommandSender

Stream Deck plugin for sending UDP/TCP messages from a key press.
MIT License
15 stars 2 forks source link

No TCP? #6

Closed EduardoArtioli closed 2 years ago

EduardoArtioli commented 2 years ago

Repo description: About Stream Deck plugin for sending UDP/TCP messages from a key press.

But i see no option on Stream Deck app to send TCP packets.

Zayik commented 2 years ago

Thanks for catching that. I've updated the description. Right now it only support UDP, however, if supporting TCP is something that would be beneficial, I could very well look into adding that functionality.

Out of curiosity, how would you plan on using this tool if it supported tcp?

Zayik commented 2 years ago

Some additional questions: If Tcp support was added, consider the following questions/comments:

  1. Would all states of a button use the same ip/port when using tcp?
  2. Would user want to have one state use tcp and another use udp? Would that just overcomplicate issues?
EduardoArtioli commented 2 years ago

I have an home-automation equipment that uses Telnet protocol.

Supposing IP, 192.168.1.10 and port 23. Opening an TCP connection and then sending basics string commands like "100 1 1" ( That will turn on Light 1 )

Would be nice if i can change the icon from the button depending the returning state from this TCP connection, after sending 100 1 1, the module returns something like 100 1 2. Meaning the Light is now on.

Some additional questions: If Tcp support was added, consider the following questions/comments:

  1. Would all states of a button use the same ip/port when using tcp?
  2. Would user want to have one state use tcp and another use udp? Would that just overcomplicate issues?
  1. Supposing having multiple modules or server applications in the same network, selecting different IP/Port would be nice.
  2. I see applications where both udp and tcp could be used. Maybe creating separate plugins could keep off some issues.

Just one more thing: I tried to use websockets from Elgato plugin template, Telnet port 23 is blocked for websocket ws://, meaning only pure TCP client able to connect at this port.

Thank you for your availability.

Zayik commented 2 years ago

Sounds like your use case does need some special logic to it. Typically pressing a button changes the state. However, we now want to have a tcp response to confirm changing states. This means that we have to take care of handling long term tcp connections, as well as potentially being able to probe such server for the state of what it's looking at. This would be the case for when one has a disconnect for whatever reason (pc restarts). Certainly something that can be done but I feel there would have to be some agreement for the flow of actions, whether something is multistate, or just on/off. Also makes sense at this point to just have a unique button that is just on/off if that is the most common use case.

On Tue, Apr 12, 2022, 6:28 AM Eduardo Artioli @.***> wrote:

I have an home-automation equipment that uses Telnet protocol.

Supposing IP, 192.168.1.10 and port 23. Opening an TCP connection and then sending basics string commands like "100 1 1" ( That will turn on Light 1 )

Would be nice if i can change the icon from the button depending the returning state from this TCP connection, after sending 100 1 1, the module returns something like 100 1 2. Meaning the Light is now on.

Some additional questions: If Tcp support was added, consider the following questions/comments:

  1. Would all states of a button use the same ip/port when using tcp?

  2. Would user want to have one state use tcp and another use udp? Would that just overcomplicate issues?

  3. Supposing having multiple modules or server applications in the same network, selecting different IP/Port would be nice.

  4. I see applications where both udp and tcp could be used. Maybe creating separate plugins could keep off some issues.

Just one more thing: I tried to use websockets from Elgato plugin template, Telnet port 23 is blocked for websocket ws://, meaning only pure TCP client able to connect at this port.

Thank you for your availability.

— Reply to this email directly, view it on GitHub https://github.com/Zayik/CommandSender/issues/6#issuecomment-1096729289, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACEELKWKG46V6SGAZ4XJ5JLVEV27XANCNFSM5TECKXNA . You are receiving this because you commented.Message ID: @.***>

EduardoArtioli commented 2 years ago

Sure, for my case i see a whole new plugin designed for a specific remote module.

I see your plugin capable of turning the lights on by sending a payload over tcp, just like UDP is right now.

I am currently developing a Nodejs app to access Stream Deck, sadly is not a plugin for the oficial Elgato software, making distribution a pain.

Zayik commented 2 years ago

Hey @EduardoArtioli, it's been a crazy busy week, but I have finally had time to add some support.

I've updated the tool with TCP support. You can now choose how each state will send its message (via udp or tcp).

It should work nicely with setups that keep long-term tcp connections open, as well as setups that immediately close the tcp connection upon receiving message.

I think it should be fairly resilient in terms of tcp connections randomly closing. I am not adept at networking, so if any bugs do arise, just reach out to me and I'll squash them.

Thanks for your patience while I added this feature.