2014年7月16日 星期三

One AVR Web Server

http://www.theresistornetwork.com/2013/03/fun-with-embedded-http-servers.html
http://hackaday.com/2013/04/03/embedded-web-server-is-all-about-clever-formatting/ 
  • 硬體:Olimex MOD-IO development board (ATmega16 CPU) + ENC28J60 Ethernet controller (SPI 界面)
  • 使用 TuxGraphics TCP/IP stack,包含 Web Server
  • 壓縮網頁資料 (yui-compressor + gzip) 給 C 使用
    %.css.h: %.css
        yui-compressor --type css $^ > $^.min
        gzip -c $^.min > $^.gz
        xxd -i $^.gz | sed -e 's/.\[\]\ =/\[\]\ PROGMEM\ =/g' | sed -e 's/unsigned/const/g' > $@
        rm -f $^.gz $^.min
    
  • 由於只有 1kB RAM,限制 response 大小大約 700 bytes.
  • 顯示 AVR logo:用 Inkscape 縮小 SVG 檔,並用 vim stripped the rest of the cruft
  • 用 AJAX 動態取得 JSON 格式的 Uptime、Total HTTP Requrest 及 Relay Status
  • HTTP authentication 以及控制 relay
相關文章:Eembeddedd Web Server

沒有留言:

張貼留言

SIP header Via

所有 SIP 訊息 都要有 Via,縮寫 v。一開始的 UAC 和後續途經的每個 proxy 都會疊加一個 Via 放傳送的位址,依序作為回應的路徑。 格式 sent-protocol sent-by [ ;branch= branch ][ ; 參數 ...] s...