Ok I have been looking for a way to add the capability of my alarm system to send me an email when my alarm goes off..........
I simply want it to email me "alarm system is activated"
I don't want anything more specific then that......I wanna get the email and then go check the alarm systems console.
I read a little about arduino boards and figured this would be very easily acomplished using one of these boards with an ethernet shield..........
but I have no idea how i would even begin to program this....
woudl anybody have any recommendations or help for me here??
I want to use the siron/horn output to activate arduino board and get it to send me an email..
please help me out here thanks
First thing that comes to mind is how are you detecting the alarm?? does it have an output? how does it output the data, and how would you connect it to the arduino??
I've looked into this for similar reasons about a year ago, but got sidetracked. At the time, the difficulty was that the Arduino family of chips are generally not powerful enough to handle email. I decided instead to buy a GSM shield for the Arduino, because sending a text message by phone from an Arduino was pretty straightforward. The cost of a prepaid card, with something like 300 minutes service was only $10, so if your alarm is not calling you very much, you've got a very cheap monitoring service. And phone coverage, at least where I live, is much more ubiquitous and timely than internet.
I am still trying to get back to that project, but I think it's a good, inexpensive solution. Email is easy from a real computer, very hard from an Arduino board.
Good Luck
Yes it's quite doable with an ethernet shield. Assuming you connect it into your network..
So this is the code up until now that i am having difficulty with;
/*--------------------------------------------------------------
Program: eth_websrv_SD
Description: Arduino web server that serves up a basic web
page. The web page is stored on the SD card.
Hardware: Arduino Uno and official Arduino Ethernet
shield. Should work with other Arduinos and
compatible Ethernet shields.
2Gb micro SD card formatted FAT16
Software: Developed using Arduino 1.0.3 software
Should be compatible with Arduino 1.0 +
SD card contains web page called index.htm
References: - WebServer example by David A. Mellis and
modified by Tom Igoe
- SD card examples by David A. Mellis and
Tom Igoe
- Ethernet library documentation:
http://arduino.cc/en/Reference/Ethernet
- SD Card library documentation:
http://arduino.cc/en/Reference/SD
Date: 10 January 2013
Author: W.A. Smith, http://startingelectronics.com
--------------------------------------------------------------*/
#include <SPI.h>
#include <Ethernet.h>
#include <SD.h>
// MAC address from Ethernet shield sticker under board
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
IPAddress ip(10, 10, 1, 222); // IP address, may need to change depending on network
EthernetServer server(80); // create a server at port 80
File webFile;
void setup()
{
Ethernet.begin(mac, ip); // initialize Ethernet device
server.begin(); // start to listen for clients
Serial.begin(9600); // for debugging
// initialize SD card
Serial.println("Initializing SD card...");
if (!SD.begin(4)) {
Serial.println("ERROR - SD card initialization failed!");
return; // init failed
}
Serial.println("SUCCESS - SD card initialized.");
// check for index.htm file
if (!SD.exists("index.htm")) {
Serial.println("ERROR - Can't find index.htm file!");
return; // can't find index file
}
Serial.println("SUCCESS - Found index.htm file.");
}
void loop()
{
String requestString = "" ;//String to store chars
EthernetClient client = server.available(); // try to get client
if (client) { // got client?
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) { // client data available to read
char c = client.read(); // read 1 byte (character) from client
// last line of client request is blank and ends with \n
// respond to client only after last line received
requestString = requestString + c;
if (c == '\n' && currentLineIsBlank)
{if (requestString.indexOf("dygraph")>0)
{// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/plain");
client.println("Connection: close");
client.println();
webFile = SD.open("dygraph.js"); // open web page file
if (webFile) {
while(webFile.available()) {
client.write(webFile.read()); // send web page to client
}
webFile.close();
}
else
{
// send a standard http response header
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println("Connection: close");
client.println();
// send web page
webFile = SD.open("index.htm"); // open web page file
if (webFile)
while(webFile.available())
client.write(webFile.read()); // send web page to client
webFile.close();
}
}
break;
}
// every line of text received from the client ends with \r\n
if (c == '\n') {
// last character on line of received text
// starting new line with next character read
currentLineIsBlank = true;
}
else if (c != '\r') {
// a text character was received from client
currentLineIsBlank = false;
}
} // end if (client.available())
} // end while (client.connected())
delay(1); // give the web browser time to receive the data
client.stop(); // close the connection
} // end if (client)
}
I put a serial output at various stages and it stops here:
void loop()
{
Serial.write("beginning of loop");
String requestString = "" ;//String to store chars
EthernetClient client = server.available(); // try to get client
Serial.write("step one");
if (client) { // got client?
Serial.write("step two");
boolean currentLineIsBlank = true;
while (client.connected()) {
Initializing SD card...
SUCCESS - SD card initialized.
SUCCESS - Found index.htm file.
beginning of loopstep one
So its actually failing when trying to connect to the client.
I can ping the device on the port specified, so the ethernet is working.
the serverport is correct too.
Can anyone shed any light on this for me if possible?