Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TCP/IP over USB

12 views
Skip to first unread message

PaulH

unread,
Sep 5, 2007, 5:16:54 PM9/5/07
to
Is there a way to do TCP/IP communications over a USB connection?
Preferably one that does not involve active-sync.
If anybody has any samples or can point me to the proper API calls, I
would appreciate it.

Thanks,
PaulH

Paul G. Tobey [eMVP]

unread,
Sep 5, 2007, 5:39:58 PM9/5/07
to
There's nothing built in to do that, other than what ActiveSync is based on.
Are you the host or the device on USB? If you're the host and you can make
the external device look like a network device, you could do what ActiveSync
does, except in reverse, I guess. If you're the client, you could, in
theory at least, use what ActiveSync does, without ActiveSync itself. You
look like a USB RNDIS adapter and, as long as the suitable PC-side driver
for USB RNDIS is installed, everything should work just like when ActiveSync
is running, but you don't have to sync.

I think you're going to have to tell us what sort of a device this is,
whether you are the device OEM and are in control of the OS development or
not, who is the host and who is the device on the USB connection, etc.

Paul T.

"PaulH" <paul...@gmail.com> wrote in message
news:1189027014.7...@19g2000hsx.googlegroups.com...

PaulH

unread,
Sep 5, 2007, 5:51:52 PM9/5/07
to
On Sep 5, 4:39 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT no

instrument no spam DOT com> wrote:
> There's nothing built in to do that, other than what ActiveSync is based on.
> Are you the host or the device on USB? If you're the host and you can make
> the external device look like a network device, you could do what ActiveSync
> does, except in reverse, I guess. If you're the client, you could, in
> theory at least, use what ActiveSync does, without ActiveSync itself. You
> look like a USB RNDIS adapter and, as long as the suitable PC-side driver
> for USB RNDIS is installed, everything should work just like when ActiveSync
> is running, but you don't have to sync.
>
> I think you're going to have to tell us what sort of a device this is,
> whether you are the device OEM and are in control of the OS development or
> not, who is the host and who is the device on the USB connection, etc.
>
> Paul T.
>
> "PaulH" <paul.h...@gmail.com> wrote in message

>
> news:1189027014.7...@19g2000hsx.googlegroups.com...
>
> > Is there a way to do TCP/IP communications over a USB connection?
> > Preferably one that does not involve active-sync.
> > If anybody has any samples or can point me to the proper API calls, I
> > would appreciate it.
>
> > Thanks,
> > PaulH

What I'm looking for is a way to communicate with a group of WM2005
and WM2006 devices over USB. The PC would be the server and the WM2005
devices the clients, in this case.

I looked up RNDIS as a possibility, but haven't seen a whole lot in
the way of examples for using that online. Are there any?

I have access to all of the OS development libraries.

Thanks,
PaulH

Bruce Eitman [eMVP]

unread,
Sep 5, 2007, 5:52:44 PM9/5/07
to
USB? Is that host or function? What version of CE?


--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

"PaulH" <paul...@gmail.com> wrote in message
news:1189027014.7...@19g2000hsx.googlegroups.com...

Paul G. Tobey [eMVP]

unread,
Sep 5, 2007, 6:01:13 PM9/5/07
to
It sounds like what you want is to use the network connectivity that
ActiveSync 4.x already provides, but without popping up ActiveSync. Can you
do what you want right now with the device connected as an ActiveSync guest?
Seems to me like you should be able to. If I understand correctly, if
that's the case, you should be able to remove ActiveSync from the PC side,
leaving the USB RNDIS driver for the mobile device installed.

Paul T.

"PaulH" <paul...@gmail.com> wrote in message

news:1189029112....@57g2000hsv.googlegroups.com...

PaulH

unread,
Sep 5, 2007, 6:25:01 PM9/5/07
to
On Sep 5, 5:01 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT no

instrument no spam DOT com> wrote:
> It sounds like what you want is to use the network connectivity that
> ActiveSync 4.x already provides, but without popping up ActiveSync. Can you
> do what you want right now with the device connected as an ActiveSync guest?
> Seems to me like you should be able to. If I understand correctly, if
> that's the case, you should be able to remove ActiveSync from the PC side,
> leaving the USB RNDIS driver for the mobile device installed.
>
> Paul T.
>

I'd ultimately like to be able to control the 802.11 connection, so I
can't actually use active-sync even as a guest since it
does...unfortunate things to the 802.11 radio in some versions of
WM2005. But, uninstalling it from the host PC side, should be okay.

