serial-port

Data gets corrupted during transmission over the serial port

浪子不回头ぞ 提交于 2019-12-20 04:34:52
问题 I am developing a program to communicate with an old system. I use System.IO.Ports.SerialPort for this. The problem is when I send a longer message, the message bevome corrupt. I use a line listener and get the following results What I sending aa 01 00 00 12 03 06 18 02 c1 94 02 c1 94 00 00 00 00 00 00 00 00 00 00 00 00 1e fd What I get c2 aa 01 00 00 12 03 06 18 02 c3 81 c2 94 02 c3 81 c2 94 00 00 00 00 00 00 00 00 00 00 00 00 1e c3 bd The code I'm using is _comPort.Encoding = new

Faster communication between two ESP8266 in client-server setup

本秂侑毒 提交于 2019-12-20 04:31:51
问题 I am trying to communicate between two ESP8266 12 E modules, one is set up in access point mode and the other as a station. My aim is to establish communication between the two. How can I make the data transfer faster? Is this what is called TCP/IP connection? The code for the access point: #include <ESP8266WiFi.h> #include <ESP8266WebServer.h> #include <WiFiClient.h> WiFiServer server(80); void setup() { WiFi.mode(WIFI_AP); WiFi.softAP("esp", "lol123"); server.begin(); Serial.begin(9600);

Qt linker error when adding class to basic Qt GUI application

倖福魔咒の 提交于 2019-12-20 03:55:32
问题 I have been struggling for some time now and can't figure this out. I added a class to my basic Qt GUI application and i got linker errors. I don't see what can cause this and are hoping for feedback. Linker errors: main.obj:-1: error: LNK2019: unresolved external symbol "public: void __thiscall Serial::start(enum QSerialPort::BaudRate)" (?start@Serial@@QAEXW4BaudRate@QSerialPort@@@Z) referenced in function _main main.obj:-1: error: LNK2019: unresolved external symbol "public: __thiscall

Clear data at serial port in Linux in C?

a 夏天 提交于 2019-12-20 03:22:13
问题 I am testing the sending and receiving programs with the code as The main() function is below: #include "lib.h" int fd; int initport(int fd) { struct termios options; // Get the current options for the port... tcgetattr(fd, &options); // Set the baud rates to 19200... cfsetispeed(&options, B9600); cfsetospeed(&options, B9600); // Enable the receiver and set local mode... options.c_cflag |= (CLOCAL | CREAD); options.c_cflag &= ~PARENB; options.c_cflag &= ~CSTOPB; options.c_cflag &= ~CSIZE;

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

不问归期 提交于 2019-12-20 02:15:13
问题 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 CommPortIdentifier id = CommPortIdentifier.getPortIdentifier(portName); port = (SerialPort) id.open(getName(), 1000); } catch (NoSuchPortException nspe) { report(SeverityCode.LEVEL2, getName

How can you access a serial port from two different processes (Python)

老子叫甜甜 提交于 2019-12-20 02:13:45
问题 I would like to use multiprocessing (to avoid GIL issues on multi core machines) and have a read process and a write process using the same serial port. Is that possible? If so, how do I get the port acquired and then how do I get the child processes file objects that they can use? Edit -- This needs to work on Windows, but Mac and Linux would also be nice. 回答1: As stated in the comments, only one process can acquire the serial port at a time - therefore the way to go is to create yet another

SerialPort.Read(…) does not respect ReadTimeOut

谁说我不能喝 提交于 2019-12-20 02:10:13
问题 Got a bug in some legacy code which communicates with a payment terminal. Just before a new payment is started, the code attempts to clear the internal read buffer of the SerialPort. I trimmed the code down to the bare minimum. It uses the .NET SerialPort type. A read timeout of 50ms is set. Then it reads 512 bytes and continues doing so until no more bytes are read or until a TimeoutException is thrown. We added a bunch of logging and it showed that the call to the first Read(...) method

Communicate with the serial port from client web browser.

雨燕双飞 提交于 2019-12-20 02:09:23
问题 In my web application(sencha extjs 5) I have a user requirement to read/write data to the client PC serial port. I am aware of the client browser can not access local machine hardware without installing some binaries on the local machine(Native app, Windows Service, etc..). I have seen the same question is discussed few years back in stackoverflow forums. But I need to know what is the best way of doing this today with the available technologies? 回答1: Well, One way to do this is develop a

Prolific PL2303 serial port to 250000bps

冷暖自知 提交于 2019-12-19 21:47:06
问题 I need to run my /dev/ttyUSB0 (prolific pl2303 USB-RS232 converter) at 250kbps using c. Everywhere I looked everyone said that the nearest achievable speed is 230400 bps (http://lxr.linux.no/#linux+v3.9.5/drivers/usb/serial/pl2303.c and a few lines later (line 325) "NOTE: Only the values defined in baud_sup are supported !"). But I'm 100% sure that it can be done, because on windows (using c# default SerialPort component) I can just set 250000 as the baudrate, and it wil happily put out data

How to convert String to Hex and Hex to String?

为君一笑 提交于 2019-12-19 18:52:11
问题 I made simple program for sending and receiving data to serial port in java. I connect serial port device with loop back testing (Rx to Tx). it works fine. but i can't send and recive hex data to serial port and recive serial port. In my device there are FT232BL chip is used.So is there any dll or other library required to send and receive hex data to serial port device. my code is below. enter code here package x.rayimagecapture; import gnu.io.CommPort; import gnu.io.CommPortIdentifier;