SerialPort IOException


A

Andreja ®itnik

Hi,

I have a problem with opening a COM port on WinCE 6 device, but only after a WiFi module has been on for a few hours (it's not plugged into that COM port). When I try to open the COM port using System.IO.Ports.SerialPort I get IOException. Things I have tried:

- restarting device. Usually doesn't change a thing.
- unplugging the WiFi module and restarting device. Usually solves the problem.
- implementing Zach's workaround on WinCE (http://zachsaw.blogspot.com/2010/07/serialport-ioexception-workaround-in-c.html). Executes OK, but I still get IOException when connecting to the port.
- Using OpenNetCF.IO.Serial.Port. Opens the port every time, can send data,but for some reason doesn't alert when response arrives i.e. doesn't receive data. System.IO.Ports.SerialPort has no problem receiving data (if it can open the port).

In both cases the settings appear to be the same (looking at DCB and COMMPROP structures).

Do you have any ideas for either:
- Fixing System.IO.Ports.SerialPort so that it will open port every time
OR
- Fixing OpenNetCF.IO.Serial.Port so that it will read from COM port.

Thank you!
Andreja
 
Ad

Advertisements

A

alireza.ahmadi67

Hi, I have a problem with opening a COM port on WinCE 6 device, but only after a WiFi module has been on for a few hours (it's not plugged into thatCOM port). When I try to open the COM port using System.IO.Ports.SerialPort I get IOException. Things I have tried: - restarting device. Usually doesn't change a thing. - unplugging the WiFi module and restarting device. Usually solves the problem. - implementing Zach's workaround on WinCE (http://zachsaw.blogspot.com/2010/07/serialport-ioexception-workaround-in-c.html). Executes OK, but I still get IOException when connecting to the port. - Using OpenNetCF.IO.Serial.Port. Opens the port every time, can send data, but for some reason doesn't alert when response arrives i.e. doesn't receive data. System.IO.Ports.SerialPort has no problem receiving data (if it can open the port). In both cases the settings appear to be the same (looking at DCB and COMMPROP structures). Do you have any ideas for either: - Fixing System.IO.Ports.SerialPort so that it will open port every time OR - Fixing OpenNetCF.IO.Serial.Port so that it will read from COM port. Thank you! Andreja

hello Andreja.
i have the same problem with System.IO.Ports.SerialPort and also with OpenNETCF.IO.Serial . I try diferent ways to come over this problem. the point is as the WIN CE device work frequently more the error occures more! in thiscase when i reinstall WINCE image on device i see this error less!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top