Application Note: JN-AN-1151 Low-Cost JenNet IP Gateway

This Application Note describes the design and implementation of a low-cost Gateway between an IEEE 802.15.4 wireless network and the Internet. This Gateway utilises the Jennic JN5148 wireless microcontroller, the Jenie/JenNet wireless protocol stack and an open source TCP/IP stack. In this demonstration, the Gateway device is used to serve web pages containing data collected from a wireless network of sensors.

Application Overview
It is often necessary to connect a wireless sensor network to the Internet. The powerful 32-bit RISC CPU within the Jennic JN5148 wireless microcontroller allows the construction of a very low-cost Gateway device that provides a bridge between wired and wireless networks.

Wireless Sensor Network Sensor Node Sensor Node

Gateway

Ethernet ISP Connection

Internet

PC-based monitoring and control application

JN-AN-1151 (v1.0) 26-May-2010

© Jennic 2010

1

15.sics. The supplied application code is compatible with Jennic’s IEEE 802. The Co-ordinator is implemented on the Gateway board.0) 26-May-2010 .se/~adam/uip/index. and consists of the following: • A JN5148 device that runs the Jenie/JenNet wireless protocol stack and an open source TCP/IP stack • An Ethernet MAC/PHY device that is connected to the JN5148 device via the SPI interface In addition to the above.15. The Gateway device hardware is detailed in the IEEE 802.4 Wireless Gateway Reference Manual (JN-RM-2059). is provided with this Application Note and can be found within the ZIP package at the following location: \JN-AN-1151-Low-Cost-JenNet-IP-Gateway\Gateway\Source\uip-1v0 This application is designed to operate with the Gateway unit (Reference Design JN-RD-6026) and a number of sensor boards from the Jennic JN5148-EK010 Evaluation Kit. it serves out web pages containing data collected from a network of wireless sensor nodes. In response to requests from a client. More details of this stack can be found at: http://www. PCB database and reference documentation.4 wireless Gateway. These boards then take temperature measurements and pass them via a Jenie/JenNet network to the network Co-ordinator. PADS. the JN5148 device within the Gateway acts as a web server. with the sensor boards programmed to be End Devices. included in the reference design. Software The TCP/IP stack (often referred to as the uIP stack) used with the Gateway is an open source stack. This reference design includes schematics. which is provided as a reference design. ported to run on the JN5148 device. with the role of collecting data from the sensor boards and then serving out this information as web pages. bill-of-materials. The source code and associated project files for this application can be found in the ZIP package at the following locations: \JN-AN-1151-Low-Cost-JenNet-IP-Gateway\Gateway \JN-AN-1151-Low-Cost-JenNet-IP-Gateway\Sensor An example of a web page served by the Gateway device is shown below: 2 © Jennic 2010 JN-AN-1151 (v1.php/Main_Page A copy of this stack. gerbers. JN-RD-6026.Jennic Low-Cost JenNet IP Gateway The Gateway device acts as a bridge between the wireless sensor network and an IP-based Ethernet network.

1. you must enter this IP address into your web browser. The above screen shows links for the 1st and 2nd floors. In order to view these web pages.Low-Cost JenNet IP Gateway Jennic Note: The default IP address that is coded into the Gateway software is http://192. When a sensor board is powered on.168. Each sensor can be configured with the floor set in the range 0-9 but.99. Clicking on one of these links will result in information being displayed from the sensors on the corresponding floor. the on-board LED D1 will illuminate until the sensor has joined a network. JN-AN-1151 (v1. The frequency of the transmissions is also configurable. The on-board LED D2 will then flash every time data is transmitted to the Gateway. only the 1st and 2nd floors are displayed in the demonstration interface.0) 26-May-2010 © Jennic 2010 3 . currently.