So, what do I need to do to communicate with the device over USB?

Thanks,
PaulH

Paul G. Tobey [eMVP]

unread,
Sep 5, 2007, 6:34:00 PM9/5/07
to
I'm not talking about ultimately, but whether the underlying network
implementation actually works. Use the ActiveSync connection and write your
server and client code. They don't know how they are communicating, anyway.
If that works, then you have your communication channel. All you have to do
is work around the fact that ActiveSync is dropping the WiFi connection (or
just communicate with the PC over WiFi -- you can't do that?). There was a
recent thread in microsoft.public.pocketpc.activesync where a guy came up
with a means of preventing WM5 from dropping the WiFi connection (he's using
an NDIS intermediate driver to ignore unbind requests from ActiveSync to the
WiFi connection; not my favorite way to do it, but it should work). Here's
a thread link:

http://groups.google.com/group/microsoft.public.pocketpc.activesync/browse_thread/thread/a26492e75a620ba9/c01c5dca99194550?lnk=gst&q=ndis&rnum=1&hl=en#c01c5dca99194550

Paul T.

"PaulH" <paul...@gmail.com> wrote in message

news:1189031101....@w3g2000hsg.googlegroups.com...

PaulH

unread,
Sep 6, 2007, 9:44:36 AM9/6/07
to
On Sep 5, 5:34 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT no

instrument no spam DOT com> wrote:
> I'm not talking about ultimately, but whether the underlying network
> implementation actually works. Use the ActiveSync connection and write your
> server and client code. They don't know how they are communicating, anyway.
> If that works, then you have your communication channel. All you have to do
> is work around the fact that ActiveSync is dropping the WiFi connection (or
> just communicate with the PC over WiFi -- you can't do that?). There was a
> recent thread in microsoft.public.pocketpc.activesync where a guy came up
> with a means of preventing WM5 from dropping the WiFi connection (he's using
> an NDIS intermediate driver to ignore unbind requests from ActiveSync to the
> WiFi connection; not my favorite way to do it, but it should work). Here's
> a thread link:
>
> http://groups.google.com/group/microsoft.public.pocketpc.activesync/b...

If I have 10 WM2005 devices attached to a PC by a USB hub, how do I
address them individually? Can ActiveSync support more than one device
at a time?

Thanks,
Paul

PaulH

unread,
Sep 6, 2007, 9:48:26 AM9/6/07
to
On Sep 5, 5:34 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT no

instrument no spam DOT com> wrote:
> I'm not talking about ultimately, but whether the underlying network
> implementation actually works. Use the ActiveSync connection and write your
> server and client code. They don't know how they are communicating, anyway.
> If that works, then you have your communication channel. All you have to do
> is work around the fact that ActiveSync is dropping the WiFi connection (or
> just communicate with the PC over WiFi -- you can't do that?). There was a
> recent thread in microsoft.public.pocketpc.activesync where a guy came up
> with a means of preventing WM5 from dropping the WiFi connection (he's using
> an NDIS intermediate driver to ignore unbind requests from ActiveSync to the
> WiFi connection; not my favorite way to do it, but it should work). Here's
> a thread link:
>
> http://groups.google.com/group/microsoft.public.pocketpc.activesync/b...

By the way, that's a really interesting thread. Thank you for that.

<ctacke/>

unread,
Sep 6, 2007, 9:58:03 AM9/6/07
to
ActiveSync cannot handle that - it's a single-client-only model.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com


"PaulH" <paul...@gmail.com> wrote in message

news:1189086276....@y42g2000hsy.googlegroups.com...

PaulH

unread,
Sep 6, 2007, 10:09:02 AM9/6/07
to
On Sep 6, 8:58 am, "<ctacke/>" <ctacke[at]opennetcf[dot]com> wrote:
> ActiveSync cannot handle that - it's a single-client-only model.
>
> --
>
> Chris Tacke, Embedded MVP
> OpenNETCF Consulting
> Managed Code in an Embedded Worldwww.OpenNETCF.com
>

Exactly my problem. So, how do I use the USB connection as a TCP/IP
network device?

Paul G. Tobey [eMVP]

unread,
Sep 6, 2007, 12:07:20 PM9/6/07
to
When you have those devices plugged in, what does the Network Connections
applet under Settings in the Start menu on the PC show? 10 adapters, one
for each device?

Anyway, why can't you just use WiFi for all of your communication?

Paul T.

"PaulH" <paul...@gmail.com> wrote in message

news:1189087742.9...@y42g2000hsy.googlegroups.com...

PaulH

unread,
Sep 6, 2007, 12:38:45 PM9/6/07
to
On Sep 6, 11:07 am, "Paul G. Tobey [eMVP]" <p space tobey no spam AT

no instrument no spam DOT com> wrote:
> When you have those devices plugged in, what does the Network Connections
> applet under Settings in the Start menu on the PC show? 10 adapters, one
> for each device?
>
> Anyway, why can't you just use WiFi for all of your communication?
>
> Paul T.
>

All that shows is the 2 network cards I have in my system normally. I
don't see the WM2005 devices at all.

-PaulH

Paul G. Tobey [eMVP]

unread,
Sep 6, 2007, 12:55:59 PM9/6/07
to
If you plug just one in, does *that* show up? If not, you don't have the
RNDIS driver installed, I would think, or maybe you have Advanced Network
Functionality turned off on the device (my device doesn't have that switch).

How about answering the question that I've asked three times now?

>> Anyway, why can't you just use WiFi for all of your communication?

Paul T.

"PaulH" <paul...@gmail.com> wrote in message
news:1189096725.2...@w3g2000hsg.googlegroups.com...

PaulH

unread,
Sep 6, 2007, 2:17:32 PM9/6/07
to
On Sep 6, 11:55 am, "Paul G. Tobey [eMVP]" <p space tobey no spam AT

no instrument no spam DOT com> wrote:
> If you plug just one in, does *that* show up? If not, you don't have the
> RNDIS driver installed, I would think, or maybe you have Advanced Network
> Functionality turned off on the device (my device doesn't have that switch).
>
> How about answering the question that I've asked three times now?
>
> >> Anyway, why can't you just use WiFi for all of your communication?
>
> Paul T.
>

I can't use the 802.11 radio for the communications because I intend
to use this connection to modify the state of the 802.11 radio. If I
modified it in a way that caused it to lose connection, then I would
be stuck and unable communicate with the device.

It doesn't show up if I plug just one device in, either. So, I need an
RNDIS driver. Is that something I can get from MS, or will I have to
write my own? Do I need one on both the device and the PC side? Does
MS provide a sample one in the XP DDK?

I don't know if Advanced Network functionality is enabled or not. Is
there a way to tell? There isn't an option on the device UI to do
that.

Paul G. Tobey [eMVP]

unread,
Sep 6, 2007, 2:32:20 PM9/6/07
to
The RNDIS driver would be installed when ActiveSync is installed on the PC.
I'm not sure if there's a way to get it separately from that (it's not
'just' a standard RNDIS driver, as I understand it). Nothing new is
required on the device. The Advanced option is set via the ActiveSync
application on the device.

So, it's still unclear to me why you're trying to connect to a server on the
PC at the same time as you're trying to reconfigure the WiFi and why you're
doing it for so many devices at once. I can envision some sort of
'provisioning' operation where you connect to the PC server, ask it for the
right WiFi parameters and reconfigure the WiFi, but, once you've got the
information, I don't see why you'd need to be connected any more (why you
couldn't connect the devices one at a time). If you used ActiveSync, the
means to get the provisioning information would be many. You could have IIS
running on the PC and get it via the Web browser on the device. You could,
if you really want to, have a TCP server with your own custom protocol, of
course too; it's just more work. If this is a one-time-only provisioning
operation, it also seems like doing that before putting the device in
service would be even easier. No server, no network client, just a program
to set the WiFi settings based on an XML file, say. Are you expecting the
devices to travel from one 'configuration station' to another or the WiFi
settings to change frequently?

Paul T.

"PaulH" <paul...@gmail.com> wrote in message

news:1189102652.5...@d55g2000hsg.googlegroups.com...

PaulH

unread,
Sep 6, 2007, 4:44:41 PM9/6/07
to
On Sep 6, 1:32 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT no

instrument no spam DOT com> wrote:
> The RNDIS driver would be installed when ActiveSync is installed on the PC.
> I'm not sure if there's a way to get it separately from that (it's not
> 'just' a standard RNDIS driver, as I understand it). Nothing new is
> required on the device. The Advanced option is set via the ActiveSync
> application on the device.
>
> So, it's still unclear to me why you're trying to connect to a server on the
> PC at the same time as you're trying to reconfigure the WiFi and why you're
> doing it for so many devices at once. I can envision some sort of
> 'provisioning' operation where you connect to the PC server, ask it for the
> right WiFi parameters and reconfigure the WiFi, but, once you've got the
> information, I don't see why you'd need to be connected any more (why you
> couldn't connect the devices one at a time). If you used ActiveSync, the
> means to get the provisioning information would be many. You could have IIS
> running on the PC and get it via the Web browser on the device. You could,
> if you really want to, have a TCP server with your own custom protocol, of
> course too; it's just more work. If this is a one-time-only provisioning
> operation, it also seems like doing that before putting the device in
> service would be even easier. No server, no network client, just a program
> to set the WiFi settings based on an XML file, say. Are you expecting the
> devices to travel from one 'configuration station' to another or the WiFi
> settings to change frequently?
>
> Paul T.
>
> ...
>
> read more »

I have ActiveSync v4.5.0 installed on the PC. ActiveSync on the device
appears to be pretty simple and doesn't have much in the way of
options other than setting the device to connect via BlueTooth, IR, or
USB.

I'm trying to set up a test station where a group of devices can be
attached by USB to a host PC and given a series of commands to test
the functionality of the overall system. The device would then send
the results of those commands back to the PC for validation and
logging purposes. Currently, I'm limited to configuring these tests on
each individual device and collecting the logs myself via SD-card.

-PaulH

Paul G. Tobey [eMVP]

unread,
Sep 6, 2007, 5:09:43 PM9/6/07
to
OK. So I think that your best chance is getting the RNDIS driver to work
and figuring out how to make more than one work at a time or how to step
from one to the next to the next, giving each a chance to communicate.
That's going to be a challenge, but I don't see another way to accomplish it
if you *have* to have them all connected at once. On the device side, you
should attempt to connect to the IP corresponding to "ppp_peer"; that will
be the PC. The PC should accept connections, if possible, only on the IP
address assigned to the RNDIS adapter(s), so you aren't opening a potential
security hole to the rest of the network. That's about all the hints I
have...

For background, when you connect a USB device, the device tells the PC what
sort of a device it is and the PC loads a corresponding driver for it. That
driver has to know what to send and receive with the device to make things
work. You can't just say, oh, send some TCP/IP data to that USB flash
drive; that doesn't make sense. It's somewhat analogous to saying that you
want to send some TCP/IP data over the PCI bus in your PC. What would that
mean in the context of a video card? The driver for each device knows what
and how to send suitable data to the device on the bus to accomplish the
task for which the driver and the device were designed. What actually goes
over the bus depends on both of those components. So, you can't just treat
USB as a pipe through which you're going to send packets in TCP format; you
need a driver for the device that will allow it to be treated as a network
adapter, which is what RNDIS is. The problem is that Windows Mobile makes
some assumptions about usage patterns that don't really include a single
person having a dozen devices. It's designed to handle a single device
connected at a time.

Paul T.

"PaulH" <paul...@gmail.com> wrote in message

news:1189111481....@r29g2000hsg.googlegroups.com...

Bruce Eitman [eMVP]

unread,
Sep 6, 2007, 5:21:44 PM9/6/07
to
Wait a minute, WM2005? IIRC that is not RNDIS, it is serial over USB.

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

"PaulH" <paul...@gmail.com> wrote in message
news:1189096725.2...@w3g2000hsg.googlegroups.com...

Paul G. Tobey [eMVP]

unread,
Sep 6, 2007, 5:32:19 PM9/6/07
to
It's RNDIS for my WM5 device and that's the default. You can check the
Connections page in the device's control panel and see that there's a
Remote-NDIS item in there. When you turn off Advanced Network Functionality
(or whatever that option is), it uses serial-over-USB.

Paul T.

"Bruce Eitman [eMVP]" <beitman...@applieddata.net.nospam> wrote in
message news:%23ZpdHxM...@TK2MSFTNGP03.phx.gbl...

Bruce Eitman [eMVP]

unread,
Sep 6, 2007, 6:18:32 PM9/6/07
to
Right, he means WM 5.0. I knew better than to post that, but when I saw the
date I assumed it predated 5.0.

--
Bruce Eitman (eMVP)
Senior Engineer
beitman AT applieddata DOT net

Applied Data Systems
www.applieddata.net
An ISO 9001:2000 Registered Company
Microsoft WEP Gold-level Member

"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:%23JS1l1M...@TK2MSFTNGP02.phx.gbl...

Paul G. Tobey [eMVP]

unread,
Sep 6, 2007, 6:27:56 PM9/6/07
to
Ah! Sorry. I just read it as "WM5"... Any bets on whether the next
Windows Mobile version is year-based or number-based? I'm betting on
Windows Mobile 2009 for Pocket PC Standard Classic Professional Phone
Edition.

Paul T.

"Bruce Eitman [eMVP]" <beitman...@applieddata.net.nospam> wrote in

message news:etvN1QN...@TK2MSFTNGP02.phx.gbl...

PaulH

unread,
Sep 6, 2007, 6:30:37 PM9/6/07
to
On Sep 6, 11:07 am, "Paul G. Tobey [eMVP]" <p space tobey no spam AT

no instrument no spam DOT com> wrote:
> When you have those devices plugged in, what does the Network Connections
> applet under Settings in the Start menu on the PC show? 10 adapters, one
> for each device?
>
> Anyway, why can't you just use WiFi for all of your communication?
>
> Paul T.
>

I found the advanced functionality, finally.
Under Settings->Connections->USB to PC

With this enabled, the device does show up as a "Local Area
Connection" on the Network Connections on the host PC.

If I connect more than one device, however, only the first device I
connect to appears as a network connection.

Thanks,
-PaulH

PaulH

unread,
Sep 6, 2007, 6:50:51 PM9/6/07
to
On Sep 6, 5:27 pm, "Paul G. Tobey [eMVP]" <p space tobey no spam AT no

instrument no spam DOT com> wrote:
> Ah! Sorry. I just read it as "WM5"... Any bets on whether the next
> Windows Mobile version is year-based or number-based? I'm betting on
> Windows Mobile 2009 for Pocket PC Standard Classic Professional Phone
> Edition.
>
> Paul T.
>
> "Bruce Eitman [eMVP]" <beitman.nos...@applieddata.net.nospam> wrote in
> messagenews:etvN1QN...@TK2MSFTNGP02.phx.gbl...

>
> > Right, he means WM 5.0. I knew better than to post that, but when I saw
> > the date I assumed it predated 5.0.
>
> > --
> > Bruce Eitman (eMVP)
> > Senior Engineer
> > beitman AT applieddata DOT net
>
> > Applied Data Systems
> >www.applieddata.net
> > An ISO 9001:2000 Registered Company
> > Microsoft WEP Gold-level Member
>
> > "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
> > com> wrote in messagenews:%23JS1l1M...@TK2MSFTNGP02.phx.gbl...

> >> It's RNDIS for my WM5 device and that's the default. You can check the
> >> Connections page in the device's control panel and see that there's a
> >> Remote-NDIS item in there. When you turn off Advanced Network
> >> Functionality (or whatever that option is), it uses serial-over-USB.
>
> >> Paul T.
>
> >> "Bruce Eitman [eMVP]" <beitman.nos...@applieddata.net.nospam> wrote in
> >> messagenews:%23ZpdHxM...@TK2MSFTNGP03.phx.gbl...

> >>> Wait a minute, WM2005? IIRC that is not RNDIS, it is serial over USB.
>
> >>> --
> >>> Bruce Eitman (eMVP)
> >>> Senior Engineer
> >>> beitman AT applieddata DOT net
>
> >>> Applied Data Systems
> >>>www.applieddata.net
> >>> An ISO 9001:2000 Registered Company
> >>> Microsoft WEP Gold-level Member
>

Somebody doing a google search on "Window Mobile 2009" is going to
find this thread and the next thing you know, Engadget will have an
article quoting a 'reliable inside source' that says the next version
of Windows Mobile has been named. ;-)

Paul G. Tobey [eMVP]

unread,
Sep 6, 2007, 6:54:42 PM9/6/07
to
Yes, that's the problem. So, you have two choices that I see:

1. Do what we've been talking about, trying to get multiple 'adapters' to
work or figuring out how to cycle from one to the next to the next.

2. Turn off the advanced networking functionality and use the 'serial' port
that the USB connection will emulate and try to communicate with the devices
that way. I'm not familiar enough with this mode of operation to know if a
separate COM port will be created for each device or what might go wrong
with a pile of connected devices, though. You might set several devices to
this mode, connect them up to the PC and look in ActiveSync and see what
ports show up in the Connection Settings dialog when allow serial
connections is on. If you hook up four devices and there are four 'extra'
serial ports in that list, there might be hope that you could write a serial
program, rather than a TCP/IP program, as your PC-side server and
communicate that way with a serial port program on the device. Again, I'm
not very confident in how exactly that all works, particularly on the device
side, but it's a possibility.

I think you've got all the information on doing this that's in my head,
now...

Paul T.

"PaulH" <paul...@gmail.com> wrote in message

news:1189117837.5...@g4g2000hsf.googlegroups.com...

0 new messages