- Rep Power
Send TCP command to control device
I only have basic HTML experience, but I am learning.... fast.
What I need to do is to control a physical relay via a web browser. In essence, a user clicks on a button in a page, and the relay is triggered.
I need to send TCP commands such as the following scenario:
TCP Port: 1234
TCP Command to send: 11
In short, what is the easiest way to do this? I have used packet sender to send the above information and it works, just not sure how to incorporate it into a button in a web site.
I have the page written with all the buttons and content, just need to figure out how to open the socket and sent the command!
I have learnt quite a bit by looking at code and tying things together.
Any help would be appreciated. Google is not returning the results I am seeking...
Last edited by mikey; 04-03-17 at 09:54 AM.
You can use php (and I assume java scripting too) and sockets - "fsockopen" and "socket_connect" will be your starting friend. From memory it depends on which version of php you are using, but do some googling about those two commands and you should be able to come up with something to achieve what you are after.
Members who have read this thread: 14