Solved

How to convert a PC into a USB device

Posted on 2011-03-08
14
289 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
 
LVL 12

Expert Comment

by:HappyCactus
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:Leaping-Dog
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Can anyone help me with this question???
0
 

Author Closing Comment

by:Leaping-Dog
Comment Utility
Ok solution
0

Featured Post

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Join & Write a Comment

Suggested Solutions

this article is a guided solution for most of the common server issues in server hardware tasks we are facing in our routine job works. the topics in the following article covered are, 1) dell hardware raidlevel (Perc) 2) adding HDD 3) how t…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now