Next. enter “S” on the keyboard and the following information will be displayed in the terminal window: It is now possible to configure the displayed Gateway settings (above). reset the Gateway by power-cycling the board.ccc.001. which requires the following port settings: Baud Rate: Data Bits: Parity: Stop Bits: 115200 8 None 1 Flow Control: None Once the terminal window is open and the settings are correct. Note that IP addresses must be entered in the format aaa. 4 © Jennic 2010 JN-AN-1151 (v1.168.ddd – for example.Jennic Configuring Gateway IP Settings Low-Cost JenNet IP Gateway The default settings of the Gateway can be changed via a terminal emulator running on a PC which is connected to the Gateway using a ‘USB-A to USB mini-B’ cable.099 Once all the changes are complete.bbb. To configure a setting.0) 26-May-2010 . the following format must be used: 192. enter the number of the required option and then enter the new value. you must save the new settings by entering “S” and then exit the configuration screen by entering “6”. The terminal emulator used in this example is HyperTerminal. to re-enter the local IP address shown above.

which requires the following port settings: Baud Rate: Data Bits: Parity: Stop Bits: 115200 8 None 1 Flow Control: None Once the terminal window is open and the settings are correct. the terminal emulator used in this example is HyperTerminal.Low-Cost JenNet IP Gateway Jennic Configuring Sensor Settings The default settings of a sensor can also be changed via a terminal emulator running on a PC which is connected to the sensor board using a USB-to-serial cable. reset the sensor by power-cycling the board. Again. enter the number of the required option and then enter the new value. you must save the new settings by entering “S” and then exit the configuration screen by entering “4”. The following information will be displayed in the terminal window: It is now possible to configure the sensor settings (above). To configure a setting. JN-AN-1151 (v1. Next.0) 26-May-2010 © Jennic 2010 5 . Once all the changes are complete. hold down the on-board button SW1 and power on the sensor board.

Jennic Building Web Pages Low-Cost JenNet IP Gateway The pages served by the Gateway device are created using standard HTML code. navigate to \JN-AN-1151-Low-Cost-JenNet-IP-Gateway\Gateway\Source and enter perl makefsdata at the command prompt. A Perl script is provided to perform this conversion.0) 26-May-2010 .1 Supported Chips JN5148 JN5148 JN5148 6 © Jennic 2010 JN-AN-1151 (v1. Compatibility The software provided with this Application Note has been tested with the following Jennic kits and SDK (Software Developer’s Kit) versions: Product Type Evaluation Kit SDK Libraries SDK Toolchain Part Number JN5148-EK010 JN-SW-4040 JN-SW-4041 Version v1.4 v1. the web pages must be converted into data (a number of ‘C’ arrays) that can be used by the web server application. Note: Perl is not installed by any of the Jennic SDKs. which was used to test the makefsdata script provided. The pages for this demonstration can be found at the following location: \JN-AN-1151-Low-Cost-JenNet-IP-Gateway\Gateway\Source\webpages Once the HTML is complete. Strawberry Perl is an open-source Perl implementation for Microsoft Windows. To execute this script.

In Eclipse. ensure that the project is highlighted in the left panel of in the Eclipse Eclipse and use the drop-down list associated with the hammer icon toolbar to select the relevant build configuration – once selected. The Application directory is automatically created when you install the JN5148 SDK. which can be launched from within Eclipse or used directly (and is described in the JN51xx Flash Programmer User Guide (JN-UG-3007)). Using Eclipse (JN5148 Only) To build the application and load it into JN5148 boards.4 Wireless Gateway Reference Manual (JN-RM-2059). however. Start the Eclipse platform and import the relevant project files (. The binary files will be created in the relevant Build directories for the applications. Ensure that the project directory is located in <JENNIC_SDK_ROOT>\Application where <JENNIC_SDK_ROOT> is the path into which the SDK was installed. In the Projects box. The project directory in the ZIP file should be copied to the directory <JENNIC_SDK_ROOT>\Application where <JENNIC_SDK_ROOT> is the path into which the Jennic JN5148 SDK was installed (by default. To do this. © Jennic 2010 7 JN-AN-1151 (v1. select the project to be imported and click Finish. this is C:\Jennic). follow the menu path File>Import to display the Import dialogue box. depending on whether you intend to use Eclipse or makefiles. Build the application. follow the instructions below: 1.Low-Cost JenNet IP Gateway Jennic Building and Loading the Application This section describes how to build the applications from the supplied source code and load the resulting binaries into the relevant JN5148 boards (note.15. using either the Eclipse IDE or makefiles. the application will automatically build. 2. Load the resulting binary files into the boards. Build the applications as described in the appropriate section below. browse to the Jennic Application directory and click OK.cproject) as follows: a) b) c) d) 3. expand General. Repeat this to build the other application. For the Gateway device. You can do this using the Jennic JN51xx Flash Programmer. The software provided with this Application Note can be built only for the JN5148 wireless microcontroller. Enable Select root directory. that pre-built binaries are supplied which can be loaded directly into the boards). In the dialogue box. the resulting filenames indicating both the chip type (JN5148) and networking stack (JN for JenNet) for which they were built. also refer to the “Programming” chapter of the IEEE 802.project and .0) 26-May-2010 . select Existing Projects into Workspace and click Next. 4.

