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

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
    koahnig
    wrote on last edited by
    #12

    Thanks ZapB
    However, the serial com part is easy.
    How does
    @
    "/dev/ttyUSB0"
    @
    translate on a windows system?
    Is it
    @"\\.\USB0"@ ?

    Vote the answer(s) that helped you to solve your issue(s)

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #13

      Could you not use QExtSerialPort to simply list the available ports, instead of guessing their names?

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        ZapB
        wrote on last edited by
        #14

        /dev/ttyUSB0 is simply the name that the kernel (or udev or whatever else you are using) assigns to serial over USB devices ie when using a usb-serial convertor. So when using this type of device under windows the corresponding device is COM1.

        If you are not using a usb-serial convertor then you have to use the libusb functionality for communicating - that is you cannot simply use COM1 etc.

        Nokia Certified Qt Specialist
        Interested in hearing about Qt related work

        1 Reply Last reply
        0
        • K Offline
          K Offline
          koahnig
          wrote on last edited by
          #15

          [quote author="Andre" date="1303983404"]Could you not use QExtSerialPort to simply list the available ports, instead of guessing their names?[/quote]

          Not that I am aware off. Probably, you have to do it brute force by checking all com ports.

          [quote author="ZapB" date="1303983794"]If you are not using a usb-serial convertor then you have to use the libusb functionality for communicating - that is you cannot simply use COM1 etc.[/quote]

          That gives me something to chew on...

          Thanks for your valuable responses

          Vote the answer(s) that helped you to solve your issue(s)

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andre
            wrote on last edited by
            #16

            [quote author="koahnig" date="1303984402"]
            [quote author="Andre" date="1303983404"]Could you not use QExtSerialPort to simply list the available ports, instead of guessing their names?[/quote]

            Not that I am aware off. Probably, you have to do it brute force by checking all com ports.

            [/quote]

            There is an enumerator in the source code: http://qextserialport.cvs.sourceforge.net/viewvc/qextserialport/qextserialport/

            1 Reply Last reply
            0
            • K Offline
              K Offline
              koahnig
              wrote on last edited by
              #17

              [quote author="Andre" date="1303985184"]
              There is an enumerator in the source code: http://qextserialport.cvs.sourceforge.net/viewvc/qextserialport/qextserialport/
              [/quote]

              you mean the enum on NamingConvention ?
              I did not come across this yet. But it is nowherelse referenced. So it could be dead source.

              Vote the answer(s) that helped you to solve your issue(s)

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                ZapB
                wrote on last edited by
                #18

                No, there is a device enumeration function in qextserialport that probes what serial devices you have available.

                Nokia Certified Qt Specialist
                Interested in hearing about Qt related work

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #19

                  I mean this class: http://qextserialport.cvs.sourceforge.net/viewvc/qextserialport/qextserialport/qextserialenumerator.h?revision=1.3&view=markup

                  Sure, old code, and not in the docs, but the code is there...

                  1 Reply Last reply
                  0
                  • Z Offline
                    Z Offline
                    ZapB
                    wrote on last edited by
                    #20

                    BTW the sourceforge project is no longer active. The new home is "here":http://code.google.com/p/qextserialport/

                    Nokia Certified Qt Specialist
                    Interested in hearing about Qt related work

                    1 Reply Last reply
                    0
                    • K Offline
                      K Offline
                      koahnig
                      wrote on last edited by
                      #21

                      Got it!
                      Thanks again. Will try to use it. Apperently, it was not part of the example I have come across.

                      Vote the answer(s) that helped you to solve your issue(s)

                      1 Reply Last reply
                      0
                      • C Offline
                        C Offline
                        Candiman
                        wrote on last edited by
                        #22

                        @Koahnig, if I don't come right with libusb I can fall back on serial to USB as you suggested. Tnx for the link to qextserport.
                        @ZapB, tnx for the info serial to USB converter chip. If required I will modify my hardware and go the serial route.
                        I will post here again on completion of the project with info on how to do it for others that might find it useful.

                        1 Reply Last reply
                        0
                        • Z Offline
                          Z Offline
                          ZapB
                          wrote on last edited by
                          #23

                          OK. For info, the QStateMachine framework can be very handy for controlling hardware devices so it may be worth a look in you case. Good luck with your project.

                          Nokia Certified Qt Specialist
                          Interested in hearing about Qt related work

                          1 Reply Last reply
                          0
                          • K Offline
                            K Offline
                            koahnig
                            wrote on last edited by
                            #24

                            @Candiman Thx for feedback. Good to know that it helped. Good luck with your project. Please make sure to post a link in this thread. I am interested to see the outcome.
                            @ZapB Thx for updated link. Wasn't aware of this. There seem to be a couple of derivatives of the source floating around. Actually I started out with one, but some things required reversal. So it is good to know where the original source code is. Have fun.

                            Vote the answer(s) that helped you to solve your issue(s)

                            1 Reply Last reply
                            0
                            • AlicemirrorA Offline
                              AlicemirrorA Offline
                              Alicemirror
                              wrote on last edited by
                              #25

                              @all

                              Hi, I have found this thread because I have a similar problem.

                              I have to communicate with a serial external device folowing a simple yet precise protocol. I have tried a fast test to develop the protocol using RXTCComm java library that works not so good and now I was searching for a Qt approach that is the final goal of the other side of the device.

                              I try to put all your advices together and see if a working stuff can be done. If it maybe useful I put the project on the project area so who is interested can follow. As the project is ready and setup it will be on projects.forum.nokia.com/mill-machine I will announce it on t the forum appropriate area and in the Qt embedded group.

                              Cheers.

                              Anticipating many thanks to all.

                              Enrico Miglino (aka Alicemirror)
                              Balearic Dynamics
                              Islas Baleares, Ibiza (Spain)
                              www.balearicdynamics.com

                              1 Reply Last reply
                              0
                              • C Offline
                                C Offline
                                Candiman
                                wrote on last edited by
                                #26

                                Great. Tnx Alicemirror.

                                1 Reply Last reply
                                0
                                • D Offline
                                  D Offline
                                  dan_geo
                                  wrote on last edited by
                                  #27

                                  Hi. I have used rs232 communication in visual c++ 6.0
                                  which work very well. But because of my problem with
                                  transmit images trough socket in VC++ which is
                                  too complicated than Qt implementation ( very simple ).
                                  I need to implement rs232 comunication.
                                  My interface have to use TCP socket for internet comunication and rs232 for comunicate with microcontroller
                                  and electrical devices.

                                  1 Reply Last reply
                                  0
                                  • C Offline
                                    C Offline
                                    Candiman
                                    wrote on last edited by
                                    #28

                                    Hi dan_geo, let me know if you get your RS232 comms working with Qt. I have had to shift focus to a different project but during the downtime over the December holidays and from Jan 2012 I will be putting effort into the USB via Qt project again since many of my projects can benefit from having a GUI that I can design with Qt. I decided not to go with the RS232 option because so many PCs these days don't have a serial port. USB to serial converters are cheap, but if I can communicate directly with my device using USB then I don't need any additional hardware / drivers etc.
                                    Good luck!

                                    1 Reply Last reply
                                    0
                                    • D Offline
                                      D Offline
                                      dan_geo
                                      wrote on last edited by
                                      #29

                                      I have not get rs232 comm. Next days i will try to
                                      implement them in Qt. If you are a source, please
                                      sent to me. About usb, this task i will do later
                                      with PIC18F4455. At usb i understand that
                                      for make a host usb is more complicated than
                                      implement a usb client for example a controller.

                                      1 Reply Last reply
                                      0
                                      • D Offline
                                        D Offline
                                        dcbasso
                                        wrote on last edited by
                                        #30

                                        What its the best to access USB port:

                                        http://doc.qt.nokia.com/qtextended4.4/qserialport.html

                                        http://code.google.com/p/qextserialport/

                                        http://qt-apps.org/content/show.php/QSerialDevice?content=112039 (Updated)

                                        Thanks.

                                        1 Reply Last reply
                                        0
                                        • K Offline
                                          K Offline
                                          koahnig
                                          wrote on last edited by
                                          #31

                                          According to "this post":http://qt-project.org/forums/viewthread/15580/#90074 there is a wiki on "QtSerialPort":http://qt-project.org/wiki/QtSerialPort Apparently, the source is inherited from QSerialDevice.

                                          Vote the answer(s) that helped you to solve your issue(s)

                                          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