Microchip® Advanced Software Framework

Configuring and using the Control Panel SMTP client

In this scenario, you are a local user who wishes to use the Control Panel to send mail upon alarms or with periodic logs. You are equipped with a PC.

Note
This scenario assumes you already have set up your local area network to access the Control Panel web server. See Accessing the Control Panel acting as a Web server for further informations on the network configuration.

1) PC configuration [Windows XP]

You will need a SMTP server. There are several configurations, so we assume your EVK1100 is plugged to your PC, as described in the web server section.
You can use Windows XP SMTP server or download a free one.
See also Installation & configuration of exim (the cygwin SMTP server) on a PC for details on installing and configuring a GNU(GPL) SMTP server included with Cygwin(exim).
Once you have a SMTP server configured, you will need to set up the Control Panel to have it sending mails.

2) Compile the Control Panel with the SMTP client.

Default Control Panel application does not come with the SMTP client compiled.
If you want to know if SMTP is embedded in your Control Panel version, use the web server and browse for the "System Configuration" web page.
If the SMTP fields are filled with NotCompiled text, then you will have to add SMTP client to your version.
Otherwise, you should directly go to chapter 3) Configure the SMTP client..
You will have to turn it on in your favorite compilation environment.

2.1) Using GCC.

Edit the file "config.mk" and replace SMTP_USED=0 with SMTP_USED=1 in the definitions.
Then build the Control Panel and program your EVK1100 with this new version.

2.2) Using IAR.

Right click on the project and select options. In the new window, choose C/C++ compilers item and go to the preprocessor tab.
In the section Defined symbols: (one per line), edit SMTP_USED field and set SMTP_USED=1 to enable SMTP compilation.

PreprocessorOptions.gif

Then build the Control Panel and program your EVK1100 with this new version.

3) Configure the SMTP client.

You now have to configure your SMTP client to have it deliver mails to the SMTP server.
Use the web server and browse for the "System Configuration" web page.
Fill the SMTP section fields with :

  • Server TCP port : enter the SMTP server port, default should be 25.
  • Outgoing server address : enter the SMTP server IP address :
    • If you are using a SMTP server installed on your PC, use the PC IP address (default should be 192.168.0.54)
    • If you don't know the IP address of your SMTP server, you can use tracert your.smtp.server.name commands to get it, where your.smtp.server.name is the name of a SMTP server you are able to use.
  • Mail recipient : enter the recipient of the mails. Fill with a valid email address.
  • Mail sender : enter the sender of the mails. Fill with a valid email address, that SMTP server would allow to access.

4) Configure the Control Panel to send mail.

The Control Panel will send mail to the recipient previously configured upon several actions :

  • each time a log file is definitely closed, the Control Panel should sent the file content.
  • each time an alarm is triggered, the Control Panel should sent an email to inform of this occurrence.

4.1) Log files.

You do not have to set up anything to allow the Control Panel to send mail upon this event.
Once a log file has reached the maximum file size, it is written on the file system.
Then an email will be sent with this file content.

Note
In order to receive log files, you MUST have a LOG folder on your file system.

4.2) Configure the Control Panel to send mail.

In order to trigger an alarm on a sensor, you will have to allow it for this sensor.
Browse the "Sensors Configuration" web page, and set the alarm field for this sensor to value "on". Submit this change by clicking the "submit" button.
Trigger an alarm for the configured sensor, and check your mailbox, you should have a new message.


Contact Information

For further information, visit Atmel AVR32.