This demo application demonstrates the Heating, Ventilating, and Air Conditioning demo on lwIP TCP/IP stack with different RTOSes.
Overview
This is simulation of HVAC system with web server using lwIP TCP/IP stack on different RTOSes. The user uses an Internet browser to send a request for connection, to set up HVAC system on board. The board acts as an HTTP server and sends a Web page back to the PC. The user also can directly set up desired temperature by pressing switches on board and observe LEDs status.
Supported RTOS
- Freescale MQX™ RTOS
- FreeRTOS
- µC/OS-II
- µC/OS-III
Supported Hardware
These Freescale Freedom development platforms and Tower System modules are supported by the Kinetis SDK web_hvac demo.
- FRDM-K64F
- TWR-K60D100M
- TWR-K64F120M
- TWR-K65F180M
System Requirement
Hardware requirements
- J-Link ARM
- P&E Micro Multi-link universal
- Mini/micro USB cable
- USB A to micro AB cable
- Hardware (tower/base board, ...) for specific device
- Personal Computer
Toolchain requirements
- IAR embedded Workbench version 7.30.4
- ARM GCC 4.8.3 2014q3
- Keil MDK 5.13
- Kinetis Design Studio IDE v.2.5.0
- Atollic TrueSTUDIO for ARM win32 v5.2.1
Software requirements
- The project files are in: <SDK_Install>/examples/<board>/demo_apps/web_hvac/<rtos>/<toolchain>. Where <rtos> is one of the supported RTOSes.
- Library dependencies:
- Baremetal, FreeRTOS, uC/OS: ksdk_platform_lib
- MQX RTOS: mqx_<board>, mqx_stdlib_<board>
Software requirements
- The project files are in: <SDK_Install>/examples/<board>/demo_apps/web_hvac/<toolchain>.
- Library dependencies: ksdk_platform_lib
Getting Started
Prepare the Demo
- Connect a USB cable between the PC host and the OpenSDA USB port on the board.
- Open a serial terminal with the following settings:
- 115200 baud rate
- 8 data bits
- No parity
- One stop bit
- No flow control
- Download the program to the target board.
- Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.
For detailed instructions steps, see a Kinetis SDK User's Guide for your board.
Network Configuration
Configure the IP address of PC network adapters as shown: IP address - 192.168.2.100 Subnet Mask - 255.255.255.0
Run the demo
-
Download the program to the target board, which should be installed in Tower System or Freescale Freedom.
-
Connect the Ethernet cable between the PC and the board.
-
When successfully connected, reset the board to run the demo.
-
Open the PC command window, type in "ping 192.168.2.102" to test whether lwIP stack is running.
-
Input "192.168.2.102" in the URL of an Internet browser on a PC. If successful, the web page which the board returns opens in the browser.
-
In the browser, click on "HVAC Status" option to observe the current information on the target board.
-
In the browser, Selected "Change Settings" option, input new setting then click "Set" button, the browser loads the status page. If successful, the desired temperature changes to a new setting and the actual temperature increases/decreases until it reaches desired temperature:
-
Change the desired temperature to a greater value and HVAC mode to "Heat", the actual temperature increases until it meet configured desired temperature.
-
Change the desired temperature to a lower value and HVAC mode to "Cool", the actual temperature decreases until it meets the configured desired temperature
-
On the other hand, the desired temperature can be changed by pressing the switches on board. The LEDs (if they exist) on the board represent HVAC system's state:
-
LED1: Simulate the Fan's state
-
LED2: System in the Heat mode
-
LED3: System in the Cool mode
-
LED4: Simulate the heart beat, increase real temperature (i.e., by hair dryer) to see the LED4 go faster and decrease temperature to see it slow down.