Hack-a-Gecko Project: Putting the Internet of Things on your home network

The task at hand was two-pronged - connecting an embedded system to an existing TCP/IP network, and developing a lightweight, simple web interface that can both send commands to the MCU (server) and send the status to the browser (client).
components
Hardware Components
EFM32ZG STK
X 1
w5100
X 1
details

ucc_silabs.png

The task at hand was two-pronged – connecting an embedded system to an existing TCP/IP network, and developing a lightweight, simple web interface that can both send commands to the MCU (server) and send the status to the browser (client).

 

Home network-1.png

 

Home network-2.png

 

Project Member:

Christopher

 

Project Description:

 

Software – First, a lightweight socket library was used. Low-level HTTP request parser and response formatter is written to handle HTTP GET and POST methods. GET allows return of a web resource (index.htm) and POST lets one submit data to the server (i.e. send form data to the server). Web resources (index.htm, favicon.ico) are converted to a C array using bin2c. To look up a requested resource a URI/resource lookup table can be created. When sending specific commands to the server, LEDs can be toggled by handling POST data parsing.

 

Functionality – By setting the IP address (192.168.1.233) in the firmware and entering it in the web browser, one can connect to the local network. Since Z1/Z2 are mapped to LED 1/LED0, it is easy to toggle between 0/1 by clicking Z1/Z2/Z3. The MCU embeds Z1/Z2/Z3 status in the web page.

 

Results:

Interfacing with the WIZnet W5100 Ethernet chip created a simple web server that supports URI lookup and serves up basic HTML and graphics files. Another accomplishment was being able to handle POST data from client to perform commands. One can also generate HTML files on-the-fly with embedded system status.

 

 

Materials Used:

  • EFM32ZG STK
  • W5100 TCP/IP module (WIZ811MJ)

 

Source Code:

  • Attached

 

Further Development Scope:

It would be interesting to integrate this with a previous Hack-a-Gecko project (Speaker Selector IR blaster) and see how it affects results. Another possible avenue could be to add DHCP support. The FW robustness also leaves room for improvement – in terms of the code base needing clean up and the corner cases being handled better (buffer overflow).

COMMENTS

Please Login to comment
  Subscribe  
Notify of
POSTED BY
Reusable S/W