Results 1 to 20 of 32

Thread: QT interface with telnet (hyperterminal) connection. Plotting received data

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2011
    Posts
    26
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default QT interface with telnet (hyperterminal) connection. Plotting received data

    Hello everybody,

    I am newbie in QT, but this last month I have been dealing with C++ and the SDK environment. What I want to do is to focus properly in how to develop my application, which is explained in the following:

    I have a wireless device which can transmit 802.11 data. It creates a point to point network. I could do this (it has nothing to do with QT yet...) by the next steps:

    1- I connect to the network created (by using the windows manager).

    2- I do a telnet connection by the hyperterminal by using TCP/IP (Winsock) or executing "telnet 164.256.1.1 2000" directly from the console.

    3- Once it is done, I can send ASCII commands to retrieve data.

    Having said that, what I want to do is the steps 2 and 3 automatically and create a QT graphical interface for:

    a) Establish some buttons that send specific commands (in the same way I can do with the hyperterminal)

    b) Store data received from the device (they are sent in ASCII commands, which I could see in the hyperterminal) and to graph them in the QT graphical interface in "real time" (e.g. send the command "give the state of your output" each second and graph the reception in the graphical interface)

    Can you tell me how could I carry out this, or what could be a good starting point (libraries to use)? My main concern is how to manage the wifi connection (because I understand I am doing a telnet procotol in the application layer with TCP/IP protocol in the transport layer, using a wifi connection of type ad hoc -the device connected to my pc-), the graphical part I think can be easy once the connection with the device is established. Also, I would like to know if there is something already done, because I am almost sure that what I want to do can be done with QT.

    Any thought will be very useful, since I am in the starting point.

    Thanks a lot,

    -E

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QT interface with telnet (hyperterminal) connection. Plotting received data

    I do a telnet connection by the hyperterminal by using TCP/IP (Winsock) or executing "telnet 164.256.1.1 2000" directly from the console.

    3- Once it is done, I can send ASCII commands to retrieve data.

    Having said that, what I want to do is the steps 2 and 3 automatically and create a QT graphical interface for:

    a) Establish some buttons that send specific commands (in the same way I can do with the hyperterminal)

    b) Store data received from the device (they are sent in ASCII commands, which I could see in the hyperterminal) and to graph them in the QT graphical interface in "real time"
    If I get it right, I think QProcess sounds good for this task. You can start by reading docs here.

  3. #3
    Join Date
    Jun 2011
    Posts
    26
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default Re: QT interface with telnet (hyperterminal) connection. Plotting received data

    Hello Stampede,

    Thanks a lot for your answer. But maybe I did not explain very well what I want to do. I do not want to create a QT gui that connects with the hyperterminal. My intention is also to manage that connection with QT itself. Since I know it works with hyperterminal or executing "telnet 164.256.1.1 2000", I was wondering if this can be done with QT.
    Then what I want to know is how to send ASCII commands once the connection is established, as well as to receive them. Can it be possible?

    Regards,

    -E
    Last edited by Ethan; 8th July 2011 at 10:13.

  4. #4
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QT interface with telnet (hyperterminal) connection. Plotting received data

    Since I know it works with hyperterminal or executing "telnet 164.256.1.1 2000", I was wondering if this can be done with QT.
    Then what I want to know is to send ASCII commands once the connection is established, as well as to receive them. Can it be possible?
    I think you can open the "telnet 164.256.1.1" with QProcess, then you can write and read to / from it - to send commands use write method. You can receive them when waiting for readyRead signal and then calling one of read methods: read, readLine, getChar, readAllStandardOutput / readAllStandardError.

  5. #5
    Join Date
    Jun 2011
    Posts
    26
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default Re: QT interface with telnet (hyperterminal) connection. Plotting received data

    Thanks again.

    Yes, I could (i think) do that, but I see that Qtprocess is not compatible with Symbian for example, so I could not migrate my application to another system different from a pc. That's why I want to manage the connection without external applications and only with the QT libraries (i am taking a look now to QtTelnet class and the network examples that come with the SDK). Looking for other possible solutions .

    Thanks a lot,

    -E

  6. #6
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QT interface with telnet (hyperterminal) connection. Plotting received data

    Ok, good luck with your project
    I'm just curious, what do you mean by this:
    I see that Qtprocess is not compatible with Symbian for example
    Only limitation I see in documentation is related to some security requirements:
    On Symbian, processes which use the functions kill() or terminate() must have the PowerMgmt platform security capability. If the client process lacks this capability, these functions will fail.
    I'm not programming mobile devices, but I'm curious, can you post a link ?

  7. #7
    Join Date
    Jun 2011
    Posts
    26
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default Re: QT interface with telnet (hyperterminal) connection. Plotting received data

    Hello again!
    In the link you sent me I read "Note: On Windows CE and Symbian, reading and writing to a process is not supported." So I can guess I could have some problems when trying to migrate the application to symbian/android (not sure enough). Anyways I will try your solution. However, I am also curious. I seem to understand that with Qtprocess you are interacting with an external application. Don't you think we could establish the connection with the QT libraries themselves (maybe Qtcpsocket)?

    Thank you very much for your time,

    -E

  8. #8
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QT interface with telnet (hyperterminal) connection. Plotting received data

    Ok thanks, I missed that somehow.
    with Qtprocess you are interacting with an external application
    Thats correct, I thought about running telnet this way.
    Don't you think we could establish the connection with the QT libraries themselves (maybe Qtcpsocket)?
    I guess if you can connect by the "hyperterminal by using TCP/IP (Winsock) ", you can use sockets directly as well.

  9. #9
    Join Date
    Jun 2011
    Posts
    26
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default Re: QT interface with telnet (hyperterminal) connection. Plotting received data

    Thanks again!. Any other suggestions from the expert community ? In the meanwhile i'll be trying to solve it by myself. My intention is to publish the code after.

    Cheers,

    -E

  10. #10
    Join Date
    Dec 2008
    Location
    France
    Posts
    93
    Thanked 23 Times in 22 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: QT interface with telnet (hyperterminal) connection. Plotting received data

    Hi,
    I'm responding here according to the PM you sent.

    I used QtTelnet from QtSolutions in the past and it works fine for me. I have only used it under linux I can tell how it works in other worlds.
    Unfortunately QtSolutions is not managed anymore by Nokia , can be found here http://qt.gitorious.org/qt-solutions. QtTelnet seems to be available only for Qt 4.4 & Qt 4.5. I look quickly in the git where QtSolutions can be found but I found no reference to QtTelnet any more.

    If you are interested I should have a tarball somewhere with the source code of QtTelnet (a version which work fine with Qt 4.6.2), maybe you can compile it for your Qt version successfully.

    You can have an idea of what QtTelnet do at http://doc.qt.nokia.com/solutions/4/.../qttelnet.html

    In my case I used it to display on a PC remote log file in real time (tail -f /var/log/message on the telnet shell and display the result in a QTextEdit).

  11. #11
    Join Date
    Jun 2011
    Posts
    26
    Thanks
    3
    Thanked 3 Times in 3 Posts

    Default Re: QT interface with telnet (hyperterminal) connection. Plotting received data

    Hello Nix,

    Yes, I would be interested in the source code you used. I have to say that I am a little bit surprised that new versions of QT cannot manage a Telnet connection with an ad-hoc network. I "only" need to do something like "telnet 169.254.1.1 2000". With a terminal emulator it works fine, why should not I do this with QT only?

    I think some classes in the Network library can do this, but I am unable to find the way.

    Let me know if you can do the tarball you mentioned. I´ll continue looking for a solution.

    Thanks a lot,

    -E

Similar Threads

  1. Telnet connection does not establish...
    By gentlesea in forum Qt Programming
    Replies: 3
    Last Post: 11th July 2011, 09:54
  2. Methods to display received data
    By pupqt in forum Qt Programming
    Replies: 3
    Last Post: 18th April 2011, 09:50
  3. Plotting socket data
    By catto in forum Qwt
    Replies: 4
    Last Post: 6th March 2011, 08:01
  4. Replies: 2
    Last Post: 6th November 2010, 05:06
  5. Widget for data plotting
    By Benjamin in forum Qt Programming
    Replies: 3
    Last Post: 12th February 2009, 15:38

Tags for this Thread

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.