title: How to communicate with USB 3G modem?
body: <p>I have a D-Link DWM-156 3G USB modem that I want to send AT-commands to from my application (C# .NET 4.0 running on Windows XP SP3).</p>
  
  <p>After plug-in and installation of drivers the modem shows up like this:</p>
  
  <p>In <em>Device Manager</em>, two serial ports are added:</p>
  
  <ul>
  <li><strong>D-Link HSPADataCard Diagnostics Interface (COM4)</strong></li>
  <li><strong>D-Link HSPADataCard NMEA Device (COM5)</strong></li>
  </ul>
  
  <p>In <em>Control Panel, Phone and Modem Options</em>, a new modem is added:</p>
  
  <ul>
  <li><strong>D-Link HSPADataCard Proprietary USB Modem</strong> (attached to COM19)</li>
  </ul>
  
  <hr>
  
  <p><strong>QUESTION: Which com port should I use to send AT-commands, and at which speed?</strong> </p>
  
  <hr>
  
  <p>I have tried all three ports at different speeds, but with no luck whatsoever.</p>
  
  <p>In order to learn, I then installed the <em>"Free Serial Port Monitor"</em> sniffer app, hoping to be able to monitor the communication with the D-Link ustility as it opens and closes the internet connection (which works OK).</p>
  
  <p>On start, the sniffer app asks me which port to monitor and offers me the following port names to choose from:</p>
  
  <ul>
  <li>"Agere Systems HDA Modem",</li>
  <li>"D-Link HSPADataCard Proprietary USB Modem",</li>
  <li>"COM3",</li>
  <li>"COM4",</li>
  <li>"COM5"</li>
  <li>...and several more, including "COM19".</li>
  </ul>
  
  <p>Choosing the <em>"D-Link..."</em> name works OK, now I can watch all the AT commands being used as they happen, but I cannot determine at which baud rate the port is used. Further, neither COM4, COM5 or COM19 works for sniffing this way (nothing seems to happen on those ports).</p>
  
  <p>Now I would like to use the <em>SerialPort</em> class in .NET to open the <em>"D-Link..."</em> port and talk with the USB modem, but the <em>SerialPort</em> class requires the port name to start with "COM", otherwise an exception is thrown. But none of the ordinary COM-ports work. And I still don't know which baud rate to use. I'm pretty much confused and locked up here - what could I do to get to the bottom of this?</p>