The program publishes files at local directory and SD filesystem. It is a full-fledged webServer somewhat.

Dependencies:   libMiMic mbed-rtos mbed NyFileSystems

English

This program is simple webserver to provides contents on local file system and SD card through HTTP to network. The application is demonstration of libMiMic library that includes uIP based TCP/IP stack and fast httpd server.

It has auto platform detection function. It works on mbed and LPCXpresso1769 both platform in the same binary.

/media/uploads/nyatla/this_server.jpg

Feature

  • Automatic platform detection. for mbed and LPCXpresso.
  • SD card/LlocalFileSystem support. LocalfileSystem is accessable when mbed. Otherwise ignored.
  • Mbed RTOS based Multithread.
  • Original TCP/IP stack(MiMicIP). It is based on uIP.
  • Fast HTTPD (HTTP/1.1 , Persistent connection , RTT<=10ms , Maximum throughput 8Mbps ,SDCard throughput 600Kbps , Chunked encoding, Maximum content size 4GB)
  • RAM usage 16KB+16KB(AHB SRAM - bank 0)
  • ROM 70KB

Demonstration

This is temporary demonstration website. Mmedwebserver demonstration.

The server hosted MiMicRemoteMCU-for-Mbed sample content. You can browse sample pages.

Getting started

  • Connect to mbed Ethernet connector. See also. (SD card is optional)
  • Import program to mbed Compiler and compile it.
  • Copy bin file to mbed.
  • Write configuration to "mimic.cfg" and save it to mbed local file system. (If nothing, Setting is 192.168.0.39,255.255.255.0,192.168.0.254,[mbed mac address]) See also

sample of mimic.cfg

ipaddr=192.168.0.40
netmask=255.255.255.0
gateway=192.168.0.254
macaddr=02:01:02:03:04:05

Any values can be omit. If omit elements,on-chip values is used.

  • Reset mbed.
  • Open "http://[address]/" via Browser(do not use Internet exproler!), You can browse index page.

Appendix

How to connect to SD card.

Check http://www.eleki-jack.com/arm/2010/12/mbed-5.html (Japanese) Maximum length of path name is 512 characters.

How to run on LPCXpresso1769.

MbedFileServer binary file is run on LPCXpresso as is. LocalFileSystem(semihosting SVC) is ignored and LAN peripheral is detected automatically. Mac Address and setting will be on-chip setting. If you want set configuration by file, connect SD card and save "mimic.cfg" to root directory.

日本語

このプログラムは、SDカードとmbedLocalFileSystemにあるファイルを公開するシンプルなWebサーバです。 このWebサーバはlibMiMicライブラリを使用した高速なHTTPDのデモンストレーションです。

MbedFileServerは実行時にmbedとLPCXpressoを自動で認識できます。mbedコンパイラで作成したバイナリファイルをそのままLPCXpressoで動作させることが出来ます。

/media/uploads/nyatla/this_server.jpg

仕様

  • 自動プラットフォーム認識機能(mbed ,LPCXpresso1769)
  • SDカード、 LlocalFileSystem サポート。(LocalFileSystemはmbedの時だけ使用できます。LPCXpressoでは無視されます。)
  • Mbed RTOS ベースのマルチスレッドが利用できます。
  • uIPベースの独自 TCP/IP stack(MiMicIP)を搭載しています。
  • 高速なHTTPDサーバを搭載しています。(HTTP/1.1 , 持続性接続 ,同時セッション数4, RTT<=10ms , 最大転送速度 8Mbps ,SDCard 経由の転送速度 600Kbps , Chunked encoding, 最大コンテンツ転送サイズ 4GB)
  • RAM使用量 16KB+16KB(AHB SRAM - bank 0)
  • ROM使用量 70KB

デモサイト

不定期でMiMicRemoteMCU-for-Mbedのデモサイトを公開しています。http://nyatla3939.no-ip.biz/sd/index.html

