Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. USB Communication Using Qt
QtWS25 Last Chance

USB Communication Using Qt

Scheduled Pinned Locked Moved 3rd Party Software
57 Posts 13 Posters 110.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kuzulis
    Qt Champions 2020
    wrote on 4 Jul 2012, 19:09 last edited by
    #43

    I do not know what you did - but I have everything working well.

    1.To start, try to remove all the headers, libraries, etc. QtSerialPort of the your *nix OS.
    2. Download the latest version of the library
    3. Build and install library to the system step-by-step, see an new updated manual in the Wiki.
    4. Create a new blank project and include the library as stated in the Wiki

    More anything, I can not help you, because I can not control all of your "curves" action.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      dcbasso
      wrote on 4 Jul 2012, 19:11 last edited by
      #44

      Sorry guys... to many posts here about this problem but:

      Now I got another error:

      #include "qglobal.h"
      "qglobal.h not such file or directory

      • I post it before you answer me kuzulis
      1 Reply Last reply
      0
      • D Offline
        D Offline
        dcbasso
        wrote on 4 Jul 2012, 19:17 last edited by
        #45

        Well... I will try once again...
        Thanks anyway!

        1 Reply Last reply
        0
        • F Offline
          F Offline
          franku
          wrote on 5 Jul 2012, 20:15 last edited by
          #46

          You may want to have a look at "libusb-win32":http://sourceforge.net/apps/trac/libusb-win32/wiki. It depens wether you are using ftdi chips for the µC side, or want to build your usb-client on the controller yourself. For attaching a device very simple try to use the ftdi232 with either vcp or d2xx usage. I.e. "ftdi-link":http://www.ftdichip.com/Products/ICs/FT231X.html
          .. frank

          This, Jen, is the internet.

          1 Reply Last reply
          0
          • D Offline
            D Offline
            dcbasso
            wrote on 5 Jul 2012, 20:22 last edited by
            #47

            My client is using the µC "NXP LPC2366", I have the driver for him!
            I need to build a app which will run at on windows, linux and Mac OS.

            That the way I'm trying to use the QtSerialPort!

            I'm doing something wrong in the conception off app?

            1 Reply Last reply
            0
            • F Offline
              F Offline
              franku
              wrote on 5 Jul 2012, 20:53 last edited by
              #48

              The "chips":http://www.ftdichip.com/Drivers/VCP.htm do have drivers for several os. Using your own driver has to supply your own usb VID. Which library you use may depend on the way you want to build it and if you want to use polling or event driven mode to receive data. However, I've used QExtSerialport for Windows and it works fine using a QThread polling the data once a msec.

              This, Jen, is the internet.

              1 Reply Last reply
              0
              • K Offline
                K Offline
                kuzulis
                Qt Champions 2020
                wrote on 6 Jul 2012, 06:57 last edited by
                #49

                bq. My client is using the µC “NXP LPC2366”, I have the driver for him!

                I have questions:

                1. NXP LPC2366 It's ARM MCU?
                2. The client uses the "native" serial interface of MCU (USART), or emulation via the USB interface of MCU?
                3. If the emulation, then it serial port correct whether is determined by SerialPortInfo::availablePorts() (QtSerialPort) ? If incorrectly - that let me know.

                bq. However, I’ve used QExtSerialport for Windows and it works fine using a QThread polling the data once a msec.

                Polling to use threads - this is redundant and inefficient, and I do not believe that you get exactly 1 ms. But this is offtopic.

                1 Reply Last reply
                0
                • D Offline
                  D Offline
                  dcbasso
                  wrote on 7 Jul 2012, 12:01 last edited by
                  #50

                  Well kuzulis, you make some technical questions that in the moment I cannot answer you!
                  I GUESS that my client is using the "native" serial interface of ARM, he sends to me the Windows Driver (.INF), it can help me for something?

                  I have build another time the QtSerialPort using the QtCreator, and now I have some others files:

                  @
                  QtAddOnSerialPort/
                  QtAddOnSerialPortVersion
                  serialport-global.h
                  serialportinfo.h
                  headers.pri
                  qtaddonserialportversion.h
                  serialport.h
                  1.0.0/
                  QtAddOnSerialPort/
                  private/
                  qringbuffer_p.h
                  serialportengine_symbian_p.h
                  serialportinfo_p.h
                  qwineventnotifier_p.h
                  serialportengine_unix_p.h
                  serialport_p.h
                  serialportengine_p.h
                  serialportengine_win_p.h
                  ttylocker_unix_p.h
                  @

                  This is correct?
                  Missing something?
                  Thanks!

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kuzulis
                    Qt Champions 2020
                    wrote on 7 Jul 2012, 18:26 last edited by
                    #51

                    bq. I GUESS that my client is using the “native” serial interface of ARM, he sends to me the Windows Driver (.INF),

                    If the driver, so it's not "native" USART, I guess it emulates in the MCU via USB. For native USART of MCU driver is not needed.

                    bq. it can help me for something?

                    Probably. You can here show this *.inf file?

                    bq. This is correct? Missing something?

                    Most likely you have build a library for Qt5. For Qt5 is correct.
                    After build on Qt5, the QtSerialPort libraries (debug and release) is automatically copied to Qt5/qtbase/bin and Qt5/qtbase/lib, then you need to run "make install" (or nmake install) and these header files are also copied to the Qt5/include

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      dcbasso
                      wrote on 9 Jul 2012, 11:50 last edited by
                      #52

                      Follow the .inf file:

                      @
                      [Version]
                      Signature="$Windows NT$"
                      Class=Ports
                      ClassGUID={4d36e978-e325-11ce-bfc1-08002be10318}
                      Provider=%SEVA%
                      DriverVer=03/21/2012,1.0.1

                      [SourceDisksFiles]

                      [SourceDisksNames]

                      [Manufacturer]
                      %SEVA%=SEVA_, NTx86, NTamd64

                      [SEVA_]
                      %SEVA_CDC&PID_FAFC%=SevaVirCOM,USB\VID_0471&PID_FAFC

                      [SEVA_.NTx86]
                      %SEVA_CDC&PID_FAFC%=SevaVirCOM,USB\VID_0471&PID_FAFC

                      [SEVA_.NTamd64]
                      %SEVA_CDC&PID_FAFC%=SevaVirCOM,USB\VID_0471&PID_FAFC

                      ;**************************************************
                      ;* Windows NT family *
                      ;**************************************************
                      [SevaVirCOM.NT]
                      include=mdmcpq.inf
                      CopyFiles=FakeModemCopyFileSection
                      AddReg=SevaVirCOM.NT.AddReg

                      [SevaVirCOM.NT.AddReg]
                      HKR,,DevLoader,,*ntkern
                      HKR,,NTMPDriver,,usbser.sys
                      HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"

                      [SevaVirCOM.NTx86]
                      include=mdmcpq.inf
                      CopyFiles=FakeModemCopyFileSection
                      AddReg=SevaVirCOM.NT.AddReg

                      [SevaVirCOM.NTx86.Services]
                      AddService=usbser, 0x00000002,SevaVirCOMService_Inst

                      [SevaVirCOM.NTamd64]
                      include=mdmcpq.inf
                      CopyFiles=FakeModemCopyFileSection
                      AddReg=SevaVirCOM.NT.AddReg

                      [SevaVirCOM.NTamd64.Services]
                      AddService=usbser, 0x00000002,SevaVirCOMService_Inst

                      [SevaVirCOMService_Inst]
                      DisplayName=%SevaVirCOM.SvcDesc%
                      ServiceType=1
                      StartType=3
                      ErrorControl=1
                      ServiceBinary=%\usbser.sys
                      LoadOrderGroup=Base

                      ;**************************************************
                      ;* Strings *
                      ;**************************************************
                      [Strings]
                      SEVA="SEVA Engenharia"
                      SEVA_CDC&PID_FAFC="SEVA Virtual COM port, SEVA BDV"
                      SevaVirCOM.SvcDesc="SEVA Virtual COM port"
                      @

                      bq.
                      Most likely you have build a library for Qt5. For Qt5 is correct.
                      After build on Qt5, the QtSerialPort libraries (debug and release) is automatically copied to Qt5/qtbase/bin and Qt5/qtbase/lib, then you need to run “make install” (or nmake install) and these header files are also copied to the Qt5/include
                      bq.

                      I have compiled using Qt Creator 4 (4.8) it will woks anyway?

                      1 Reply Last reply
                      0
                      • K Offline
                        K Offline
                        kuzulis
                        Qt Champions 2020
                        wrote on 9 Jul 2012, 13:04 last edited by
                        #53

                        Yes, Qt4.8 also supported.
                        But the resulting output files (headers, features, library) in the case of build QtSerialPort for Qt4 are different from case of build for Qt5.

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          dcbasso
                          wrote on 9 Jul 2012, 18:02 last edited by
                          #54

                          I try to use the http://code.google.com/p/qextserialport/ and know I Could list the serial port on my PC.
                          But I would like to use the QtSerialPort, but need be easer to use!

                          I will keep trying to use QtSerialPort. Thanks.

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            simonmeaden
                            wrote on 28 Aug 2012, 18:34 last edited by
                            #55

                            I have just downloaded QtSerialport and am attempting to compile it on Fedora 17 with gcc and I get a

                            'QFile' was not declared in this scope error.

                            I have libudev installed.

                            In fact as far as I can see the error is correct as the error is in
                            @
                            bool SerialPortInfo::isValid() const
                            {
                            QFile f(systemLocation());
                            return f.exists();
                            }
                            @
                            and qfile.h is in the other part of the code. If I copy the qfile.h include to just outside the extern C section it compiles OK.
                            @
                            extern "C"
                            {
                            #include <libudev.h>
                            }
                            #else
                            #include <QtCore/qdir.h>
                            #include <QtCore/qstringlist.h>
                            #include <QtCore/qfile.h>
                            #endif
                            @
                            Not certain if this is a bug or someting in my system but thought it was worth reporting..

                            [edit: code tags added, koahnig]

                            1 Reply Last reply
                            0
                            • K Offline
                              K Offline
                              kuzulis
                              Qt Champions 2020
                              wrote on 29 Aug 2012, 06:55 last edited by
                              #56

                              2 simonmeaden

                              It already seems to be fixed.

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                simonmeaden
                                wrote on 29 Aug 2012, 15:33 last edited by
                                #57

                                Yes it may be a problem with my setup. I am writing an application on Windows XP and Linux using Qt 4.8.1 and I am having different problems with each. The above problem with Linux and the, ‘SerialPort’ was not declared in this scope, problem with moc_serialport.cpp that was reported earlier. I have tried manually making the library as you suggested earlier and also using QtCreator with the same result.

                                I have also tried compiling on XP using MinGW and on Linux using MinGW with the same result. Still working on it.

                                1 Reply Last reply
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved