serial-port

VMIN and VTIME Terminal Settings for variable sized messages

試著忘記壹切 提交于 2019-12-11 18:16:04
问题 I'm trying to interface with a device via the serial port. The device sends out a 10 byte poll as a "heartbeat" every 700ms. Everytime I read the heartbeat I have to reply with a 12 byte long response. Within this response I can request that the device sends particular data inbetween polls. The amount of data is different for different requests. Is there a way to set up the serial port such that it will always read messages in one chunk regardless of their size? My current terminal settings

Serial port ; cannot read what I write

微笑、不失礼 提交于 2019-12-11 18:15:45
问题 I am not able to read what i send to serial port, when i randomly generate data, and I want to send it over COM1, and read from COM2 with two different real time threads I used RTAI functions, Lets say;I send 'H' 'E' 'L' 'L' 'O' some random bytes and 0x01; howeverI cannot read 'H' 'E' 'L' 'L' 'O' some byte and 0x01. I read different values than I send over serial port. What can be the reason? 1-) I am using null modem cable between COM1 and COM2 2-) I have posted writer and reader script

java api to send file through serial port

我怕爱的太早我们不能终老 提交于 2019-12-11 17:49:15
问题 I want to send a file from my PC to a remote device connected through serial port. So is there any API in java to send file over serial port? 回答1: checkout javax.comm 回答2: See also RXTX. It is widely used and includes straightforward examples. 回答3: There is also JPeripheral. 来源: https://stackoverflow.com/questions/2003821/java-api-to-send-file-through-serial-port

Is it a problem to turn off power to a running QSerialPort?

瘦欲@ 提交于 2019-12-11 17:42:05
问题 I'm developing an application with several serial ports. Each of these ports is handled by a different thread and has its own QSerialPort object. From a hardware point of view, they are connected hierarchicaly, meaning that there is one main device connected to the PC with a usb cable (1 COM port), to this main device there are several other devices connected, each of them having its own COM port. The main device can turn on/off the power supply to these child ports. In the application, the

C Gps nmea parser from linux serial port does not parse the last line of the read buffer

蓝咒 提交于 2019-12-11 17:37:06
问题 I need to create a c gps nmea parser for a board I'm working on (Cubietruck with armbian debian jessie 8.0) . Based on several examples I found on the internet I concluded in the following: #include <stdio.h> #include <stdint.h> #include <stdlib.h> #include <signal.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <sys/fcntl.h> #include <termios.h> #include <unistd.h> #include <string.h> int fd = -1; int end_of_loop= 0; void sig_handler(int sig) { if(sig ==

How do I dump serial communication as file through Android bluetooth serial RFCOMM

送分小仙女□ 提交于 2019-12-11 17:35:56
问题 My Android app receive serial communication over bluetooth from desktop application. I have no control over what that desktop application is doing. Using Google BluetoothChat sample code (https://github.com/googlesamples/android-BluetoothChat). I manage to make it working and to some extent I can simply took the bytes coming to my android app and write a file. However, the code function is something like 1 - Android listen 2 - PC send data, Android accept connection read data and write to

timeout on waiting for command from linear stage device using matlab

人盡茶涼 提交于 2019-12-11 17:18:07
问题 I am trying to establish a full duplex serial communication between the RS485 port of a stepper motor controller and the COM port of my laptop. The cable I use connects to RS485 on the controller and to a USB port on my laptop. I am using a Matlab script to send and receive commands to the controller to move a stage block on a guided linear scale. While I can open the serial connection to the device and send commands to advance the stage block on the linear scale, I am unable to receive any

How can I use processing.app.Preferences in java?

蓝咒 提交于 2019-12-11 17:15:03
问题 I wrote a java program to reading data from serial port. But I have an error. Can you help me? import gnu.io.CommPortIdentifier; import gnu.io.SerialPort; import java.io.InputStream; import java.io.OutputStream; import processing.app.Preferences; public class Main { static InputStream input; static OutputStream output; public static void main(String[] args) throws Exception{ Preferences.init(null); System.out.println("Using port: " + Preferences.get("serial.port")); CommPortIdentifier portId

Access to the port 'COM4' is denied

﹥>﹥吖頭↗ 提交于 2019-12-11 16:49:11
问题 I am using arduino (some micro-controller), and I made an ASP.net page to communicate with it. I connected arduino to serial-port COM4. When I run the ASP.net website, I get the following error: Exception Details: System.UnauthorizedAccessException: Access to the port 'COM4' is denied. ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on

Byte Order of Serial communication to Arduino

情到浓时终转凉″ 提交于 2019-12-11 16:45:00
问题 I am trying to write a C++ application to send a 64bit word to an Arduino. I used termios using the method described here The problem i am having is the byes are arriving at the arduino in least significant byte first. ie if a use (where serialword is a uint64_t) write(fp,(const void*)&serialWord, 8); the least significant bytes arrive at the arduino first. this is not the behavior i was wanted, is there a way to get the most significant byes to arrive first? Or is it best to brake the