Tagged: Arduino
- This topic has 5 replies, 2 voices, and was last updated 10 months, 2 weeks ago by
Renzo Mischianti.
-
AuthorPosts
-
-
10 July 2024 at 10:10 #30916
Hello, im currently having the problem with my Arduino Uno + NETWORK SHIELD W5100 that when i try to make a code which sends an email when the temperature is hot its not working and giving me this output.
Sending status:
0
2
Here is my code:
#include <Ethernet.h>
#include <SPI.h>
#include <EMailSender.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <LiquidCrystal_I2C.h>
#include <Arduino.h>LiquidCrystal_I2C lcd(0x27, 16, 2);
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };EMailSender emailSend(“apikey”, “apikey”, “email”, “smtp”, port); // these are correct
#define ONE_WIRE_BUS 2 // Pin where the DS18B20 is connected
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);const int testnr = 30;
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print(“PEGASUS”);
lcd.setCursor(0, 1);
lcd.print(“Measure it”);
delay(2000);
lcd.clear();// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println(“Failed to configure Ethernet using DHCP”);
while(1);
}Serial.print(“IP address “);
Serial.println(Ethernet.localIP());
lcd.init();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print(“IP-Adresse”);
lcd.setCursor(0, 1);
lcd.print(Ethernet.localIP());
delay(2000);
lcd.clear();sensors.begin(); // Initialize DS18B20 senso
}
void loop()
{sensors.requestTemperatures(); // Request temperature readings
float temperature = sensors.getTempCByIndex(0); // Read temperature in Celsius from first sensorSerial.print(“Temperature: “);
Serial.print(temperature);
Serial.println(” °C”);
lcd.setCursor(0, 0);
lcd.print(“Temperature:”);
lcd.setCursor(0, 1);
lcd.print(temperature);
lcd.print((char)223);
lcd.print(“C”);
lcd.print(” | “);
lcd.print(DallasTemperature::toFahrenheit(temperature));
lcd.print(” F”);delay(5000); // Add a delay to prevent flooding the serial monitor
// Read temperature here and check if it’s above 29°C
if (temperature > 30) {
EMailSender::EMailMessage message;
message.subject = “Temperatur”;
message.message = “Hallo, die Raum Temperatur ist sehr hoch!”;EMailSender::Response resp = emailSend.send(“mail”, message); //my email
Serial.println(“Sending status: “);
Serial.println(resp.status);
Serial.println(resp.code);
Serial.println(resp.desc);
}
} -
11 July 2024 at 08:37 #30918
Hi Erjon,
witch provider do you use with Arduino UNO?
Bye Renzo-
11 July 2024 at 09:02 #30919
Hi Renzo,
i dont quite understand the question. If you mean Internet its Telekom.
Yesterday i tried the email sender and the temperature measuring and it worked. As soon as i added LCD Screen to it it didnt work anymore.
Could you help me there mate.E
-
-
11 July 2024 at 09:25 #30920
Hi Erjon,
w5500 not support TLS, so pay attention if you use It.If It doesn’t work after add more elements probably it’s a memory problem, try to disable attachments.
Bye Renzo -
11 July 2024 at 09:31 #30921
Hi Renzo,
i have an W5100. I said when i use EMailsender + Temperaturmeasurement it works and it sends an email after the Temperature is over 40C but when i add LCD screen to it it gives me this error:
Sending status:
0
2
About Memory i have 20% free on both memories. its very interesting why it wouldnt work when i add lcd that doesnt affect in any way.
I hope you understood meE
-
16 July 2024 at 08:27 #30940
Hi Erjon,
Sending emails requires a significant amount of memory at the exact moment the email is sent, so having only 20% of memory free might not be sufficient.
Bye Renzo
-
-
AuthorPosts
- You must be logged in to reply to this topic.