Appendix C. Configuring the Raven for PPP
Example CR1000 Program
The following example sends an email message when an alarm condition is
True. Both the CR1000 and Raven modem must be configured as PPP as
described above.
CR1000 Program Example to Send Email Message
'Main program variables
Public Batt, RefTemp, Temp
'declare Email parameter strings (as constants), Message String & Result Variable
Const ServerAddr="smtpauth.earthlink.net"'"207.69.189.201"
Const ToAddr="[email protected]"
Const FromAddr="[email protected]"
Const Subject="Email Message Test"
Const Attach=""
Const UserName="[email protected]"
Const Password="cr1000"
Const CRLF = CHR(13)+CHR(10)
Public Result as String * 100
Public AlarmTrigger As Boolean
Public Message As String * 250
Public EmailSuccess As Boolean
BeginProg
Scan (1,Sec,3,0)
Battery (Batt)
PanelTemp (RefTemp,250)
TCDiff (Temp,1,mV2_5C,1,TypeT,RefTemp,True ,0,250,1.0,0)
NextScan
SlowSequence
Scan(1,sec,1,0)
If AlarmTrigger = False Then
If Temp > 28 THEN AlarmTrigger = True
If AlarmTrigger Then
Message = "Warning!" + CRLF + CRLF
Message = M "This is a automatic email message from the datalogger station " + Status.Stati ". "
Message = M "An alarm condition has been identified. "
Message = M "The temperature is " + Temp + " degrees C." + CRLF + CRLF + CRLF
Message = M "Datalogger time is " + Status.Timestamp
EmailSuccess=EmailSend (ServerAddr,ToAddr,FromAddr,Subject,Message,Attach,UserName,Password,Result)
EndIf
EndIf
If Temp < 28 then AlarmTrigger=False
NextScan
EndProg
C-6