Solved

How to convert a PC into a USB device

Posted on 2011-03-08
14
291 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
  • 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Does your iMac really need a hardware upgrade? Will upgrading RAM speed-up your computer? If yes, then how can you proceed? Upgrading RAM in your iMac is not as simple as it may seem. This article will help you in getting and installing right RA…
Great sound, comfort and fit, excellent build quality, versatility, compatibility. These are just some of the many reasons for choosing a headset from Sennheiser.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

786 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