which contains the makefiles for the application. The makefile is simply called Makefile. The binary file will be created in the relevant Build directory. Ensure that the project directory is located in <JENNIC_SDK_ROOT>\Application where <JENNIC_SDK_ROOT> is the path into which the SDK was installed. 3.0) 26-May-2010 . 8 © Jennic 2010 JN-AN-1151 (v1. the resulting filename indicating the chip type (JN5148) and networking stack (JN for JenNet) for which the application was built. which will build the binaries for both applications. described in the JN51xx Flash Programmer User Guide (JN-UG-3007).Jennic Using Makefiles Low-Cost JenNet IP Gateway Each application has its own Build directory. Load the resulting binary file into the board. enter: make clean all Note that you can alternatively enter the above command from the top level of the project directory. follow the instructions below: 1. To do this.15.4 Wireless Gateway Reference Manual (JN-RM-2059). also refer to the “Programming” chapter of the IEEE 802. To build each application and load it into the relevant JN5148 board. 2. For the Gateway device. Navigate to the Build directory for the application to be built and at the command prompt. use the Jennic JN51xx Flash Programmer.

enhancements. Customers should obtain the latest relevant information before placing orders. unless otherwise specified. Jennic customers using or selling Jennic products for use in such applications do so at their own risk and agree to fully indemnify Jennic for any damages resulting from such use.0 Notes First release Important Notice Jennic reserves the right to make corrections. supplied at the time of order acknowledgment. conveys no license or title under any patent.com For the contact details of your local Jennic office or distributor. modifications. Jennic products are not intended for use in life support systems/appliances or any systems where product malfunction can reasonably be expected to result in personal injury.Low-Cost JenNet IP Gateway Jennic Revision History Version 1. Jennic Ltd Furnival Street Sheffield S1 4QT United Kingdom Tel: +44 (0)114 281 2655 Fax: +44 (0)114 281 2951 E-mail: info@jennic. It is the customer’s responsibility to ensure that their application meets their own specifications. and the like. and to discontinue any product or service without notice. improvements and other changes to its products and services at any time. All products are sold subject to Jennic’s terms and conditions of sale. copyright or mask work rights to these products. and makes no representations or warranties that these products are free from patent. Jennic makes no representation and gives no warranty relating to advice. All trademarks are the property of their respective owners. Jennic assumes no responsibility or liability for the use of any of its products. death. severe property damage or environmental damage. is intended as suggestion only and may be superseded by updates. refer to the Jennic web site: JN-AN-1151 (v1. and should verify that such information is current and complete. Information relating to device applications. support or customer product design.0) 26-May-2010 © Jennic 2010 9 . copyright or mask work infringement.