Android Question WEB Controller by TCP/IP

Discussion in 'Android Questions' started by laiberica, Feb 6, 2015.

  1. laiberica

    laiberica Member Licensed User

    Hello, im needing to connect to a web controller by TCP-IP which have an dyndns with user and password.
    I need to connect to it and send commands to control it.
    Can someone help me with it? Thanks
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    What type of authentication method does it use?
     
  3. laiberica

    laiberica Member Licensed User

    I dont understand the question, i send you by private the info. Thanks!
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    There are many authentication methods. You need to check this controller documentation to find out how you can connect to it.
     
  5. laiberica

    laiberica Member Licensed User

    With httpjob i can connect, but i dont know how i can execute commands on it

    example:

    Dim jobb As HttpJob

    jobb.Initialize("Jobb", Me)
    jobb.Username="DT"
    jobb.Password="XXXXXX"
    jobb.download("http://controlhXXX.dyndns.org")

    This works and connect good.

    With command "?Ox" (x=number) i can get output value for example, but i dont understand how use it...
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Do they provide any examples in their documentation?
     
  7. laiberica

    laiberica Member Licensed User

    Seller tell me that controller dont have authentication, i must connect by tcp/ip and send commands directly, i can use putty app and works fine localy.

    In this app that im developing i must connect with authentication because i use dyndns to connect of another place. Router connect directly to the controller.

    Any idea to send commands with httpjob or similar? Thanks!
     
  8. DanteS

    DanteS Member Licensed User

    When you connect to the server using Putty, do you receive some kind of cursor to know when the server is ready to begin talking?
    If so, check if you receive this character when you connect.
     
  9. laiberica

    laiberica Member Licensed User

    Hi, Putty works locally without dyndns, but i need to connect outside.

    Which character you say?
     
  10. DanteS

    DanteS Member Licensed User

    I asked first if you receive a cursor (sometimes a ">", or "-" or "$") once you connect locally to the device. If so, when you try to connect remotely, using an android device, you have to check if you receive the same character.
     
  11. DonManfred

    DonManfred Expert Licensed User

    Have you tried to use ssh library? It´s something like putty
     
  12. laiberica

    laiberica Member Licensed User

    SSH looks god, im trying to use, i have an error:

    SSH2.initialize("SSH", "xxxxxxx.dyndns.org", 80)
    SSH2.authenticateWithPassword("DT", "XXXXX")
    Log(SSH2.IsConnected) 'Log show false here

    SSH2.execCommand("?O1", 10)

    execCommand shows this error:
    android.os.NetworkOnMainThreadException
     
  13. lemonisdead

    lemonisdead Well-Known Member Licensed User

  14. laiberica

    laiberica Member Licensed User

    Thanks, the error dont appear more, but now it shows "SSH2.executingCommand" in loop, waiting but nothing..
     
  15. lemonisdead

    lemonisdead Well-Known Member Licensed User

    Please are you using jkSSH2 ? I ask you this because I took the time to test the library to check if it worked and I didn't got any "SSH2.executingCommand" in my logs.
    Tests done connecting to a remote server.

    The result I get is inside the sub
    Code:
    Sub SSH2_CmdExecuted (Success As Boolean, Result As List, TaskId As Int)
    End Sub
    While
    Code:
    SSH2.DebugOutput=True
     
  16. laiberica

    laiberica Member Licensed User

  17. laiberica

    laiberica Member Licensed User

    I was talking with controller manufacturer and tell me that i must connect by telnet.
    I Used puTTY and it works fine...
     
  18. laiberica

    laiberica Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice