serial-port

Reopening serial port fails if not closed properly with CloseHandle

I am working with USB device on Windows that is seen as a virtual serial port. I can communicate with the device using CreateFile and ReadFile functions, but in some cases my application does not call CloseHandle (when my application in development crashes). After that all calls to CreateFile fail (ERROR_ACCESS_DENIED), and the only solu...

Setting serial RS232 port settings; any in C# alternatives to SerialPort class ?

In my .NET application I need to achieve serial port setup equivalent to this C++ managed code: ::SetCommMask(m_hCOMM, EV_RXCHAR); ::SetupComm(m_hCOMM, 9*2*128*10, 400); ::PurgeComm(m_hCOMM, PURGE_TXABORT|PURGE_RXABORT|PURGE_TXCLEAR|PURGE_RXCLEAR); COMMTIMEOUTS timeOut; timeOut.ReadIntervalTimeout = 3; timeOut.ReadTotalTimeout...

Serial port communication in .NET

I am using C# to receive data from a serial port but there are some problems. I'm new to this so I need some help. First off all I want to know which functions are event driven: ReadExisting() Read() Readbyte() Readchar() ReadLine() Readto() How can I take the required data form input stream of this port? I have static sized p...

How to setup the serial port?

Hi, I'm using Linux OS as a programming platform. And I want to create a program that uses serial(/dev/ttyS0) port as a communication medium. I already know how to open, read, write and close the serial port using standard Linux function. Now my question is how can I able to setup the serial port? What I mean is I want to change the se...

C: cross-platform RS232 serial library?

Hi folks, I am looking for an open source cross-platform library for working with the serial port in C, something along the lines of the awesome pyserial library (Unfortunately I have to use C for this application) I have only found this one: http://www.teuniz.net/RS-232/ and that doesn't seem to have mention OSX compatibility. Any re...

Correct initialization sequence for Linux serial port

I wrote an application that must use serial ports on Linux, especially ttyUSB ones. Reading and writing operations are performed with standard select()/read() loop and write(), and there is probably nothing wrong in them, but initialization code (or absence of some part of it) damages something in the tty subsystem. Here it is: vuxbo...

PHP to serial with weird baud rates

I am trying to use PHP to send text to an LED sign so I can send support ticket numbers to it. The sign itself is a piece of work; it came from eBay and is poorly made with almost no documentation. After fiddling with it for a while, I was able to figure out the way it expected stuff to be sent to it and that the baud rate is 28800. I al...

Access COMPORT 1 through three different applications.

Hi I have an SMS Appliaction, which receives the messages through GPS Modem and revert back through GPS Modem. The Modem is using COM1. Now, i need two more appliactions which can send messages through the same GPS Modem. I tried making a webservice which can access the COM1 to send data, but when i try to connect through webService,...

I want to establish a TCP/IP connection over a UART connection (Windows XP/7)

I want to connect two computer via serial but for each to see each other via a TCP/IP connection. Ie, create new network device on the computers that are in actual fact serial ports. The reason for this is that I am actually testing the medium in which the serial connection is made (wireless), and part of the experiment will be to use T...

Why am I getting a Java NoSuchPortException when the port exists?

Got the following production code below, I'm using it for a new driver. portName is COM4 and this port exists on the PC (and I can connect to it with hyperterminal), so why does Javacomm throw a NoSuchPortException? COM4 shows up fine in device mgr. too final String portName = getSerialPort(); try { final CommP...

RS 232 Communication in ASP.NET 3.5?

using ASP.NET 3.5 WebForm using C# 3.0, is it possible to setup a RS 232 communication with a device? I need the WebForm to be able to read and write data to the serial port. I would appreciate if there are some good examples, thanks. I understand that under Components, there is a SerialPort .NET Component, but it seems to me that it ca...

Is it possible to use a serial port like session in c#?

I am using serial port communication in my asp.net webform application... private bool sendSMS(int portNo, string mobNo, string details) { try { SerialPort SerialPort1 = new SerialPort(); SerialPort1.PortName = "COM" + portNo.ToString(); SerialPort1.BaudRate = 9600; S...

iPod Serial Commands

I was wondering if anyone knows if Original iPods (ie. 4th generation and up) and iPod Touches/iPhones use the same type of serial commands to do communications? Do you know if because of the new OS on the Touches they have changed how the serial communicates? Or did they drop the serial command protocol all together? ...

Need a good serial port logging tool

I'm working on an embedded system and it uses one serial port for all it's logging purposes. Is there a tool out there that allows you to filter lines into different windows (or remove them altogether) so that I can separate the output of the various logging sub-systems and remove spam messages that show up multiple times a second? I'd...

Android Bluetooth - Can't connect out

I am developing an application which uses Bluetooth to connect to a device and send/receive data. I am doing all of my testing with a Nexus One phone. I have never been able to establish a SPP (serial port) connection from my phone to any device. However, I have been able to connect from a device (my laptop) to my phone using a Mac equi...

Can't detect the first data sent in the serial port.

Hi, I am using C language and Linux as my programming platform. And I have problems in setting up the serial port(/dev/ttyS0). In my small program, I set my serial port using tcgetattr and tcsetattr options.c_cflag |= B115200; options.c_cflag &= ~PARENB; options.c_cflag &= ~CSTOPB; options.c_cflag &= ~CSIZE; options.c_cflag &= ~CRTSCTS...

Sending ATD command to a Fastrack Supreme via RS232 in LabWindows/CVI

Hello, I work on project based on a FASTRACK SUPREME which has to receive commands via a serial RS232. The problem is: When I use HyperTerm the command ATDxxxxxxxxx; works fine. When I use the CVI RS232 library nothing happens. Is it possible that my command remains blocked in the serial buffer? Here is my code: #include <ansi_c.h>...

Does .NET 3.5 SP1 SerialPort class append extra 0's on transmission?

Update Turns out the error was in the crypto processor code, that is fixed. But now running into what seems like it might be a handshaking issue. On first transmission, we get a single byte back from the device with value 0xFF(don't know why, the engineer I'm working with isn't too experienced with RS-232 either). Then, things run as n...

RS232 P3 protocol?

Here is an except from a manual for a piece of hardware I wish to develop software for. However have no idea what the P3 rs232 protocol is. Hopefully someone here can help me out. Protocol RS232: This is used to select the protocol on the RS232 interface. There are 3 options: Enhanced - This protocol is here only for compati...

Problems with sending commands over pySerial

Hi. I'm trying to talk to a home made card over a serial port, and is therefor using pySerial. In Hyperterminal, everything works fine. I can write: $ audio on and the audio is enabled, but if I use ser = serial.Serial("COM1", 38400) ser.write("audio on\r\n") nothing happens. I can read incoming data however, so it's not something...