このデモサイトはSDカードに保存したコンテンツを、MbedFileServerでホストしています。

Getting started

  • mbedにイーサネットコネクタを接続します。参考。SDカードは無くても動きます。
  • プログラムをImportしてコンパイルします。
  • binファイルをmbedにインストールします。
  • 初期IPアドレスの設定ファイルを書いて、"mimic.cfg"の名前でmbedドライブのルートディレクトリに入れます。 (ファイルの無い場合の設定値は、192.168.0.39,255.255.255.0,192.168.0.254,[mbed内蔵MACアドレス]になります。)参考

mimic.cfg

ipaddr=192.168.0.40
netmask=255.255.255.0
gateway=192.168.0.254
macaddr=02:01:02:03:04:05

設定値は省略できます。省略した場合は、オンチップコンフィギュレーションの値が使われます。

追加資料

SDカードの接続方法

こちらの方法でお願いします。 SDカードのサブディレクトリには対応していますが、URLが512文字以上にならないようにしてください。

LPCXpresso1769で実行する場合

MbedFileServerのバイナリはそのままLPCXpresso1769で動作します。 LocalFileSystem(semihosting SVC) の無効化とLANペリフェラルの認識は起動時に自動的に行われます。 Mac Addressはオンチップコンフィギュレーションの値が設定されます。もしファイルによって値を変更したい場合は、SDカードを接続して、"mimic.cfg" をルートディレクトリに保存してください。

See also

Revisions of libMiMic.lib

Revision Date Message Actions
27:6923864662d4 2015-03-16 update libMiMic File  Diff  Annotate
26:160aa4638e12 2014-11-10 updatelibmimic File  Diff  Annotate
24:200177579f79 2014-10-27 update library File  Diff  Annotate
23:43b0c6ac095b 2014-10-06 update libMiMic; update for K64F; File  Diff  Annotate
22:17ce7970b5bb 2014-05-30 update libMiMic File  Diff  Annotate
21:0d04433ccb57 2013-10-23 update libMiMic; File  Diff  Annotate
20:9735bc60fbd1 2013-08-10 update libMiMic; fix DHCP problem File  Diff  Annotate
19:66d729b94d16 2013-08-09 update libMiMic; support UPnP function. File  Diff  Annotate
18:9e6b9380006c 2013-07-11 update libMiMic File  Diff  Annotate
17:0291701fc90b 2013-07-10 update libMiMic File  Diff  Annotate
16:54850ee77652 2013-07-09 update libMiMic File  Diff  Annotate
15:8388180fba2f 2013-07-09 update libMiMic File  Diff  Annotate
14:60dca0b39490 2013-06-20 update libMiMic File  Diff  Annotate
13:4740a0bc6c0d 2013-06-20 update libMiMic File  Diff  Annotate
12:218b57d9a6d4 2013-06-20 update libMiMic; support DHCP,autoIP,mDNS File  Diff  Annotate
11:9f5f3ee2dc63 2013-05-14 update libMiMic File  Diff  Annotate
10:80c05810f911 2013-05-05 update libMiMic; Add platform auto detection.; The completely same binary runs on mbed and LPCXpresso1769.; File  Diff  Annotate
9:e3de48c39ffd 2013-04-29 update libMiMic File  Diff  Annotate
8:c0a4c2b96eb9 2013-04-29 update libMiMic; (mistake of previous commitment File  Diff  Annotate
7:8ce615c06e5d 2013-04-29 update LibMiMic File  Diff  Annotate
6:20dcb08e1b43 2013-04-29 Add LED blinking File  Diff  Annotate
5:6a2a1644ea2c 2013-04-28 Add sdcard and local file configulation. File  Diff  Annotate
3:77431c2bd9cb 2013-04-09 initial version File  Diff  Annotate
1:17ecb1647b64 2013-04-06 First commit File  Diff  Annotate
0:ec1e45489427 2013-04-06 backup; File  Diff  Annotate