Results 1 to 10 of 10

Thread: qt serial port

  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default qt serial port

    I am using Qt 5. I need the serial class, I tried adding += serialport, but it fails. anyone knows which serial class is most suitable for serial communications (better be an interface class) as well as instructions to set it up in
    Linux ?

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: qt serial port

    I am using Qt 5. I need the serial class, I tried adding += serialport, but it fails.
    What happens?
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. #3
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt serial port

    Give more info.

    [telepathist mode]
    If you use QtSerialPort, then after building need to install library (maybe required superuser privileges for installation). See more info on WIKI!
    [/telepathist mode]

  4. #4
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: qt serial port

    Quote Originally Posted by Santosh Reddy View Post
    What happens?
    it gives the following error:
    :-1: error: [Makefile] Error 3 File no found

  5. #5
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt serial port

    And what? You really scoff at us?

    At such approach you won't receive any answers from us (from me).

  6. #6
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: qt serial port

    Quote Originally Posted by kuzulis View Post
    And what? You really scoff at us?

    At such approach you won't receive any answers from us (from me).
    I replied to Santosh question, as I was not sure if this module already exists in qt5 or shall installed as a seperate library. And... next time please make sure you are implying to the correct matter when you accuse members.

    anyway,

    My problem is with /usr/bin/moc-qt4, I already added /usr/bin/qt4 to the environment variable. but I cannot find anything called moc-qt4 in the system. I have qt 5 installed, but at we need qt4-qmake for libqtserial, I downloaded the package.

    Qt Code:
    1. # make
    2. cd src/ && make -f Makefile
    3. make[1]: Entering directory `/home/saman/5.0.1/serialPort src/qtserialport/src'
    4. cd serialport/ && make -f Makefile
    5. make[2]: Entering directory `/home/saman/5.0.1/serialPort src/qtserialport/src/serialport'
    6. /usr/bin/moc-qt4 -DQT_BUILD_SERIALPORT_LIB -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I. -I/include -I/include/QtSerialPort -I. qserialport.h -o moc_qserialport.cpp
    7. make[2]: /usr/bin/moc-qt4: Command not found
    8. make[2]: *** [moc_qserialport.cpp] Error 127
    9. make[2]: Leaving directory `/home/saman/5.0.1/serialPort src/qtserialport/src/serialport'
    10. make[1]: *** [sub-serialport-make_default] Error 2
    11. make[1]: Leaving directory `/home/saman/5.0.1/serialPort src/qtserialport/src'
    12. make: *** [sub-src-make_default-ordered] Error 2
    To copy to clipboard, switch view to plain text mode 
    Last edited by saman_artorious; 24th April 2013 at 15:18.

  7. #7
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: qt serial port

    lib-qt4-dev was missed!
    I cannot make, it cannot identify qtSerialPortInfo library.

    Qt Code:
    1. main.cpp:(.text.startup+0x5e): undefined reference to `QSerialPortInfo::availablePorts()'
    2. main.cpp:(.text.startup+0x10f): undefined reference to `QSerialPortInfo::isBusy() const'
    3. main.cpp:(.text.startup+0x16b): undefined reference to `QSerialPortInfo::hasProductIdentifier() const'
    4. main.cpp:(.text.startup+0x1bb): undefined reference to `QSerialPortInfo::hasVendorIdentifier() const'
    5. main.cpp:(.text.startup+0x212): undefined reference to `QSerialPortInfo::manufacturer() const'
    6. main.cpp:(.text.startup+0x24a): undefined reference to `QSerialPortInfo::description() const'
    7. main.cpp:(.text.startup+0x282): undefined reference to `QSerialPortInfo::systemLocation() const'
    8. main.cpp:(.text.startup+0x2ba): undefined reference to `QSerialPortInfo::portName() const'
    9. main.cpp:(.text.startup+0x644): undefined reference to `QSerialPortInfo::productIdentifier() const'
    10. main.cpp:(.text.startup+0x674): undefined reference to `QSerialPortInfo::vendorIdentifier() const'
    To copy to clipboard, switch view to plain text mode 

    why this happens? the QserialPortInfo.so file is already inside the src directory. I can also include it in qt application. but make fails!
    Last edited by saman_artorious; 24th April 2013 at 15:32.

  8. #8
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt serial port

    See my post #3 above.

  9. #9
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Thanks
    15
    Thanked 16 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: qt serial port

    Quote Originally Posted by kuzulis View Post
    See my post #3 above.
    that is not relevant to the question I asked anymore.

    to run the program, I forgot about the make error. I added the qserialport and qserialportinfo .so libraries to my current project. This way I also would not receive the Makefile error when I add serialport to config+=.

    is that a good idea?
    And I am not familiar with Qextserial class. I know that qserialport is created by developers and does not have much support. But, in my case if it supports threads (that it does) might suffice. what do you say?
    Last edited by saman_artorious; 24th April 2013 at 16:42.

  10. #10
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: qt serial port

    that is not relevant to the question I asked anymore.
    You wrong, it is important!

    I added the qserialport and qserialportinfo .so libraries to my current project. This way I also would not receive the Makefile error when I add serialport to config+=.

    is that a good idea?
    You do everything wrong. Re-read again and again attentively Wiki.

    And I am not familiar with Qextserial class.
    I'm too.

    I know that qserialport is created by developers and does not have much support.
    I didn't understand you, about what qserialport there is a speech?

    But, in my case if it supports threads (that it does) might suffice. what do you say?
    I don't understand you.


    PS:
    You jump from one subject on other subject of your topic. First you write that you compile for Qt5,
    next you write about problems with MOC from Qt4 and etc. It is difficult to me to watch a course of your
    thoughts. You mixed everything in a heap.

    Unclear that you want to make, etc.


    UPD: If you use QtSerialPort - that all exhaustive information on compilation, installation and use of library read in WIKI.
    I don't understand that isn't clear for you...

Similar Threads

  1. serial port communication
    By robotics in forum Qt Programming
    Replies: 19
    Last Post: 28th September 2011, 16:11
  2. data from serial port
    By bhe in forum Newbie
    Replies: 4
    Last Post: 3rd May 2009, 11:19
  3. serial port issues
    By jhowland in forum Qt Programming
    Replies: 7
    Last Post: 12th January 2009, 14:38
  4. serial port programming
    By sujatashooter in forum Qt Programming
    Replies: 1
    Last Post: 29th November 2008, 16:51
  5. Serial Port
    By b1 in forum Qt Programming
    Replies: 2
    Last Post: 18th January 2007, 03:05

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.