C++ (boost) library for serial port communication
Hi all, I wonder if there is a boost-library that enables easy and robust communication to a serial port, just as e.g. the python library pyserial does. Maybe there is a boost-library which can be used for those purpose instead of implementing my own C-style classes and functions? Thanks a lot, Alex
I have the same need. It appears boost::asio provides a good place to start. Here's an example I found. http://www.webalice.it/fede.tft/serial_port/serial_port.html I'd love to hear any other expert opinions on the best approach to this as well. SGL steven.lemay@igt.com -----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users-bounces@lists.boost.org] On Behalf Of Alexander Dietz Sent: Thursday, September 27, 2012 8:46 AM To: boost-users@lists.boost.org Subject: [Boost-users] C++ (boost) library for serial port communication Hi all, I wonder if there is a boost-library that enables easy and robust communication to a serial port, just as e.g. the python library pyserial does. Maybe there is a boost-library which can be used for those purpose instead of implementing my own C-style classes and functions? Thanks a lot, Alex _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On 09/28/2012 01:58 AM, Lemay.Steve wrote:
I have the same need. It appears boost::asio provides a good place to start. [...]
I'd love to hear any other expert opinions on the best approach to this as well.
I'm by no means an expert but I'm using Asio for serial port communication (on Windows only) for a few years now without any issues. I'm mostly controling projectors but also connected some light and trigger control boards. As long as the (virtual) COM device is available I didn't have any problems with Asio. Also I don't know of any other library (inside or outside Boost) besides the OS specific ones, but I have to admit I didn't look around much, since I already had Asio based network code and the Asio serial communication worked flawlessly. Norbert
I have the same need. It appears boost::asio provides a good place to start. Here's an example I found.
http://www.webalice.it/fede.tft/serial_port/serial_port.html
I'd love to hear any other expert opinions on the best approach to
On 09/28/2012 01:58 AM, Lemay.Steve wrote: this as well.
SGL steven.lemay@igt.com
Hello!
I have already used this class to implement communication with serial devices in a professional environment. There's actually not much to say about it, since its use is so easy and straightforward.
Regards,
Andreas
I forgot to mention, that I've been using this on Windows as well as (embedded) Linux platforms. Am using it for controlling radio devices. Regards -- Dipl.-Ing. (FH) Andreas Wehrmann Software Development -------------------------------------------------------------- Center Communication Systems GmbH A-1210 Wien, Ignaz-Köck-Straße 19 Sitz in Wien FN 796 88p, Firmenbuchgericht Wien www.centersystems.com Tel.: +43 (0) 190 199 - 3616 Mobile: +43 (0) 664 884 75916 Fax: +43 (0) 190 199 - 2110 E-Mail: a.wehrmann@centersystems.com
Hi,
this example is really useful, I created a class to talk to a serial
modem. However, the 'talking ' usually does not work! I am sending an
AT\r to the modem and wait for an OK. In most of the cases the code
waits and waits and waits and nothing is happening. Any ideas what to
check? Or what mailing list/forum to ask this question?
Thanks
Alex
On Fri, Sep 28, 2012 at 8:39 AM, Andreas Wehrmann
On 09/28/2012 01:58 AM, Lemay.Steve wrote:
I have the same need. It appears boost::asio provides a good place to start. Here's an example I found.
http://www.webalice.it/fede.tft/serial_port/serial_port.html
I'd love to hear any other expert opinions on the best approach to this as well.
SGL steven.lemay@igt.com
Hello!
I have already used this class to implement communication with serial devices in a professional environment. There's actually not much to say about it, since its use is so easy and straightforward.
Regards,
Andreas
I forgot to mention, that I've been using this on Windows as well as (embedded) Linux platforms. Am using it for controlling radio devices.
Regards
-- Dipl.-Ing. (FH) Andreas Wehrmann Software Development -------------------------------------------------------------- Center Communication Systems GmbH A-1210 Wien, Ignaz-Köck-Straße 19 Sitz in Wien FN 796 88p, Firmenbuchgericht Wien www.centersystems.com
Tel.: +43 (0) 190 199 - 3616 Mobile: +43 (0) 664 884 75916 Fax: +43 (0) 190 199 - 2110 E-Mail: a.wehrmann@centersystems.com _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi Alex,
The first check I would do is to check if there is really something send over the serial line, e.g. with a serial line sniffer. Further check the parameters for the serial connection: baud rate, start, stop and data bits. This should be the same as what your modem is expecting.
I have not looked at the code yet. But that's the next step, especially if there is nothing going over the serial line and the serial parameters are correct.
Regards,
Jan
On 2 okt. 2012, at 16:31, Alexander Dietz
Hi,
this example is really useful, I created a class to talk to a serial modem. However, the 'talking ' usually does not work! I am sending an AT\r to the modem and wait for an OK. In most of the cases the code waits and waits and waits and nothing is happening. Any ideas what to check? Or what mailing list/forum to ask this question?
Thanks Alex
On Fri, Sep 28, 2012 at 8:39 AM, Andreas Wehrmann
wrote: On 09/28/2012 01:58 AM, Lemay.Steve wrote:
I have the same need. It appears boost::asio provides a good place to start. Here's an example I found.
http://www.webalice.it/fede.tft/serial_port/serial_port.html
I'd love to hear any other expert opinions on the best approach to this as well.
SGL steven.lemay@igt.com
Hello!
I have already used this class to implement communication with serial devices in a professional environment. There's actually not much to say about it, since its use is so easy and straightforward.
Regards,
Andreas
I forgot to mention, that I've been using this on Windows as well as (embedded) Linux platforms. Am using it for controlling radio devices.
Regards
-- Dipl.-Ing. (FH) Andreas Wehrmann Software Development -------------------------------------------------------------- Center Communication Systems GmbH A-1210 Wien, Ignaz-Köck-Straße 19 Sitz in Wien FN 796 88p, Firmenbuchgericht Wien www.centersystems.com
Tel.: +43 (0) 190 199 - 3616 Mobile: +43 (0) 664 884 75916 Fax: +43 (0) 190 199 - 2110 E-Mail: a.wehrmann@centersystems.com _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Met vriendelijke groet, Jan Krabbenbos jan.krabbenbos@gmail.com
Hello!
First of all I'd make sure that the modem actually responds.
I had problems with my USB-Serial Adapter that sometimes I wasn't able
to transmit/receive any data over it, reopening the port or replugging
it to the computer
helped there.
You can do this i.e. by using a terminal application (Hyperterminal,
Minicom, TeraTerm)
and try to talk to the modem there. When you're sure it works, try
your application.
Also (even if it doesn't say so in the docs) try to send "AT\r\n"
if you don't receive anything with just "AT\r"; I guess this depends
on the modem firmware...
Regards,
Andreas
Zitat von Alexander Dietz
Hi,
this example is really useful, I created a class to talk to a serial modem. However, the 'talking ' usually does not work! I am sending an AT\r to the modem and wait for an OK. In most of the cases the code waits and waits and waits and nothing is happening. Any ideas what to check? Or what mailing list/forum to ask this question?
Thanks Alex
On Fri, Sep 28, 2012 at 8:39 AM, Andreas Wehrmann
wrote: On 09/28/2012 01:58 AM, Lemay.Steve wrote:
I have the same need. It appears boost::asio provides a good place to start. Here's an example I found.
http://www.webalice.it/fede.tft/serial_port/serial_port.html
I'd love to hear any other expert opinions on the best approach to this as well.
SGL steven.lemay@igt.com
Hello!
I have already used this class to implement communication with serial devices in a professional environment. There's actually not much to say about it, since its use is so easy and straightforward.
Regards,
Andreas
I forgot to mention, that I've been using this on Windows as well as (embedded) Linux platforms. Am using it for controlling radio devices.
Regards
-- Dipl.-Ing. (FH) Andreas Wehrmann Software Development -------------------------------------------------------------- Center Communication Systems GmbH A-1210 Wien, Ignaz-Köck-Straße 19 Sitz in Wien FN 796 88p, Firmenbuchgericht Wien www.centersystems.com
Tel.: +43 (0) 190 199 - 3616 Mobile: +43 (0) 664 884 75916 Fax: +43 (0) 190 199 - 2110 E-Mail: a.wehrmann@centersystems.com _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
On 09/28/2012 01:58 AM, Lemay.Steve wrote:
I have the same need. It appears boost::asio provides a good place to start. Here's an example I found.
http://www.webalice.it/fede.tft/serial_port/serial_port.html
I'd love to hear any other expert opinions on the best approach to this as well.
SGL steven.lemay@igt.com
Hello! I have already used this class to implement communication with serial devices in a professional environment. There's actually not much to say about it, since its use is so easy and straightforward. Regards, Andreas -- Dipl.-Ing. (FH) Andreas Wehrmann Software Development -------------------------------------------------------------- Center Communication Systems GmbH A-1210 Wien, Ignaz-Köck-Straße 19 Sitz in Wien FN 796 88p, Firmenbuchgericht Wien www.centersystems.com Tel.: +43 (0) 190 199 - 3616 Mobile: +43 (0) 664 884 75916 Fax: +43 (0) 190 199 - 2110 E-Mail: a.wehrmann@centersystems.com
participants (5)
-
Alexander Dietz
-
Andreas Wehrmann
-
Jan Krabbenbos
-
Lemay.Steve
-
Norbert Wenzel