Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to store web pages in microcontroller flash

Status
Not open for further replies.

akshada

Member level 3
Joined
Jun 29, 2010
Messages
67
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
india
Activity points
1,746
Hello all,
I am doing a project where the microcontroller (STM32) is sending the parameters to the server via DHCP using wifi module. So, now i want to make available an offline web page to the user where he will put the SSID and phrase of the DHCP. This web page will be stored in the microcontroller and when the user connects the device to the PC using USB, folder containing this webpage should appear on the screen.
Can anybody help me out on how do i do this?

Thank you.
 

You need to implement what's known as a HTTP server. Maybe you can find some code for this for small microcontrollers. If you can't, then
it is a little complex; you need to create your own HTTP server, which in part will need to implement what's known as a 'TCP listener'
and also a parser to understand the web request. Although not always a major deal, it is nevertheless non-trivial (depending on your requirements)
so you should try to find an existing http server.
 


Do you have any idea to access the web pages stored in the SD card connected to the controller(stm32F100) using USB.

thanks
 

By 'access', do you mean with a web browser?
If so, then you might be able to use a file:// URL to access via USB, if your storage looks like a flash drive (If it doesn't, then no).
You won't be able to use a http URL unless your device looks like a network device.
 

Actually I want the user to enter the ssid and the password in the browser. and when he enter "save" a txt file will be created in the SD card containing ssid and the password. Now, every time the device restarts it will find the ssid and the password from the sd card and will be connected to the internet.

thanks
 

I don't entirely understand what you're trying to do, but to cut a long story short, if you want a normal web browser to
accept input fields, then you need to run a http server. Where you run that is up to you, but it won't work unless the server
that is to accept the input field values resides on a network somewhere (i.e. with an IP address).
USB devices are possible that act as network cards, so I guess it is "feasible" but doesn't sound particularly easy to me,
especially since that device will need configuration too (e.g. an IP address, or DHCP?) so that it is up and able to communicate.
In summary you have a USB device, but a browser ordinarily expects a network device.
 

Description of my device:


The embedded device will be sending the sensor data to the remote server using wifi module(rn131C). For this we need SSID and pass phrase of the dhcp.

Now, this embedded device will be equipped with SD card and a USB to connect with PC.

So, I want is to keep some offline web pages in the SD card.When the device is connected to PC It will act as a mass storage device and we can access the web pages stored in the sd card.

On clicking the web pages, we will have a window for entering the SSID and password.after the user saves the information a text file containing SSID and pass phrase will be generated in the SD card.

now the device is disconnected from the PC and powered externally(5V DC)

The microcontroller will find the SSID and password from the SD card and will give to wifi module to connect to internet.

I hope this will clear the application.
Thanks..
 

Yes that is clearer, but the point still remains, that although you can retrieve a static page using the file:// URL, you can't
send http requests (like POST) because there is no http server to receive it and parse it.
It's physically impossible (for good reason) to do it any other way. Imagine if you didn't need a server, and your
static page could somehow achieve it. It would mean your web page is executing stuff to write to local file system
(not a good thing). The file system is local because it is attached to your PC. It's not a server file system because
you're not running a server. Now do you understand the problem?
You could store a Windows, Linux and MAC executable on the other hand and have the user double-click to execute it.
Depends on how much FLASH space you have.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top