I've seen wifi routers host html webpages over ethernet cables. This eliminates the need for a PC app/software and the device can be configured using a PC web browser. I want to do something similar, but NOT using ethernet. I'm using Nuvoton NANO120LE3BN which has USB device. Is it possible to host a html webpage when the M0-cortex is connected to a PC/MAC as a USB device. Does Keil have a stack for doing this? If we do this do we need a driver on the PC ( Windoews 7/8 or MAC OSX)?
> I'd like to go with the USB mass storage approach described in my previous post.
Mass Storage class (MSC) approach also suffers pains around browser/OS differences. The JavaScript, running on the browser, can read a local setting file from the MSC drive (HTML5 FileReader API), but there is limitation when the script writes back the edited data to a file (HTML5 WriteFile API).
a) currently FileWriter API is supported on limited browsers. status.modern.ie/filewriter b) FileWriter can’t directly write back to the MSC drive, it can write just to "sandbox" folder (such as download folder).
Another problem of MSC approach is, the device can’t know exact timing when the file is updated. Writing to a FAT file system involves - write to file sectors - update of Directory - update of FAT All of above actions appear as WRITE10 SCSI command to the device, in unpredictable order. Additional "Eject" action by user may notify to the MSC device, over SCSI START/STOP command.
> Communication to USB device with PC web browser.
As discussed above, a web (HTML) and DHCP server on a virtual net over USB RNDIS is a popular solution, which gives better user experience. - Since XP SP3, Windows support RNDIS without any additional "driver (INF file)" installation, when your USB device gives MS OS descriptor for RNDIS. msdn.microsoft.com/.../gg463179.aspx - MacOSX requires RNDIS driver http://joshuawise.com/horndis
Another approaches found in this field are, - Browser plug-in, helper ActiveX (OCX) or JAVA applet - Local web server on the PC, which communicates with the USB device.
These methods are fine, when you restrict target browser/OS.
Tsuneo