New to USB, Is this possible?

Hi everyone,

So I'm working on a new project where I want a web browser to a certain site to open whenever my USB device is plugged in and send some data. I plan on using a Cypress Encore chip and am looking over all the app notes and sample code but most of it just directly sends data like a mouse or keyboard. Is there a good resource on sending commands to a PC/Mac? Please let me know if you have any ideas on how to implement this system or if you've encountered something similar.

Thank you in advance,

Travis Cochran

Reply to
Sivart
Loading thread data ...

You can't really do it without writing a custom app on the PC.

You CAN however make your device look like a storage device, and put an autorun file on it that will cause Windows to open a browser and load your site - you can embed active content in it that will send whatever it is you're trying to send. But on any properly configured machine this will not work.

Reply to
larwe

Two ideas:

1) Using an operating system like windows insecure enough to automatically execute code off of untrusted media, you can have your device emulate a USB mass storage (ie "thumb drive") and have an autorun.inf on it. This would read data from an emulated file on the device and upload it to the web site. This is a common method for viruses to propagate, so it may be closed off at some point. 2) Write a USB driver for your device for various host systems. Have the driver automatically read the data and upload it when the operating system's USB stack tells your driver that it has a newly connected device to deal with. This is safer, but the user will have to install a driver for your device (and you have to provide a version of the driver appropriate to their operating system)

It's best to do this from software executing on the PC/Mac, triggered by the presence of the USB device.

Reply to
cs_posting

On a Linux system with a kernel 2.6 or later, or on a BSD system, it ought to be possible to write udev rules to trigger your choice of actions when a USB device is found.

Mel.

Reply to
Mel

Good point. Of course you could argue that this constitutes writing a driver - just in a particular high-level language.

Reply to
cs_posting

ought

when a

Thank you for all of your ideas. I think right now my best bet is to have my device recognized as a storage device and have either a autorun file or a driver install file on it since I won't have access to all of the computers this will be used on before hand. This shouldn't be too hard to accomplish with a Cypress USB MCU.

Thanks again for all your help.

-Travis

Reply to
Sivart

Is this a "catch 22" ?

If the driver is on the device, and you need to load the driver *before* the device can be used, how will the driver ever get loaded ?

Did that make sense ??

Also, can a single USB device enumerate as two devices ??

Say, a hard drive and a serial port ?

Or any two devices ?

How does the enumeration process work aon the device side, can the same device hardware respond twice ?

Thanks

don

Reply to
don

ve

or

No, because the operating system typically implements the mass-storage device driver.

It's not clear if his custom "driver" will be a new driver to put the device in some other mode that is not mass-storage, or just something that extends the functionality of a device still treated as mass- storage by the operating system's USB implementation. I'd recommend the later.

Reply to
cs_posting

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.