USB Communication Using Qt
-
wrote on 28 Apr 2011, 12:50 last edited by
No, there is a device enumeration function in qextserialport that probes what serial devices you have available.
-
wrote on 28 Apr 2011, 13:04 last edited by
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...
-
wrote on 28 Apr 2011, 13:09 last edited by
BTW the sourceforge project is no longer active. The new home is "here":http://code.google.com/p/qextserialport/
-
wrote on 28 Apr 2011, 13:16 last edited by
Got it!
Thanks again. Will try to use it. Apperently, it was not part of the example I have come across. -
wrote on 30 Apr 2011, 03:47 last edited by
@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. -
wrote on 30 Apr 2011, 06:53 last edited by
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.
-
wrote on 30 Apr 2011, 16:04 last edited by
@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. -
wrote on 29 Jun 2011, 15:52 last edited by
@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.
-
wrote on 30 Jun 2011, 01:47 last edited by
Great. Tnx Alicemirror.
-
wrote on 28 Dec 2011, 17:49 last edited by
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. -
wrote on 31 Dec 2011, 06:10 last edited by
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! -
wrote on 31 Dec 2011, 08:17 last edited by
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. -
wrote on 3 Jul 2012, 12:56 last edited by
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.
-
wrote on 3 Jul 2012, 13:29 last edited by
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.
-
wrote on 4 Jul 2012, 13:05 last edited by
It's possible to use the QtSerialPort on QT4? On this page (see: http://qt-project.org/wiki/Building-Qt-5-from-Git#15e7b6ad3df43ff719f8388ab4afb1cc) show thats is possible but he only explains to build in qt5!
Anyone is using on QT4? The example there show only to build on Windows, not on linux...
-
wrote on 4 Jul 2012, 13:49 last edited by
Well, I compile using QT Creator 4.8.1, now I copy the compile folder "QtAddOnSerialPort" to directory:
"../bin/QtSDK/Desktop/Qt/4.8.1/gcc/include/."
This will be enough to work with SerialPort/USB on QT?
Thanks all!
-
Possible.
Build and install process:
bq. $mkdir serialport-build $cd serialport-build $qmake ../qtserialport/serialport.pro $make (or nmake) $make install (or nmake install) Note: But in Windows, this build and install only the Debug version. To build and install Release version - just repeat the steps again, with: bq. $qmake ../qtserialport/serialport.pro CONFIG+=release use: ~~~ your custom *.pro file: bq. CONFIG += serialport your *.cpp file: @#include <QtAddOnSerialPort/serialport.h> #include <QtAddOnSerialPort/serialportinfo.h> QT_USE_NAMESPACE_SERIALPORT@
-
wrote on 4 Jul 2012, 14:32 last edited by
hi kuzulis, from QtCreator I build and appears to works fine... Doing the make as you said give me an error...
I have already copy and past the folder "QtAddOnSerialPorta" to “../bin/QtSDK/Desktop/Qt/4.8.1/gcc/include/.” and QtCreator find the includes:@
#include <QtAddOnSerialPort/serialport.h>
#include <QtAddOnSerialPort/serialportinfo.h
@I'm trying to run the example on that page but doesn't works.... the errors:
"Undefined reference to 'QtAddOn::SerialPort::SerialPortInfo::avaliablePorts()'"
... (more others 14 similar erros) -
wrote on 4 Jul 2012, 14:47 last edited by
Sorry I made some mistake:
When I try to compile on Qt using 4.6.1 or using the make on shell It gives me this error:
moc_serialport.cpp:55:16: error: ‘SerialPort’ was not declared in this scope
On the QT 4.8.1 the Qt Creator gives the message:
...
#error (moc changes too much)
... -
wrote on 4 Jul 2012, 14:54 last edited by
I try again, reopening the project and now works... but now I'm very confused!