DigiESPProject: This is an application generated by the NET+OS Project wizard. It configures
the hardware for your device and provides a set of software services for
your application such as ftp server, HTTP server, file system, etc. The
startup sequence is as follows:

1.  The board is initialized and the POST tests are executed.
2.  The ThreadX kernel is loaded.
3.  The device drivers are loaded.
4.  The TCP/IP stack is loaded.
5.  The function applicationStart() is called.
6.  The software services are initialized and started.

Code to start the user application should be placed in the root.c
file in the function applicationStart().  This function is called after 
the TCP/IP stack has loaded and is ready to be used.  Generally, you will 
create and start whatever threads your application needs in this function. 

Look at the readme in the sys directory to understand how to modify the
software services.

Look at the readme in the web directory to understand how to modify the
web application. 

Special Application Features
============================

1. SSL Certificate upload for iDigi. See below for BSP requirements and instructions
   for this feature.


Setup or login to your iDigi account
====================================
1.  Login to http://developer.idigi.com with your username and password if you
    previously setup an account, or click on "Are you a new user?" to setup a
    new account. 
2.  Click on the "Devices" selection under Management.
3.  Click on "+" from the Devices toolbar to add your device.
4.  If your device is not discovered, hit the "Add Manually" button.
5.  Enter the MAC Address of your device then click the "Add" button, then the
    "OK" button.
6.  If your device has both a Wireless and Ethernet interface, use the MAC
    Address of the Ethernet interface as the unique device identifier
    (Device Id).  Any information sent to the iDigi server from either
    interface will go to this Device Id on the iDigi server. 

iDigi Device Manager 
====================
To include Device Manager, set BSP_IDIGI_ENABLED to TRUE in bsp_services.h.

You may update IDIGI_DEVICE_NAME in bsp_services.h for the name of your device
that will be shown in the iDigi server.

You may need to update IDIGI_VENDOR_ID in bsp_services.h for the vendor id that
you are given during the iDigi account registration.

This application includes web pages for iDigi Device Manager if HTTP is enabled. 

Goto the iDigi Device Manger web page to update iDigi Device Manager Configurations.

In order to suppport iDigi SSL Certificate,  must do the followings:
---------------------------------------------------------------
1. Set BSP_IDIGI_ENABLED to TRUE in bsp_services.h
2. Set BSP_INCLUDE_FILESYSTEM_FOR_CLIBRARY to TRUE in bsp_fs.h
3. Set FLASH_FILESYSTEM_ENABLED to TRUE in appservices.h

Certificates are saved in the file system (/FLASH0/.cfg/cert_peer.cfg). 
An X.509 Certificates web page is provided for uploading and deleting certificates.

To upload a certificate:
------------------------
1. Login to iDigi server (http://developer.idigi.com) with your username and password and
   see documentation section for more information on getting iDigi certificate.
2. Go to "X.509 Certificates" web page from device's web page or iDigi web page.
3a. Press "Upload" button to upload the certificate from the device's web page.
3b. Press "Save" button to upload the Certificate and "Refresh" button to ensure that 
    the certificate is active if you are using iDigi web page to upload ssl certificate.

To configure iDigi Device Manager to validate SSL certificate:
---------------------------------------------------------

From device's web page:
1. Go to Advanced Setting in iDigi Device Manager web page
2. Select Connection Method to "SSL" 
3. Check "Enable validation of server SSL certificate" checkbox
4. Press "Apply" button to save the configurations.

From iDigi web page:
1. Go to iDigi Device Manager Network web page
2. Select Connection Method to "SSL" 
3. Check "Require validation of server SSL certificate" checkbox
4. Press "Save" button to save the configurations.


This requires reboot or disconnect and reconnect to the iDigi server if the device is already 
connected to the iDigi server.




To upload a certificate:
------------------------
1. Go to iDigi web page and get the iDigi certificate (see in the FAQ to "3.  How do I get iDigi certificate?")
2. Goto "X.509 Certificates" web page, you can upload a PEM format peer certificate for iDigi.
3. Save the iDigi Certificate in the device and sure that the certificate is active.

This can be done through iDigi web services.
