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)?
Your web browser cares about retrieving web pages from a networked server - you enter a host name when you specify the URL in the browser. If the web browser instead gets a file name, then it can show a HTML page from a disk, but a disk file is static - you need to interface with a web server to get dynamic content. In the end, the concept of the World Wide Web is all about networking.
It's possible to have a USB-connected device show up as a networked device, since it's possible to have USB-connected network cards, WiFi routers etc. But it isn't simple. It's easier to have your device show up as a HID or serial port and to ship a Windows application that hosts a local web server and retrieves the page content from the USB-connected device.
not necessarily...
If you point your browser at an HTML file on your disk, then edit the file with a separate application, save it, then "refresh" the page in the browser - you will see the changed content!
You can code the HTML to have the browser automatically refresh: www.htmlcodetutorial.com/.../index_tagsupp_4.html
There may be some issues with OS caching and file locking, though...
It's all a question of the definition of static/dynamic.
Constant reload of a file is regularly used to pick up the latest log lines from a running program, or to re-display the contents of a state file.
But it doesn't send information to the server, so the file doesn't get updated with dynamic content based on the client (unless that state file shows number of bytes sent out by the file server). So the file content retrieved isn't really dynamically produced based on user actions.
The closest you could get would be to have the web browser retrieve sequences of different file names, and have the file server understand the names served and take the file names as commands to regenerate files based on the sequence of files retrieved. But it would suffer quite a long list of severe disadvantages.
In the end, dynamic information - instead of just page reloads - makes use of two-way interaction.
I wanted to make this process simple. Instead of the user editing the HTML file. We can place a Save Config button on the page. So this is what I find we can do: 1) User plugs in the device. A Drive(mass storage) shows up with an html page inside. User opens the page. 2) The user can edit few config parameters, if he/she wants to. 3) User presses the "save config" button. This saves a config file in the Downloads folder. 4) User drags this config file into the Drive(mass storage).
I have following questions: A) Will above method work? Can we send data to the device by dragging a config file into it? B) Do we require Mac or Windows specific code for this? C) Considering we have 128k flash (16k SRAM), would the boilerplating (Win and Mac installers) code, FAT file system, USB mass storage class and HTML page fit in and run well? D) How can we use Keil to help us with this? Does Keil provide any stacks for this?
Ethernet over USB (Gadget)
blackfin.uclinux.org/doku.php:usb-gadget:ethernet
The USB peripheral will enumerate to the host as an Ethernet device, using the "usbnet" driver with Linux hosts or Microsoft's RNDIS driver with Windows hosts. Set it up like any other two-host Ethernet link; bridging it to the LAN from the USB host may be the easiest way to run. Linux hosts do this with CONFIG_BRIDGE and tools like “brctl”. Windows XP hosts have a GUI for bridging; it comes up when the RNDIS driver creates a second network link.
Search result of 'ethernet over usb stm32'
my.st.com/.../Flat.aspx
View all questions in Keil forum