Results 1 to 6 of 6

Thread: QTcpSocket help

  1. #1
    Join Date
    Jun 2018
    Posts
    22
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default QTcpSocket help

    hai all,

    I have a Pan Tilt unit which is connected to a Laptop using ethernet port. Iam using QTcpSocket to connect to this device and it is getting connected. But when I am passing commands to Pan or Tilt the camera unit it is not responding. What will be the reason for this? Anyone has done this type of socket programming. Here server is this device.
    thanks in advance.

    PVR

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QTcpSocket help

    What will be the reason for this?
    Commands are not reaching the other end, commands are invalid, you are not receiving the response correctly, the remote device does not send a response... I am not sure what you expect us to do here. We have no idea what your code is doing. Perhaps if you showed what you had tried it would be obvious.

    Oh yes. Please stop opening new threads on the same topic. You already have this one and this and this.
    Last edited by ChrisW67; 4th November 2018 at 05:01.

  3. #3
    Join Date
    Jun 2018
    Posts
    22
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QTcpSocket help

    hai..

    My aim is to move the camera (azhimuth and elevation) which is mounted over the pan tilt unit. If I have to move the unit 20 degree azhimuth, the command should be AP2000.
    When connecting with QTcpSocket it shows connected, but after that no response. No idea about the device is receiving command.

    QTcpSocket *qtcp=new QTcpSocket(this);
    qtcp.connectToHost("192.168.1.41",80)// device ip
    if(qtcp.waitforConnected())
    {
    qDebug()<<"connected");
    qtcp.write("AP2000\n");
    }

    PVR

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QTcpSocket help

    the command should be AP2000.
    The device requires no setup? No commands sent for configuration, no handshaking, no nothing else before it gets a command to move?

    Since no one here has a clue about your hardware or how to use it, it might be better for you to consult the maufacturer's documentation or web site for information about how to program for this device and maybe see an example program for it.

    Your question really has nothing to do with Qt other than the fact that you are using Qt sockets.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    Jun 2018
    Posts
    22
    Qt products
    Qt5 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QTcpSocket help

    Thank u very much for the reply. The manufacturer used labview to operate this unit. But we want to control this unit from the GUI of qt.

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QTcpSocket help

    The manufacturer used labview to operate this unit.
    You should be able to read the commands issued via TCP in the LabView program and follow the same sequence using TCP in a Qt program.

    The problem is not Qt, it is the commands you send to the device and the syntax they use. Surely the manufacturer has a manual for this device that explains how to control it.

    But you have all of us guessing in the dark. You haven't told us anything about this device except that it is a "Pan Tilt unit". Who makes it? What model is it? What is the link to the manufacturer's web site?
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. QTCPSocket
    By A9am in forum Qt Programming
    Replies: 9
    Last Post: 3rd January 2014, 13:14
  2. QTcpSocket
    By Fallen_ in forum Qt Programming
    Replies: 5
    Last Post: 26th August 2010, 05:32
  3. Need Help with QTcpSocket
    By jknotzke in forum Qt Programming
    Replies: 2
    Last Post: 25th October 2009, 13:55
  4. QTcpSocket
    By pdoria in forum Qt Programming
    Replies: 1
    Last Post: 16th July 2009, 17:52
  5. QT4.2.2 and QTcpSocket
    By Nyphel in forum Qt Programming
    Replies: 13
    Last Post: 11th March 2007, 11:30

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.