Show Posts
|
|
Pages: [1] 2 3
|
|
13
|
Using Arduino / Networking, Protocols, and Devices / Re: Anybody seen an email client built upon the Arduino WiFi shield?
|
on: March 20, 2013, 09:07:23 am
|
Hi, I am trying to connect my arduino wifi shield with the hotspot created by my phone. I used the code posted above but it is not working for me. The code gives me the following errors when i run the code... Ready. Press 'e' to send. connected 220 mx.google.com ESMTP cy4sm2248846pbc.13 - gsmtp Sending helo 250 mx.google.com at your service Sending From 530 5.7.0 Must issue a STARTTLS command first. cy4sm2248846pbc.13 - gsmtp 221 2.0.0 closing connection cy4sm2248846pbc.13 - gsmtp disconnected Email failed I am trying to connect with my gmail account, i got the ip address of the phone from this website "whatismyip.com" but i am not sure what should i put as the gateway and subnet. I am using "smtp.gmail.com" as my server and port 25. Can anyone please help with this. Thank you
|
|
|
|
|
14
|
Using Arduino / General Electronics / current sensor circuit.
|
on: March 07, 2013, 01:36:38 pm
|
Hi, I am trying to connect a current sensor with my arduino. I have read lots of forms but ended up getting confused with all that. I am using Hackeye 971 current sensor. http://www.veris.com/Item/H971.aspxCan any one please guide me what is the most simple and efficient way to connect it with my arduino using resistors. I am sorry in advance, it is not a very intelligent question. but I am confused how it is gonna work . thank you
|
|
|
|
|
15
|
Using Arduino / Networking, Protocols, and Devices / Re: Display temperature sensor readings through wifi shield
|
on: March 07, 2013, 10:40:45 am
|
Sorry for the late reply, but i used print statements. I am not sure why it wasn't working before . but this works fine. I found some code online, so it has a refresh button on web page #include <SPI.h> #include <WiFi.h> #include <OneWire.h> #include <DallasTemperature.h>
#define ONE_WIRE_BUS 2 // Data wire is plugged into port 2 on the Arduino
char ssid[] = "User Name"; // your network SSID (name) char pass[] = "Password"; // your network password int keyIndex = 0; // your network key Index number (needed only for WEP)
int status = WL_IDLE_STATUS;
WiFiServer server(80);
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs) OneWire oneWire(ONE_WIRE_BUS);
// Pass our oneWire reference to Dallas Temperature. DallasTemperature sensors(&oneWire); float tempC; float tempF; float rssi;
void setup() { Serial.println("check point 1"); //Initialize serial and wait for port to open: Serial.begin(9600); Serial.println("starting data sending..."); while (!Serial) { ; // wait for serial port to connect. Needed for Leonardo only } Serial.println("check point 2"); // check for the presence of the shield: if (WiFi.status() == WL_NO_SHIELD) { Serial.println("WiFi shield not present"); // don't continue: while(true); } Serial.println("check point 3"); // attempt to connect to Wifi network: while ( status != WL_CONNECTED) { Serial.print("Attempting to connect to SSID: "); Serial.println("check point 4"); Serial.println(ssid); // Connect to WPA/WPA2 network. Change this line if using open or WEP network: status = WiFi.begin(ssid, pass); Serial.println("check point 5"); // wait 10 seconds for connection: delay(10000);
} Serial.println("check point 6"); server.begin(); // you're connected now, so print out the status: printWifiStatus();
// start serial port
Serial.println("check point 6"); Serial.println("Dallas Temperature IC Control Library Demo");
// Start up the library sensors.begin(); } void loop() { // listen for incoming clients WiFiClient client = server.available(); if (client) { Serial.println("new client"); // an http request ends with a blank line boolean currentLineIsBlank = true; while (client.connected()) { if (client.available()) { char c = client.read(); Serial.write(c); // if you've gotten to the end of the line (received a newline // character) and the line is blank, the http request has ended, // so you can send a reply if (c == '\n' && currentLineIsBlank) { // send a standard http response header client.println("HTTP/1.1 200 OK"); client.println("Content-Type: text/html"); client.println("Connnection: close"); client.println(); client.println("<!DOCTYPE HTML>"); client.println("<html>");
client.println("<meta http-equiv=\"refresh\" content=\"25\">");
int digitalChannel = 0;
client.println(F("<td align=\"center\" valign=\"center\"><font size=\"12\" color=\"green\"> ****PUT YOUR HEADING HERE**** </font></td>")); client.print("<br />"); client.print("<br />"); client.print(F("<font color=\"red\">")); client.print("IP Address of the Device: "); client.print(WiFi.localIP()); // prints the ip address of the device
client.print("<br />"); client.print(F("<font color=\"red\">")); client.print("Signal Strength (RSSI): "); // prints the signal strength on the web server page client.print(WiFi.RSSI()); client.println(" dBm"); client.print("<br />"); client.print(F("<font color=\"blue\">")); client.print("<br />"); client.print("Temperature in Celsius: ");
client.print(tempC); client.print(" degrees C");
client.print(F("<font color=\"blue\">")); client.print("<br />"); client.print("Temperature in Fahrenheit: "); client.print(tempF = tempC*1.8 + 32.00); // converting Celsius to fahrenheit client.print(" Degrees F");
client.print("<br />"); client.println("</html>"); // creates an HTML form with a refresh button that reloads the page with out any variables client.print("<FORM action=\"http://*****PUT the IP address where you want it to reload it to *****/\">"); client.print("<P> <INPUT type=\"submit\" value=\"Refresh\"> </FORM>"); client.print("<img src = 'https://api.cosm.com/v2/feeds/61098/datastreams/sensor1.png?width=500&height=250&colour=%230000cc&duration=1day&legend=Degrees%20Farenheit&title=Apartment%20Temperature&show_axis_labels=true&detailed_grid=true&scale=auto&timezone=UTC'>");
break; } if (c == '\n') { // you're starting a new line currentLineIsBlank = true; } else if (c != '\r') { // you've gotten a character on the current line currentLineIsBlank = false; } } } // give the web browser time to receive the data delay(1); // close the connection: client.stop(); Serial.println("client disonnected"); } // call sensors.requestTemperatures() to issue a global temperature // request to all devices on the bus Serial.print("Requesting temperatures..."); sensors.requestTemperatures(); // Send the command to get temperatures Serial.println("DONE"); tempC = sensors.getTempCByIndex(0); Serial.print("Sensor is ONLINE"); Serial.print("Device 1 (index0) = "); Serial.print(tempC); Serial.print(" Degrees C"); } void printWifiStatus() { // print the SSID of the network you're attached to: Serial.print("SSID: "); Serial.println(WiFi.SSID());
// print your WiFi shield's IP address: IPAddress ip = WiFi.localIP(); Serial.print("IP Address: "); Serial.println(ip);
// print the received signal strength: long rssi = WiFi.RSSI(); Serial.print("signal strength (RSSI): "); Serial.print(rssi); Serial.println(" dBm");
}
|
|
|
|
|