Solved

How to convert a PC into a USB device

Posted on 2011-03-08
14
295 Views
Last Modified: 2012-06-22
I am working on an embedded PC application and would like to turn my mini-computer into a USB device.  This means that it can be plugged into another computer and then recognized as a device - just like a printer is automatically recognized.

I run custom software on the mini-computer and want to output a string from the mini-computer to another computer via the USB cable.  The other computer will also have a custom software program which is able to read the string coming from the USB cable.

My question is: is there some type of off the shelf product which I can use with the mini-computer to easily do this?  If so, is there a brand which you would recommend?  I would like it as easy as possible without needing to create custom drivers - if possible.

The software in which the device needs to interface with is VB6 as well as VB.NET.

Thanks
0
Comment
Question by:Leaping-Dog
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
14 Comments
 
LVL 2

Expert Comment

by:Ph0en1x3
ID: 35073372
This is easier said then done...    You need a PC USB driver and some kind of app interface on the master device.    I recently did a custom driver that connected a PC with an app (to send the string to the USB stack) and an embedded slave device which received the command and did something....      It was more work then I expected.      USB is different then serial (rx/tx) because the slave "can't" advertise that it needs to send information, the master has to go into USB read mode and read a specific amt of characters..     This site was a life saver as microsoft staff responded to my tough questions...  http://www.osronline.com/
0
 
LVL 12

Expert Comment

by:HappyCactus
ID: 35081165
If the USB port is not an OTG , you also need to modify the hardware - slave devices needs a pullup resistor that master devices doesn't have.
0
 

Author Comment

by:Leaping-Dog
ID: 35081274
I was hoping that there was an off the shelf product black box in which you plug into the slave device's USB port to turn it into a USB device.

 Then you can plug your other computer into the black box's female USB port, in order for your second computer to communicate with your slave computer.

I thought I saw a product like this, which included all drivers and stuff, but the search terms are so common, I am finding it difficult to find any relevant off the shelf products.

Also, what I am attempting to do should be trivial, at least it was using RS-232.  I just need to send a string from one computer to another, as well as have the USB device recognition.  Should be such a common task that someone commercialized a solution - I hope?

I just can't imagine being forced to engineer a costly solution for such a trivial and commonly needed task.

Please share your thoughts...
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 12

Expert Comment

by:HappyCactus
ID: 35081296
You could use an USB to serial converter with the USB side to the PC and the serial cable on the other side.
Or you can use two usb to serial cables.
This is the easiest solution.
I know nothing about the box you told about, but I never had the needs to search it.
0
 

Author Comment

by:Leaping-Dog
ID: 35081376
Interesting ideas HappyCactus.

What I need to construct is a peripheral device (sort of like a printer) which has an embedded mini-pc and has a female USB port.  Then you just plug in another computer into the new "device" and it automatically recognizes it and using software drivers a VB.Net program can then read the data stream coming from the new device.

Can your solution which you mentioned above achieve this?
0
 
LVL 12

Expert Comment

by:HappyCactus
ID: 35081436
BTW, first check that your embedded device doesn't already have a OTG usb port - if it has one, it can be used as an USB device. You only need the drivers.

Regarding your problem, with a pair of usb-to-serial converter you can "simulate" the plug-in in two ways:
First way: use the serial signals - DTR/DCD etc...
Second way: use a software protocol like this one:
Every time the USB serial device is plugged, start a program that periodically send a "wake-up" packet to the serial. When the device receive a "wake-up" packet, it sends a response and establish the connection.
After every data packet, wait for an ACK. When you do not receive the ACK, send a "goodbye" packet and put the device in the "wake-up" state. When a side receive a "goodbye" packet, put it on the wake-yp state.
This way you can simulate by software the connection and disconnection of the devices.

The easiest and most effective way is the first one.
0
 

Author Comment

by:Leaping-Dog
ID: 35081553
The mini-pc does not have a  OTG usb port, just a regular USB ports.  So your first solution will not work.

Thank you very much for your second solution, but I don't think it will work for me.  I can not use a work around solution, I need the absolute standard practice solution for this.
0
 
LVL 12

Expert Comment

by:HappyCactus
ID: 35081635
Wait, the "first" solution - not the OTG, but the Hardware handshake signals - ARE a standard solution, because they was used on the very old, good days to detect a connected modem (DCE) . In facts, when you open a serial port, the DTR signal goes automatically up.
0
 

Author Comment

by:Leaping-Dog
ID: 35081650
Cactus, I know what you are saying.  Its just that there must be standard USB protocol to achieve what I need.  This is a job for the US military, and I can not be using work around to get it to work, even though it is possible.  I am sure there is standard protocol which will work, its just a matter of being pointed in right direction.
0
 
LVL 2

Accepted Solution

by:
Ph0en1x3 earned 500 total points
ID: 35082387
Most PC and mini-pc devices with USB ports have drivers available from the manufacturer.    What it sounds like you are asking for is an user app that gives you the ability to transfer data???  If so check out http://www.lvr.com/.   I took her c# application and modified it to work my my custom usb driver.  
0
 
LVL 12

Expert Comment

by:HappyCactus
ID: 35082859
Leaping-Dog, really US army uses USB devices?? yep...

So: does your mini-pc have some expansion slot (PCI/PCIExpress/PCMCIA) ? Can you eventually develop some custom electronics?
0
 

Author Comment

by:Leaping-Dog
ID: 35103819
Can anyone help me with this question???
0
 

Author Closing Comment

by:Leaping-Dog
ID: 36966296
Ok solution
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Rasberry PI is a low cost piece of hardware that you can have a lot of fun with through experimenting and building/working on projects like media players, running a low cost computer, build data loggers etc. - see: https://www.raspberrypi.org
What do we know about Legacy Video Conferencing? - Full IT support needed! - Complicated systems at outrageous prices! - Intense training required! Highfive believes we need to embrace a new alternative.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question