Results 1 to 2 of 2

Thread: Send TCP command to control device

  1. #1
    Junior Member
    Join Date
    Jan 2008
    Posts
    87
    Thanks
    17
    Thanked 9 Times in 6 Posts
    Rep Power
    117
    Reputation
    95

    Default Send TCP command to control device

    Hi,

    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:
    IP: 192.168.1.166
    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...

    Thanks
    Last edited by mikey; 04-03-17 at 10:54 AM.



Look Here ->
  • #2
    Member
    Join Date
    Jan 2008
    Posts
    329
    Thanks
    20
    Thanked 72 Times in 51 Posts
    Rep Power
    146
    Reputation
    1064

    Default

    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.

  • Bookmarks

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •