serial-port

SerialPort.Open() throws IOException - Insufficient system resources exist to complete the requested service

余生颓废 提交于 2019-12-22 06:49:49
问题 I have a .NET 4 Windows service I've written that periodically (usually once a day) communicates with an external device over a serial port. All in all the service works great, but for one customer, every now and then, a call to SerialPort.Open() throws the following exception: System.IO.IOException: Insufficient system resources exist to complete the requested service. at System.IO.Ports.InternalResources.WinIOError(Int32 errorCode, String str) at System.IO.Ports.SerialStream..ctor(String

Python: Writing to and Reading from serial port

梦想的初衷 提交于 2019-12-22 06:48:15
问题 I've read the documentation, but can't seem to find a straight answer on this. I have a list of all COM Ports in use by Modems connected to the computer. From this list, I try to open it, send it a command, and if it says anything back, add it to another list. I'm not entirely sure I'm using pyserial's read and write functions properly. i=0 for modem in PortList: for port in modem: try: ser = serial.Serial(port, 9600, timeout=1) ser.close() ser.open() ser.write("ati") time.sleep(3) print ser

Find serial port where my device is connected

寵の児 提交于 2019-12-22 06:28:43
问题 I'm starting to work with a pinpad. I need that my program find the port where the pinpad is connected without user interaction. I tried with: Dim searcher As New ManagementObjectSearcher("root\cimv2","SELECT * FROM Win32_SerialPort") For Each queryObj As ManagementObject In searcher.Get() MsgBox(queryObj("Name")) Next but this only give me "COM1" and "COM2" as an answer (My device is connected to COM4) and with Dim searcher As New ManagementObjectSearcher("root\cimv2", "SELECT * FROM Win32

How to I detect whether a tty belonging to a gsm/3g-modem is a data or control port?

别来无恙 提交于 2019-12-22 05:20:47
问题 I'm currently writing a small tool for a linux router that sets up a wwan (gsm/3g) connection when I plug an appropriate modem into its USB port. When the device is plugged in several ttys are registered and I currently maintain a list of manufacturers and devices and which of their registered ttys is the control / data port. If possible I want to get rid of this list and find a way to somehow probe the registered ttys directly to check if they are a control port or a data port. I examined

CallerID Detection: Doesnt work with some phones

雨燕双飞 提交于 2019-12-22 05:17:45
问题 I am using the following method to detect the Caller ID when someone calls. On form load I set the following code: this.serialPort1.PortName = "COM3"; this.serialPort1.BaudRate = 9600; this.serialPort1.DataBits = 8; this.serialPort1.RtsEnable = true; this.serialPort1.DataReceived += new SerialDataReceivedEventHandler(serialPort1_DataReceived); this.serialPort1.Open(); this.serialPort1.WriteLine("AT#cid=1" + System.Environment.NewLine); void serialPort1_DataReceived(object sender,

Reconnecting to device with pySerial

*爱你&永不变心* 提交于 2019-12-22 05:10:07
问题 I am currently having a problem with the pySerial module in Python. My problem relates to connecting and disconnecting to a device. I can successfully connect to my device and communicate with it for as long as I want to, and disconnect from it whenever I desire. However, I am unable to reconnect to the device once the connection has been severed. Here is the wrapper class that my program uses to interface with the serial port: import serial, tkMessageBox class Controller: """ Wrapper class

Windows 7 x64 COM/Serial port Sniffer/Redirect

本秂侑毒 提交于 2019-12-22 04:42:39
问题 I need to know what's happening between my computer and a USB Virtual COM port device in order to understand if all of the bytes are being well transmited. I use a Java application to interact with the device and I want to have a native app that allow me to see the exchanged frames (both ways), but I can't find any software for that in Windows 7 x64. Is there any software to sniff ir just redirect a COM port received and trnasmitted messages? 来源: https://stackoverflow.com/questions/9213733

Get the count of bytes waiting on a serial port before reading, linux

半腔热情 提交于 2019-12-22 04:13:20
问题 I am converting a Win32 serial class to Linux (Ubuntu) one of the required functions of this serial class is to "peek" at the serial buffer to see how many bytes are waiting on the serial port before reading the serial port. In this pedicure situation I only need to know if there are ANY bytes on the port before attempting to read it. In windows I used COMSTATS but I can't seem to find a similar function in Linux. My question is: On Linux How do you read the amount of BYTES/chars waiting on a

Is there a cross platform c++ serial port library that can enumerate ports?

自闭症网瘾萝莉.ら 提交于 2019-12-22 03:54:11
问题 I am looking for a c++ library that can connect to and communicate with serial port devices. I need one that can be used on windows and linux. I have found "serialib" already but this has no feature for enumerating the available ports. So I either need a cross platform "port enumerator" library or a whole new cross platform serial port library. Does anyone know of a good one? Thanks, Dan. 回答1: http://wjwwood.io/serial/ https://github.com/wjwwood/serial This is a cross-platform serial port

I want to receive data CONTINUOUSLY from a COM port & simultaneously want to write to file

痞子三分冷 提交于 2019-12-22 01:05:44
问题 I want to read serial COM port and to write the data to a file in LINUX. Actually I'm sending data from hyperterminal from other PC. The problem is without while loop I can write only one line. But with while(1) loop I can't write anything to file. Or else I have to send BIG file, then application exits/terminates and writes to the file. My application should write the data (it may 2 lines or any thing); after that it has to wait for next data. So please help me out..... Here is my Code =====