serial-port

How to apply encoding when reading from a serial port

走远了吗. 提交于 2019-12-18 07:05:39
问题 I'm reading data from a serial port. I read this posting: http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/a709d698-5099-4e37-9e10-f66ff22cdd1e He is writing about many of the issues I have encounter, but in his writing he refers to using: System.Text.Encoding.GetEncoding("Windows-1252"). The problem I'm having is when and how to apply this. There are three potitional spots in my opinion. When the serial port object is define: private SerialPort comport = new SerialPort(); The

Is it possible to send the content of text file over PuTTY over a serial port?

China☆狼群 提交于 2019-12-18 06:14:12
问题 I'd like to send the text content of a file over the serial port, over PuTTY. I know that extensions exists such as Xmodem and Zmodem, but they all use some checksum protocols to confirm that a file is sent over the port. However, my requirements are more simple. I'd like to simply send a bunch of text (in a file) over the serial port in Windows (under Linux this would be must more simple), but my preferred terminal program is PuTTY. Is this possible? Is there another terminal program that

Is it possible to send the content of text file over PuTTY over a serial port?

给你一囗甜甜゛ 提交于 2019-12-18 06:14:10
问题 I'd like to send the text content of a file over the serial port, over PuTTY. I know that extensions exists such as Xmodem and Zmodem, but they all use some checksum protocols to confirm that a file is sent over the port. However, my requirements are more simple. I'd like to simply send a bunch of text (in a file) over the serial port in Windows (under Linux this would be must more simple), but my preferred terminal program is PuTTY. Is this possible? Is there another terminal program that

Linux Serial Port: Blocking Read with Timeout

蓝咒 提交于 2019-12-18 05:04:13
问题 I have studied many useful threads and some tutorials, but I'm still having some issues with something that should be very simple. For reference here are some threads that I've perused: How to implement a timeout in read function call? how to open, read, and write from serial port in C At any rate, I have a bit of a problem. My code works fine if I receive data. If I don't, the read() function stalls and the only way to get out of my program is to use kill -9 (NOTE: I use signal handling to

C#: Timeout on SerialPort.Open?

不羁岁月 提交于 2019-12-18 04:55:10
问题 I have an autodetect thread that tries to open the ports in order and match the received data, thus detecting the port where the relevant device sends the data. Now, there are some ports where the SerialPort.Open simply hangs the thread for ~30 secs. How can I set a timeout on the SerialPort.Open function? 回答1: From MSDN Only one open connection can exist per SerialPort object. The best practice for any application is to wait for some amount of time after calling the Close method before

Pyserial problem with Arduino - works with the Python shell but not in a program

只愿长相守 提交于 2019-12-18 04:49:07
问题 All right, so I am positive my Arduino circuit is correct and the code for it. I know this because when I use the serial monitor built into the Arduino IDE and send 'H' an LED lights up, when I send 'L' that LED turns off. Now I made a Python program import serial ser = serial.Serial("COM4",9600) ser.write("H") When I run the code the LED blinks on for a second then goes back off. However when I do each of these lines separately in the shell it works just like it is supposed to. Any ideas?

Reading from serial port with Boost Asio

冷暖自知 提交于 2019-12-18 04:16:40
问题 I'm want to check for incoming data packages on the serial port, using boost.asio . Each data packet will start with a header that is one byte long, and will specify what type of the message has been sent. Each different type of message has its own length. The function I want to write should listen for new incoming messages continually, and when it finds one it should read it, and call some other function to parse it. My current code is as follows: void check_for_incoming_messages() { boost:

Sysinternals' Portmon: Error 2

 ̄綄美尐妖づ 提交于 2019-12-18 01:23:34
问题 When I try to connect to local ports, Computer -> Connect local , using Portmon v. 3.02, I'm getting an error message, Error 2 , in a small error dialog box: I run the tool as an administrator (if not, I get error 6). By the way this is a Windows 7 x64. On 32-bit, in Windows 7 x86, it works fine. How can I fix this problem? 回答1: Sysinternals' Portmon works only on 32-bit versions of Windows. It does not support 64-bit (probably its driver is not signed). From the Portmon homepage: Runs on:

socat: tunnel IP through TTY

落花浮王杯 提交于 2019-12-17 22:11:49
问题 Is it possible to get an bidirectional IP-tunnel over ttyS0-like serial (modem) devices with the socat utility? I tried to use TUN option but still can't get the result. Any suggestions are welcome :) Update: PC1: socat /dev/ttyUSB0,raw,echo=0,b57600,clocal TUN:192.168.1.1/24,up PC2: socat /dev/ttyUSB0,raw,echo=0,b57600,clocal TUN:192.168.1.2/24,up After that, I have seen tun0 interfaces with proper addresses on both ends but I can't ping one from other. Instead of that, when I send data with

How to “reset” an Arduino board?

只愿长相守 提交于 2019-12-17 21:53:54
问题 I've uploaded a sketch to an Arduino Uno whose loop is something like this: void loop(){ Serial.println("Hello World"); } So, now, I can't upload anything anymore, because the IDE says "port already in use". Is there a way to "reset" the Arduino without another programmer? EDIT : Nothing else is using the serial port, and everything went just fine until I uploaded the previous sketch. EDIT : I've found some interesting things: Problems with 0021 on Ubuntu 10.04 Lucid Lynx Re: Problems with