serial-port

Reading serial data in realtime in Python

我是研究僧i 提交于 2019-12-17 15:37:29
问题 I am using a script in Python to collect data from a PIC microcontroller via serial port at 2Mbps. The PIC works with perfect timing at 2Mbps, also the FTDI usb-serial port works great at 2Mbps (both verified with oscilloscope) Im sending messages (size of about 15 chars) about 100-150x times a second and the number there increments (to check if i have messages being lost and so on) On my laptop I have Xubuntu running as virtual machine, I can read the serial port via Putty and via my script

Serial Port (RS -232) Connection in C++

拜拜、爱过 提交于 2019-12-17 15:22:39
问题 I have done serial port RS-232 connection in C++ using 16-bit compiler (I was using Turbo C++ IDE). It included header file bios.h which contain all the required functions for reading values from the port. Now I want to read value from serial port using C++ 32-bit Mingw compiler. I am using Dev CPP as my IDE. Here I could not find bios.h . Are there any special header files available for this purpose in Mingw? I am using 32-bit compiler now because in my college project I got to use Exception

High delay in RS232 communication on a PXA270

喜欢而已 提交于 2019-12-17 13:56:18
问题 I'm experiencing a long delay (1.5ms - 9.5ms) in a RS232 communication on a PXA270 RISC PC/104. I want to minimize the long delay but I'm a beginner with embedded devices and C++ so I think I'm missing something. The mentioned delay is at the time when the PXA board receives a packet from the external device via RS232 (115200 baud) until it sends an ACK custom packet back to the external device. I measured the delay on the PXA board with an oscilloscope, one channel at the Rx and the other on

How to set a custom baud rate on Linux?

折月煮酒 提交于 2019-12-17 10:26:56
问题 I want to communicate over my serial port on Linux to a device with a non-standard-baud rate that is not defined in termios.h . I tried the "baud rate aliasing"-method from this post, but when I execute my C-program (I’ve named it "testprogram"), Linux says "testprogram sets custom speed on ttyS0. This is deprecated." I did some search on Google, and it seems that there is another (newer?) method to change the baud rate to a non-standard-value: On http://sourceware.org/ml/libc-help/2009-06

How to set a custom baud rate on Linux?

回眸只為那壹抹淺笑 提交于 2019-12-17 10:26:41
问题 I want to communicate over my serial port on Linux to a device with a non-standard-baud rate that is not defined in termios.h . I tried the "baud rate aliasing"-method from this post, but when I execute my C-program (I’ve named it "testprogram"), Linux says "testprogram sets custom speed on ttyS0. This is deprecated." I did some search on Google, and it seems that there is another (newer?) method to change the baud rate to a non-standard-value: On http://sourceware.org/ml/libc-help/2009-06

Java Serial Communication on Windows

冷暖自知 提交于 2019-12-17 09:31:13
问题 I've been looking around for a Java API that can communicate with serial devices on Windows/Win32 but many of the APIs I've checked out are either for Linux, too outdated, or just had bad critics. Can someone recommend one to me that they've tried or knows about that is easy to implement on Windows XP? 回答1: I started looking for the same thing couple weeks ago, and I've been very happy with the multi-platform RXTX library so far. Works with any Windows, Linux and OS X. Has a very clean, easy

Stable alternative to RXTX

最后都变了- 提交于 2019-12-17 08:09:30
问题 After using RXTX for a number of different projects, I've come across many annoying discrepancies and issues that can only sensibly be put down to bugs in the library - deadlocks, race hazards, and monitor threads deep in the RXTX library being left open preventing the program from closing (even though all ports I was using have been closed!) Running the latest "unstable" version has helped a bit, but it's still far from where I'd call it reliable, and activity on the project seems rather low

Serial communication between Arduino and Matlab is losing data

三世轮回 提交于 2019-12-17 07:55:20
问题 I am now trying to establish the serial communication between Arduino and Matlab. The script is very simple: Matlab send a number named as i to Arduino; Arduino receive this i , then send it back to Matlab; Repeat step 1&2 for 10 times, i.e., Matlab sends 1,2,...,10 to Arduino, then receive the 1,2,...,10 from Arduino. However, Matlab only get back 3,4,...,10, while the first i=1 and i=2 are lost (I have already made the inputbuffersize=200 now, still not right). Hereby is the code from

“The semaphore timeout period has expired” error for USB connection

僤鯓⒐⒋嵵緔 提交于 2019-12-17 07:29:14
问题 I'm getting this error... The semaphore timeout period has expired. On this line... ThePorts.ActivePort1.Open(); ...but I only get it from time to time. When it happens, it happens over and over again. Then the problem goes away, for hours or days, then it comes back. The serial port is a USB with a BlueTooth connected. I think this guy was having a very similar problem, but not in C# Freeze on SerialPort.Open / DeviceIoControl / GetcommState with usbser.sys As best I can estimate, I have

C# GUI refresh and async serial port communication

最后都变了- 提交于 2019-12-17 06:18:07
问题 I'm trying to create an application which communicates with hardware via serial port and reports the results to the gui. Currently moving through GUI is made by KeyEvents which trigger the drawing of the next "page" of GUI. However at one step (after the key is pressed) I need to draw new page and send few commands via serial port. The command sending is done via : port.Write(data, 0, data.Length); I then wait for the answer by waiting for DataReceivedHandler to trigger - it just pins out