views:

99

answers:

2

I have a client that would like a small PIC board that plugs into a PC's USB as a dongle in HID mode. It would basically just transfer small amounts of data over RF to another device across the room. They would like the data to come from the web. ie. user clicks a link in their browser which wakes up the PIC board and begins a download to the PIC device without the need for another application to visibly popup in front of the user.

I would think this can't be done without the setting up the browser preferences and assigning a custom application to recognize the data file. The security issues with a link initiating this kind of flow of events must be too great unless I'm missing something. Has anyone done something like what I described above?

A: 

Yeah that sequence of events doesn't seem too kosher. Perhaps a browser plugin or a program running on the PC that handles communication between the PIC and web would be better?

Stephen Friederichs
I agree. I just read about browser plugins and NPAPI/ActiveX. The use case is most similar to clicking a link to a Word doc and having Word open it automatically. Yeah this is done with MIME types and browser preferences but ideally this could be done automatically and with as little user notification as possible. Accepting a browser plugin is fine.
realdeal
Does doing a plug-in lock you in to the one particular browser you write a plug-in for? Or is there a common plug-in architecture that is supported by all browsers?
Craig McQueen
+1  A: 

You could write a small piece of software that runs in the background on the PC (e.g. a Windows service), and:

  • Interfaces to the PIC device via USB
  • Provides a web interface on port 80 or probably some other port, which the browser can then connect to.

If the PIC device is network connected (e.g. has an Ethernet connection, and its own IP address on the network) then the PIC device could provide a web interface to control it. I don't know how feasible it is to fit a small web server onto a PIC though--that would be a tight fit.

Craig McQueen
I have done several projects with a PIC18F67J60 with a HTTP server and file upload. So it will fit in a PIC easily.
Robert