hi
i have nearly got this to work but at last minute i get (Sketch uses 1734329 bytes (132%) of program storage space. Maximum is 1310720 bytes.
Global variables use 60932 bytes (18%) of dynamic memory, leaving 266748 bytes for local variables. Maximum is 327680 bytes.
text section exceeds available space in board
Compilation error: text section exceeds available space in board)
ive got a wemos d1 mini esp32 as was suggested on here but now it comes up with this error
Sketch uses 1734329 bytes (132%) of program storage space. Maximum is 1310720 bytes.
Global variables use 60932 bytes (18%) of dynamic memory, leaving 266748 bytes for local variables. Maximum is 327680 bytes.
text section exceeds available space in board
Compilation error: text section exceeds available space in boardUse code tags to format >
hope its got code tags on it
is there anything i can or even get to clear this message this is water irrigation using wifi ,phone,alexa
colin
#include <LiquidCrystal_I2C.h>
#include <WiFi.h>
#include <ESPmDNS.h>
#include <WebServer.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
#include <BluetoothSerial.h>
#include <time.h>
#define I2C_ADDR 0x27
#define LCD_COLUMNS 16
#define LCD_ROWS 2
LiquidCrystal_I2C lcd(I2C_ADDR, LCD_COLUMNS, LCD_ROWS);
const char* ssid = "your_SSID";
const char* password = "your_PASSWORD";
BluetoothSerial SerialBT;
WebServer server(80);
const int relayPin = 23;
bool irrigationStatus = false;
unsigned long irrigationStart = 0;
const unsigned long irrigationDuration = 30000; // 30 seconds
unsigned long previousMillis = 0;
const long interval = 1000; // Interval to check time every second
void handleRoot() {
String html = "<html><body><h1>ESP32 Irrigation System</h1><p>Status: ";
html += irrigationStatus ? "On" : "Off";
html += "</p><p><a href=\"/toggle\">Toggle Irrigation</a></p></body></html>";
server.send(200, "text/html", html);
}
void handleToggle() {
if (!irrigationStatus) {
startIrrigation();
} else {
stopIrrigation();
}
handleRoot();
}
void startIrrigation() {
irrigationStatus = true;
irrigationStart = millis();
digitalWrite(relayPin, HIGH);
lcd.setCursor(0, 1);
lcd.print("Watering: On ");
}
void stopIrrigation() {
irrigationStatus = false;
digitalWrite(relayPin, LOW);
lcd.setCursor(0, 1);
lcd.print("Watering: Off ");
}
void setup() {
Serial.begin(115200);
SerialBT.begin("ESP32_Irrigation"); // Bluetooth device name
lcd.begin();
lcd.backlight();
lcd.setCursor(0, 0);
lcd.print("Irrigation Sys");
pinMode(relayPin, OUTPUT);
digitalWrite(relayPin, LOW);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("\nWiFi connected");
lcd.setCursor(0, 1);
lcd.print("WiFi Connected");
ArduinoOTA.begin();
if (MDNS.begin("esp32")) {
Serial.println("MDNS responder started");
}
server.on("/", handleRoot);
server.on("/toggle", handleToggle);
server.begin();
Serial.println("HTTP server started");
configTime(0, 0, "pool.ntp.org");
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("IP Address:");
lcd.setCursor(0, 1);
lcd.print(WiFi.localIP());
}
void loop() {
ArduinoOTA.handle();
server.handleClient();
unsigned long currentMillis = millis();
if (currentMillis - previousMillis >= interval) {
previousMillis = currentMillis;
struct tm timeinfo;
if (getLocalTime(&timeinfo)) {
char timeStr[16];
snprintf(timeStr, sizeof(timeStr), "%02d:%02d:%02d", timeinfo.tm_hour, timeinfo.tm_min, timeinfo.tm_sec);
lcd.setCursor(0, 0);
lcd.print("Time:");
lcd.setCursor(0, 1);
lcd.print(timeStr);
if ((timeinfo.tm_hour == 6 || timeinfo.tm_hour == 18) && timeinfo.tm_min == 0 && timeinfo.tm_sec == 0) {
if (!irrigationStatus) {
startIrrigation();
}
}
}
}
if (irrigationStatus && currentMillis - irrigationStart >= irrigationDuration) {
stopIrrigation();
}
if (SerialBT.available()) {
String command = SerialBT.readStringUntil('\n');
command.trim();
if (command.equalsIgnoreCase("ON")) {
startIrrigation();
} else if (command.equalsIgnoreCase("OFF")) {
stopIrrigation();
}
SerialBT.println(irrigationStatus ? "ON" : "OFF");
}
}
[sterretje edit]
code tags fixed
[/end]
