serial-port

How to build a serial (RS422 or RS232) message to communicate with Sick LMS200 via PuTTy?

杀马特。学长 韩版系。学妹 提交于 2019-12-25 16:57:15
问题 I have a serial device (sick LMS200) connected to my PC using a RS422 to USB converter. The serial settings (baud, stop bits, etc...) on the LMS200 and my PC match and are communicating (verified using an application that ships with the LMS200). I need to write a custom application which communicates with the LMS. Before I can begin building my application I need to figure out how to exchange datagrams between the PC and the LMS. To figure this out I have been trying to manually send

Encoding error, in python3

笑着哭i 提交于 2019-12-25 16:54:47
问题 I have a somewhat similar question here that I can't solve. In another instance of my code, I face similar encoding errors. Do assist! My code: port = serial.Serial("/dev/ttyUSB0", baudrate=9600, timeout=10, bytesize=8) f_w = open('/home/ryan/python_serial_output.txt','r+') f_o = open('/home/ryan/python_serial_parse.txt','w') port.send_break() sys_reply = port.read(100000) sys_reply_str = sys_reply.decode('utf-8') print(sys_reply_str) sys_reply_str_haha = sys_reply_str.replace("\r","") sys

serialport and dispatchertimer, how to make my thread pause when com port is open?

房东的猫 提交于 2019-12-25 16:39:51
问题 i have a serial port that will iterate through the ports with this method: foreach (string s in SerialPort.GetPortNames()) { var serialOneOfMany = new SerialPort(s, baudRate, Parity.None, 8, StopBits.One); if (serialOneOfMany.IsOpen) { serialOneOfMany.Close(); } else { try { serialOneOfMany.Open(); } catch { var openSerial = new System.Timers.Timer(3100); openSerial.Elapsed += (o, e) => { serialOneOfMany.Open(); openSerial.Enabled = false; openSerial.Dispose(); }; openSerial.Enabled = true; }

Can't download javax.comm

拥有回忆 提交于 2019-12-25 14:11:58
问题 I'm making a Java ECG Software which needs to be able to communicate with an ECG through serial communication. However, the java API javax.comm is nowhere to be found. I have searched Oracle but there's no download link whatsoever. Does anyone know where I can find the API? I don't care if it's for Linux(Ubuntu) or OS X. I found an old API for windows (which is no longer supported) but it did not work on my 64 bit windows machine. 回答1: You can find it with this search : https://www.google.com

Read system call not detecting End of file

寵の児 提交于 2019-12-25 10:56:12
问题 I have connected a modem to my pc(linux) through serial port and i am trying to write to and read from modem using write and read system call.During reading read system call blocks after reading all data from modem,in my code i have made check for eof as shown below while(1) { if((rd_cnt =read(fd, &str, 1)) <=0) { perror("Read to dev failed"); printf("error no=%d\n",errno); break; } printf("char =%c -> hex=%x rd_cnt=%d\n",str,str,rd_cnt); sleep(3); str=0; } if(rd_cnt==0) printf("EOF met\n");

How can I send datas from web page to serial port of visitor's computer? [duplicate]

偶尔善良 提交于 2019-12-25 08:45:37
问题 This question already has an answer here : Closed 6 years ago . Possible Duplicate: How can I send data from a web page to a serial port? Is sending data from PHP web page to one of the serial ports of visitor's computer possible or not? If it is yes, how? If it is not, basicly, I want to write a client for a web backend that retrieves the data from the web and then writes the retrieved data to a serial port. Can you help about that? 回答1: Not over the internet, as that would be very dangerous

Async serial communication in non-canonical (raw) mode and generating SIGIO in linux/osx

别来无恙 提交于 2019-12-25 08:34:15
问题 To start off, I'm having trouble getting my serial device to generate a SIGIO when data is ready to be read. I am trying to write a simple serial interface to communicate to a micro using a usb to serial adapter. I'd like to keep this interface as similar to one you would find in a micro (interrupt driven, using callbacks) and so I decided to go the way of catching a SIGIO signal instead of using a separate thread or constant non-blocking serial reads. Here is my initialization code (most of

Communication with OBD-II using Windows Phone

删除回忆录丶 提交于 2019-12-25 08:28:12
问题 I have a problem with sending and receiving data from elm327 device. I tried to connect to the device using channel 01 (on Bluetooth) but it doesn't matter what command I send, I just receive the string "AT+BRSF=24\r" as an answer. I tried also to connect at channel 16 and there I receive a string "NO DATA" somebody knows what is the problem? thank you, Arie 回答1: The AT+BRSF=24 response sounds like you're communicating with the wrong Bluetooth device (perhaps a headset?). "NO DATA" sounds

Serial port data received handled too slowly

亡梦爱人 提交于 2019-12-25 07:01:15
问题 I am reading data from an arduino at a baud rate of 115200. The data comes in as a string on its own line in the format: <ID,Name/Data> . I believe that the problem with my code is that it is not handling the incoming data fast enough and the incoming data is being forced to wait for old data to be processed. The incoming string is split into the three separate categories (ID, Name, Data) and added to a data table called dtFromGrid which is bound to dataGridView1 . Is there any errors or

How to read data from serial port in vb.net?

梦想与她 提交于 2019-12-25 06:59:39
问题 I made a class and there is this sub named SendUSSD, when this is called it sends a ussd code like *123# to a COM port where a gsm mobile is connected. This ussd is supposed to return the mobile balance. If IsOpen = True Then 'checks if the port is open SMSPort.WriteLine("AT+CUSD=1,""*123#""" vbCr) 'this sends the ussd code Form1.TextBox2.Text = SMSPort.ReadLine().ToString() 'this shows the response End If Now the problem is sometimes I get the full response like "Your current balance is so