This project is read-only.

Create PPP over serial connection(bluetooth)

Mar 9, 2010 at 7:19 PM

Hi Jeff,

I need my application to stablish a ppp(ethernet) connection between my computer and other hardware with a bluetooth dongle, so I can execute commands to an Ipaddress/port, from my computer. In my computer I have a bluetooth dongle too.

I first bound the bluetooth from my computer and the other dongle, and I get a COM port of the bluetooth connection.

After that, I configure the COM port in a .pbk file in the entry name "MTM".

After this, I tried to use your DotRas to make the ppp connection over the serial connection, but I couldnt. I have the .pbk file and the Entry name, but I couldnt make it work with your DotRas.

I dont have much knoledge in this type of connections and creating them has been a chellange. But I'm not quiting..

Can I do this with your DotRas dll?


Thanks a lot for your time,



Mar 9, 2010 at 7:32 PM

I would first suggest creating a connection with the Windows "Add Network Connection Wizard" and dial it from Windows to see if the connection attempt will be successful. Once you know you have a good working connection, then attempt to wire it up to DotRas. If the connection information is wrong, or something isn't set correctly on the entry, it can be a huge pain to get working if you don't know where the issue is. Once you have a known connection that works, you can dial it using the RasDialer class. If you need to have the entry generated by your application, take a look at your working connection in code (using the RasPhoneBook class) and copy all the settings from that connection to a piece of paper. You'll be able to take those settings and create your programmatic entry in your application from there.

That's how I always start creating connections if I'm having trouble getting something to work.

Mar 9, 2010 at 7:40 PM

Yes I agree, you are absolutely wright.


I already create the connection, configured it with the bluetooth serial port and it connected. The connection is working just fine..

How can I start with your dll?




Mar 9, 2010 at 8:43 PM

Look in the samples included in the SDK (if you chose to install them). There's an example called CreateAndDialVpnEntry that should give you a good starting point. Just ignore the part about actually creating the entry, since you've already done that.

Mar 9, 2010 at 9:46 PM

Great Jeff, its working just fine..

Who can I know the IpAddress of the device I just connected?

How can I disconnect this connection?

If I dont use the .pbk phonebook, I would have to create a VpnEntry before calling Dialer.Dial().. Could it be like this?

<font size="2" color="#2b91af"><font size="2" color="#2b91af">


</font></font><font size="2" color="#2b91af">



entry = RasEntry.CreateVpnEntry("MTM", IPAddress.Loopback.ToString(), RasVpnStrategy.Default,RasDevice.GetDeviceByName("xxx", RasDeviceType.Serial));

What would be in "xxx" ?

I'm working in XPsp2, so I compiled your DotRas for this windows, would it work in Vista or Windows 7?


Thanks once again for your help,


Mar 10, 2010 at 12:36 AM

You must not have bothered to read anything in the SDK, which that makes me extremely frustrated. I spent the time to write all that so I wouldn't have to keep answering these questions. I even put a notice on the discussion boards to NOT ask questions that have already been asked without first consulting the SDK. I don't mind answering questions, but when you're asking questions I've answered a few dozen times already (including one I answered earlier today yet again) I stop responding. Look in the SDK, the examples are there for a reason. You'll need to figure the rest of it out on your own using the SDK and included documentation. If something isn't in the documentation, then come to me and ask.

Sorry, and good luck.

Mar 10, 2010 at 12:09 PM

Hi Jeff,

you are absolutely right, but please dont fell frustrated, it's not your fault, thats my fault.. I read the your doc in the first place, but then I didnt know what to do, and I asked you the first question.. After that, when you answered my question I should get back to the documentation to look for this or search in the discussion board before start asking again.

And I know how can people fell when answering those questions a dozen times, but I only have to thank you to have created this library and making life easier for many people.

And thanks, with you sdk and discussion board I already know the answers I made you before.


I tried to find, but I couldnt.. And thats the only reason I'm asking..

I tried to crete a new entry in the phonebook with:

RasEntry entry = RasEntry.CreateVpnEntry("MTM", IPAddress.Loopback.ToString(), RasVpnStrategy.Default, RasDevice.GetDeviceByName("Communications cable between two computers", RasDeviceType.Modem));

I know that is "Communications cable between two computers" because I saw in the system which COM port this device has.

Can I check with DotRas which COM port is used by each device? or which COM port does this device uses?


Thanks once again Jeff



Mar 10, 2010 at 2:27 PM

If you want to see how your original working entry was configured try looking at it like this

RasPhoneBook pbk = new RasPhoneBook();
pbk.Open(); // You'll need to use an overload here if you didn't check for this connection to be availabel to all users.

RasEntry entry = pbk.Entries["Your Entry Name"];

If you look at the entry here in the debugger, you'll be able to see what exactly has been set on your known working entry that you tested earlier. That's what I meant earlier by writing down the information on a piece of paper. You'll simply have to create a new instance of the RasEntry class, either from the exposed constructor or from those static helper methods, and then add it to a phone book. You should be able to look at the Device property of your existing connection to see which device has been used. I can't tell you specifically what that device name is, it changes for every device. You need to find out which it is yourself.

Another way to find the name of the devices is:

ReadOnlyColection<RasDevice> devices = RasDevice.GetDevices();

From here you can inspect the devices collection in the debugger and look at all available devices reported by your machine. This also might help you find the appropriate device.

Mar 10, 2010 at 2:54 PM

Thanks Jeff, but already check that..

Looking at the RasEntry with my entry configured or listing all devices with GetDevices() did not showed me the COM port it was using.

With it I could check it was a "Communications cable between two computers" with the modem device, in RasEntry and RasDevice properties.

The problem it that I have saveral connections with "Communications cable between two computers" like:

"Communications cable between two computers #1", "Communications cable between two computers #2", "Communications cable between two computers #3", and I can not see which one is with COM4.. They all have different COM port numbers, but I cant check the port number anywhere..


Any ideias?

Thanks a lot..

Mar 10, 2010 at 3:06 PM

Unfortunately right now DotRas does not support querying information from the hardware. You may want to investigate using WMI to pull that information, but that is outside the scope of this project.

Mar 10, 2010 at 3:29 PM

Thanks a lot for your help Jeff,

if you need anything from Lisbon, Portugal, just let me know.. And congratulations for this great project of yours.

Best regards,


May 29, 2011 at 5:34 PM

after a lot of research, i found this :


hope it help you guys