************************************************************************************
************************************************************************************

Digi Connect ME(TM) Weather Station Demo Application

************************************************************************************
************************************************************************************

Version 	release_D-NoESP
Date:		23 March 2007

http://www.digi.com/products/embeddedsolutions/digiconnectmedemo.jsp

This application came about as a result of the author's personal interest in 
network-enabling the AAG Electronica Weather Instrument. The Digi platform of
choice is the Digi Connect ME -C module. While it may be possible to build and run 
this applciation on other Digi NET+ARM platforms, no specific testing has been 
performed.

This application is provide "as-is" without product support by Digi International.
See software license section in this document for additional information. 

While not required, you are welcome to provide us with the changes you make to the 
application, if you would like us to consider including them in future releases of 
the demo code. 

For additional information on migrating a makefile based application to Digi ESP 
please check the Digi ESP document entitled, "Migrating a Makefile Based NET+OS 
Application to a Digi ESP Project".


************************************************************************************
************************************************************************************

General Information

************************************************************************************
************************************************************************************

The application utilizes the following main NET+OS APIs:

 - Flash File System
 - Advanced Web Server (AWS) - NET+OS 6.3 only
 - Internet Address MAnagement (IAM) - NET+OS 7.0 (IAM supercedes ACE)
 - NVRAM Driver
 - Serial Driver
 - TCP and UDP Sockets
 - Variable Management
 - FTP Server

************************************************************************************
************************************************************************************

1-Wire Device Support

************************************************************************************
************************************************************************************

