serial-port

C# .Net Serial DataReceived Event response too slow for high-rate data

烂漫一生 提交于 2019-12-12 10:44:26
问题 I have set up a SerialDataReceivedEventHandler, with a forms based program in VS2008 express. My serial port is set up as follows: 115200, 8N1 Dtr and Rts enabled ReceivedBytesThreshold = 1 I have a device I am interfacing with over a BlueTooth, USB to Serial. Hyper terminal receives the data just fine at any data rate. The data is sent regularly in 22 byte long packets. This device has an adjustable rate at which data is sent. At low data rates, 10-20Hz, the code below works great, no

COM port disappears when unplugging USB

余生颓废 提交于 2019-12-12 09:58:29
问题 I am prototyping a sort of Arduino-based docking station for a tablet, using the USB port as connector. This means I need to support to ability to plug/unplug the USB connector while the application on the tablet is running. The tablet runs a c# application (.net 4.5 on Win7 64 bit) in which I am connecting to the Arduino Uno. When the application is launched I loop all available COM ports using: var ports = SerialPort.GetPortNames(); // -> [COM3,COM4,COM8] foreach (var port in ports) { var

byte aligning in serial communication

时光总嘲笑我的痴心妄想 提交于 2019-12-12 09:08:07
问题 So I am trying to define a communication protocol for serial communication, I want to be able to send 4 byte numbers to the device, but I'm unsure how to make sure that the device starts to pick it up on the right byte. For instance if I want to send 0x1234abcd 0xabcd3f56 ... how do I makes sure that the device doesn't start reading at the wrong spot and get the first word as: 0xabcdabcd Is there a clever way of doing this? I thought of using a marker for the start of a message, but what if I

Constantly reading from a serial port with a background thread

浪尽此生 提交于 2019-12-12 08:56:37
问题 As serial port communication is asynchronous, I figured out early on into my project involving communication with a RS 232 device that I will have to have a background thread constantly reading the port for data received. Now, I'm using IronPython (.NET 4.0) so I have access to the slick SerialPort class built into .NET. This lets me write code like this: self.port = System.IO.Ports.SerialPort('COM1', 9600, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One) self.port.Open() reading

One-Shot Timers

╄→гoц情女王★ 提交于 2019-12-12 08:36:18
问题 Dear Delphi programmers, I'm looking for help how to write a one-shot timer (No GUI, so VCL Timers out of question)... Let me explain a little bit more. In my code (explaining with VCL timer but in this particular project I have no forms): Call a procedure which send a char over serial port Enable a timer with a X amount of Interval In the OnTimer event: I have a code which send a char then disable the timer itself to never be executed again. The problem is that I need to make the creation of

Kill process that raises Device or resource busy: '/dev/ttyUSB0'?

▼魔方 西西 提交于 2019-12-12 08:20:06
问题 I connect to my Arduino board with the following Python code. device=glob.glob("/dev/ttyUSB*")[0] time.sleep(1) arduino = serial.Serial(device, 115200, timeout=5) It generally works, but somehow some other process must be accessing the board after reboot giving me the error serial.serialutil.SerialException: could not open port /dev/ttyUSB0: [Errno 16] Device or resource busy: '/dev/ttyUSB0' When unplugging and replugging the USB-plug I can execute the Python code normally, without the error

Writing STRINGS to serial port in C++ linux

£可爱£侵袭症+ 提交于 2019-12-12 07:53:54
问题 I know this question is scattered all over the internet, but still, nothing is getting me completely there yet. I want to write data to a serial port in C++ (linux) for a a Propeller board. Program works fine when taking input from the console, but when I write strings to it always return: ERROR - Invalid command from the device. I tried creating array of char with Hex values then it worked. here's a working code, below. But how will i be able to just provide a string variable of command and

How to set and read pins on the parallel port from C++?

自闭症网瘾萝莉.ら 提交于 2019-12-12 07:16:16
问题 I am helping a friend to finish a final year project in which he has this circuit that we want to switch on and off using a C++ program. I initially thought it would be easy, but I have failed to implement this program. The main problem is that Windows XP and above don't allow direct access to hardware so some websites are suggesting that I need to write a driver or find a driver. I have also looked at some projects online but they seem to work for Windows XP but fail to work for Windows 7.

OpenSource .net SMS library, I can't seem to find one at all for C# [closed]

非 Y 不嫁゛ 提交于 2019-12-12 07:15:23
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I've been using GSM modems in my projects to send/recieve SMS-s. I have been using built-in serial port communication features of .net to do this by using standard AT commands. Now I have to extend its functionality (like SMSs in PDU mode, more efficient delivery report handling etc). I don't wanna reinvent the

How to use the FTDI D2XX library on OSX?

流过昼夜 提交于 2019-12-12 07:07:30
问题 I'm trying to talk to a an usb device connected to an EasySync USB2-H-5004-M USB to RS485 converter at baud rate 3750000 but on OSX. I've some c++ code working on Windows and have just managed to get it to compile on OSX (using the D2XX dylib instead of the dll) but I have an issue with communication somewhere and I'm not sure where to start and how to resolve this. I'm using openFrameworks/c++ and the method to list devices looks like this: int FTDI::enumerateDevices(){ DWORD numDevs; FT