Pic bassed webkey.

Got a hardware problem? ask for help

Pic bassed webkey.

Postby bobrob5k » November 10th, 2012, 12:17 pm

Hi all, i am looking to build a pic based webkey, a bit like this... (http://hackaday.com/tag/webkey/) i would like to build it as part of an E-business card to link to my online portfolio, so far i have managed to get a pic talking to the computer but this involves having custom drivers installed on the computer, i would like the business card to be handed out and and plugged into any computer to automatically boot up the default web browser and direct it to my page. can anyone shed some light on if this can be done?

Thanks all. :) x
bobrob5k
 
Posts: 19
Joined: February 26th, 2011, 6:22 am

Re: Pic bassed webkey.

Postby semicolo » November 10th, 2012, 2:11 pm

From the details of the hack you linked to, your usb device should act as an USB keyboard and send the keys required to invoke the Windows run dialog box, type the URL, and press the “enter” key.
User avatar
semicolo
 
Posts: 265
Joined: December 13th, 2011, 3:32 pm

Re: Pic bassed webkey.

Postby bobrob5k » November 10th, 2012, 5:09 pm

thanks for the reply, but im under the impression the end user would still be required to have/install some sort of driver to accept a pic bassed usb device as a keyboard?
bobrob5k
 
Posts: 19
Joined: February 26th, 2011, 6:22 am

Re: Pic bassed webkey.

Postby GaspingSpark » November 10th, 2012, 5:54 pm

No, it needs to report itself as a HID (Human Interface Device). Windows (and all other OSes) have built-in drivers for these.
GaspingSpark
 
Posts: 180
Joined: March 8th, 2011, 10:24 am

Re: Pic bassed webkey.

Postby bobrob5k » November 10th, 2012, 6:09 pm

thanks for the help, a quick search of Google got that all up and running, so problem now is entering the data, windows key, cmd, enter, explorer www.randomwebsite.com, enter ...i seem to have two options here whack all the data out quickly and have the computer miss information e.g. part of the web address and hang at the cmd line interface, of the code running slower in which case the computer resembles a Trojan virus slowly going from start menu to cmd to website (not very reassuring for a not so tec savvy person im sure) so my final question is, how do those webkeys do it so quickly and efficiently/in the back ground?

thanks again.
bobrob5k
 
Posts: 19
Joined: February 26th, 2011, 6:22 am

Re: Pic bassed webkey.

Postby st2000 » November 11th, 2012, 11:40 am

1. I know you said you have it working, but are you using the example Microchip code and (what Microchip calls) libraries (really source code you add to your program). There are already both HID keyboard examples as well as mass storage examples that emulate thumb drives. There are also Web Page Server examples - but that is stretching some of the less powerful PIC processors.

2. I may or may not go the HID/Keyboard route on this project. What I might try is to emulate a boot-able drive. That way you might be able to get up and running quicker. I might go as far as junking Windows all together and boot up a small "live CD" type image of something like Knoppix (I like using lmgtfy instead of listing out all the google hits - just ignore the sarcasm):
http://lmgtfy.com/?q=knoppix+usb+thumb+drive
...however, at this point, you might as well just hand out thumb drives. The down side to this approach is that your customers need to "boot up" with the thumb drive already plugged into the computer.

3. If I had to get a device working such that it brings up a web page on an already booted up Microsoft PC as fast as possible I would try to make a USB compound or complex (I can't remember which is the correct term) device. I would check if it is possible to get a PIC to appear as a HID to pump in commands and as a mass storage device to hold your web pages. That way you have both a way to tell the Windows box what to do and a place for it to get the web page from. There are many unanswered questions here. Can a PIC emulate two USB peripherals. Can you tolerate the time it takes to type all the commands in (although I should think the sequence: "WindowsKey+riexplore.exe http:///d:\yourpage.html<enter>" could be done rather quickly) . How do you know what the USB mass storage device letter assignment will be (That's Just a bad Windows design - from the beginning - I'll leave that one up to you to figure out). Once you have this worked out, I'm thinking you should be able to get a web page up on just about any well equipped Windows box with in, say, 10 seconds.

edit: added later...

4. Oh, you want to do it out of site? Again, look at using a plain thumb drive that is created to auto-boot upon insertion. Write a batch file to start iexplore up and point it at your URL out on the web. Or, to make it faster, figure out how to determine what drive it is executing from and point it at it's self as the source for the web page. Do post a follow up if you figure out how to figure out which drive letter you are operating out of.

edit: added even later...

Not leaving well enough alone try this command:

Code: Select all
wmic logicaldisk get caption,description,filesystem


You get back a list of all the devices on a particular computer. But the tricky part is to pick out the device that is your just installed USB thumb drive. As I am not a Windows person I can only guess as to which it is. But in the example it was the only device that said "Removable Disk" as well as a populated field that said "FAT". In Unix I would just say:
Code: Select all
wmic logicaldisk get caption,description,filesystem | grep -i removable | grep -i disk | grep -i fat | cut -c1,2

...and that would give me the drive letter (for this example at least)! I'll leave it up to you to figure out what needs to be done in a Windows cmd script file.

-good luck
st2000
 
Posts: 1199
Joined: February 3rd, 2011, 6:10 pm

Re: Pic bassed webkey.

Postby GaspingSpark » November 11th, 2012, 3:46 pm

There is supposedly a single key code that launches the web browser.

HID Consumer Page 0x0C
HID Usage ID 0x196

This is one of the application launch codes. Not sure how you send it with your PIC.

Send that followed by one of CTRL+L or ALT+D or F6 to select the address bar.

Followed by your URL and ENTER.


The USP HID code was found on page 80 here:
http://www.usb.org/developers/devclass_ ... 1_12v2.pdf
GaspingSpark
 
Posts: 180
Joined: March 8th, 2011, 10:24 am

Re: Pic bassed webkey.

Postby bobrob5k » December 12th, 2012, 4:39 pm

To go at this from a different angle (one that I have no experience of) would it be theoretically possible to use some sort MSD boot loader on the Pic and then just use the files commonly attributed to turning a flash pen into a webkey? Thoughts anyone? :)
bobrob5k
 
Posts: 19
Joined: February 26th, 2011, 6:22 am

Re: Pic bassed webkey.

Postby st2000 » December 12th, 2012, 5:30 pm

bobrob5k wrote:would it be theoretically possible to use some sort MSD boot loader on the Pic


At this point don't you need to configure your computer to be able to boot off a thumb drive. And is that something that is not universally possible on all hardware/BIOS. And are you not asking the person to reboot their computer. Also, at this point, what would be the difference between having an ordinary thumb drive and one with a PIC in it if all you are going to do is emulate a MSD with a boot image.
st2000
 
Posts: 1199
Joined: February 3rd, 2011, 6:10 pm

Re: Pic bassed webkey.

Postby bobrob5k » December 28th, 2012, 9:09 am

At this point don't you need to configure your computer to be able to boot off a thumb drive


why would it? my computer does not need to be rebooted and load from a flash pen every time i want to open say a note pad file from my flash pen which is a MSD :s
bobrob5k
 
Posts: 19
Joined: February 26th, 2011, 6:22 am

Next

Return to Help me! Hardware

Who is online

Users browsing this forum: Bing [Bot] and 5 guests