The application supports three modes of operation, as defined in root.c (refer to 
#define WS_APPLICATION_MODE, in this file):

- WEATHER_SIMULATOR - This mode does not make use of the file system, nor does
  it require a 1-Wire Weather Instrument or Digital Thermometer.
- WEATHER_STATION - In this mode a 1-Wire Weather Station, from AAG Electrtonica
  (http://www.aag.com.mx) is expected to be connected to serial port 1, via a 1-Wire 
  to RS-232 adapter (such as the DS9097U-9).
- TEMPERATURE_ONLY - In this mode a 1-Wire Digital Thermometer (models DS1820, 
  DS18S20 or DS1920 iButton) is expected on serial port 1. As with the Weather
  Instrument a 1-Wire to RS-232 adapter is required.

************************************************************************************
************************************************************************************

Building the Application

************************************************************************************
************************************************************************************

This version of the Weather Station demo application was ported to build under 
NET+Os(R) versions 6.3 (builds 6.3.20.0 and 6.3.61.0) and 7.0 (command line only). 
A seperate version of this applicaiton, for use under NET+OS 7.0, using DigiESP 
is also available; 

It is not the intended purpose of this application to teach one how to build a 
NET+OS application or to program, in general. Assumptions have been made regarding 
familarity with the NET+OS development kit, the Digi Connect modules and C/C++ 
Programming. Please review the documentation, provided with the Digi Connect 
Development kit, regarding any questions of this nature.

1. Extract the provided archive into the c:\netos63_gnu\src\apps directory. A new
   directory, dgWeatherStationDemo, will be created.
2. From the dgWeatherStationDemo/32b directory execute the rebuild.sh script. This 
   script will call PBuilder.exe and rebuld all of the web pages. This will not
   affect the *_v.c files, which have been fully fleshed out.
3. Enable the UART driver for serial port 2 (/com/1) in the "bsp.h" file of your 
   target platform by changing the line reading:
   "#define BSP_SERIAL_PORT_2 BSP_SERIAL_NO_DRIVER" to 
   "#define BSP_SERIAL_PORT_2 BSP_SERIAL_UART_DRIVER". This is necessary as the 
   appconf.h files defines "/com/1" as both the applciation dialog and stdio 
   interface.
4. When in either WEATHER_SIMULATOR or TEMPERATURE_ONLY mode the flash file system 
   is not utilized, therefore the bsp.h #define for 
   BSP_INCLUDE_FILESYSTEM_FOR_CLIBRARY can be left at its default of o (or FALSE). 
   When this applciaiton is configured for WEATHER_STATION mode, however, this 
   #define must be set to 1 or TRUE. Additionally, one must add libfilesys.a to
   the list of linbraries to APP_LIBS (re: 32b/Makefile).

Please review the NetWorks with GNU Getting Started Guide, installed as part of the 
development kit, regarding matters related to the building and debugging of an 
application.

************************************************************************************
************************************************************************************

Rebuilding the WeatherGUI Java Applet

************************************************************************************
************************************************************************************

The Java source to the WeatherGUI applet is located in the directory 
"pbuilder/html/java/source".

The applet was developed using the Eclipse IDE available at http://www.eclipse.org. 
Other Java development platforms can be used as well, but might require minor 
modifications.

************************************************************************************
************************************************************************************

Getting Support

************************************************************************************
************************************************************************************

If you have questions or comments regarding the Digi Connect ME Weather Station demo 
you may post them in the Embedded Device Server section of the Digi Online Support 
Forum at http://www.digi.com/support/forum, which is intended to be a public forum 
for all customers. 

Please note that the software is provided on an "as-is" basis only and that it is 
not covered by Digi International's standard product support policy.

************************************************************************************
************************************************************************************

Known Limitations

************************************************************************************
************************************************************************************


1. Instead of NVRAM, the weather instrument monitoring code currently makes use of 
   the file system to store its "config.ini" file, e.g. the serial numbers of the 
   1-Wire devices integrated in the weather instrument. 
2. The admin/logout.htm web page currently forces closing the browser window.
3. The config/security.htm page currently requires a reboot to apply the password 
   changes.
4. Although the application does not prohibit the use of wireless Digi Connect(tm) 
   modules, no web user interface is present to allow the configuration of wireless 
   parameters and options.
5. The web interface does not provide the means by which to configure the wireless
   interface, e.g. Connect Wi-ME, Wi-EM and ConnectCore Wi-9C. 
=
************************************************************************************
************************************************************************************

Software License Information

************************************************************************************
************************************************************************************

The provided software and its associated source/object code and other files 
(referred to as "software") are owned by or licensed to Digi International, Inc. 
(referred to as "Digi") and are provided on an "as is" basis, without warranty of 
any kind, express or implied, including but not limited to the  warranties of 
merchantability, fitness for a particular purpose and infringement of intellecutal 
property. In no event shall Digi be liable for any claim, damages, or other 
liability, whether in an action of contract, tort, negligence, or otherwise, arising
from, out of or in connection with the software or the use of or other dealings in 
the software.
 
Permission is hereby granted to any person obtaining a copy of this software to deal 
in the software without restriction, including without limitation the rights to use, 
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the 
software, and to permit persons to whom the software is furnished to do so, subject 
to the following conditions:

 - The software is used in direct conjunction with a Digi product only and for no 
   other purpose.

 - The above copyright and permission notice shall be included in all copies or 
   substantial portions of the software.

Copyright and Trademark Information
-----------------------------------

   2005 Digi International Inc. Digi, Digi International, the Digi Connectware logo, 
   the Making Device Networking Easy logo, Digi Connect, Digi Connect ME, 
   NetSilicon, NET+Works and NET+OS are trademarks or registered trademarks of Digi 
   International, Inc. in the United States and other countries worldwide. All other
   trademarks are the property of  their their respective owners.


************************************************************************************
************************************************************************************

Change Log

************************************************************************************
************************************************************************************


09/27/2006 - Release C
- Ported release B1, of this application to NET+OS 7.0 (command line only).
- Added support throughout the application to allow one to build the application 
  under either the NET+OS 6.3 or 7.0 environments with a minimum of manual 
  intervention.
- The use of the syslog functionaility has been disabled in this release while it's
  usage is being examined.

09/15/2006 - Release B1
- Completed the application port Weather Station Demo from NET+OS 6.0 to 6.3
- Cleaned up source code removing references to several unnecessary #includes as well
  as unused variables.
- Added support for a weather simulator thread, allowing the complete review of this 
  demo without requiring a 1-wire weather station or thermometer being connected. 
  Refer to the applciation's root.c file for additional instructions.

06/30/2005 - Release B
- intial port of application to NET+OS 6.3.

06/20/2005 - Release A
- Initial release of demo application

  