I wrote a small program for ESP32 to show time, date, and crypto price in an OLED display. it also has the option to change watch phases through Bluetooth serial. It compiled successfully without any syntax errors. But it is showing the following error message
Sketch too big; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing it. Sketch uses 1508690 bytes (115%) of program storage space. Maximum is 1310720 bytes. Global variables use 52728 bytes (16%) of dynamic memory, leaving 274952 bytes for local variables. Maximum is 327680 bytes. text section exceeds available space in board
Compilation error: text section exceeds available space in board
I figured out that "BluetoothSerial.h" and <WiFi.h> take so much space. How can I fix this
And I am using the esp32 firebeetle. partition scheme option not available to add more space
#include <ThreeWire.h> #include <RtcDS1302.h> #include <Adafruit_GFX.h> #include <Adafruit_SH110X.h> #include "BluetoothSerial.h" #include <HTTPClient.h> #include <ArduinoJson.h> #include <WiFi.h> const char* ssid = "Nokia"; const char* password = "12345678q"; ThreeWire myWire(4,5,2); // IO, SCLK, CE RtcDS1302<ThreeWire> Rtc(myWire); BluetoothSerial SerialBT; #define SCREEN_WIDTH 128 // OLED display width, in pixels #define SCREEN_HEIGHT 64 // OLED display height, in pixels #define i2c_Address 0x3c //initialize with the I2C addr 0x3C Typically eBay OLED's #define OLED_RESET -1 // QT-PY / XIAO Adafruit_SH1106G display = Adafruit_SH1106G(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); char datestring[20]; char Blu_Rec_Data ='f'; //full char last_Rec_Data ='f'; void setup () { delay(250); // wait for the OLED to power up WiFi.begin(ssid, password); SerialBT.print("Connecting to WiFi..."); while (WiFi.status() != WL_CONNECTED) //Connect to the WiFi network { delay(500); SerialBT.print("."); } if(WiFi.status() == WL_CONNECTED) { display.print("Connected"); } display.begin(i2c_Address, true); // Address 0x3C default SerialBT.begin("SMART MIRROR"); Rtc.Begin(); RtcDateTime compiled = RtcDateTime(__DATE__, __TIME__); // Rtc.SetDateTime(compiled); display.println(); if (!Rtc.IsDateTimeValid()) { display.println("RTC lost confidence in the DateTime!"); } if (Rtc.GetIsWriteProtected()) { display.println("RTC was write protected, enabling writing now"); Rtc.SetIsWriteProtected(false); } if (!Rtc.GetIsRunning()) { display.println("RTC was not actively running, starting now"); Rtc.SetIsRunning(true); } RtcDateTime now = Rtc.GetDateTime(); if (now < compiled) { display.println("RTC is older than compile time! (Updating DateTime)"); } else if (now > compiled) { display.println("RTC is newer than compile time. (this is expected)"); } else if (now == compiled) { display.println("RTC is the same as compile time! (not expected but all is fine)"); } if(!display.begin(i2c_Address)) { display.println(F("SH110X allocation failed")); for(;;);} delay(2000); display.clearDisplay(); display.setTextSize(1); display.setTextColor(SH110X_WHITE); display.setCursor(2, 2); display.println("starting..."); display.display(); } void loop () { RtcDateTime now = Rtc.GetDateTime(); TheDisplay(now); //printDateTime(now); display.println(); if (!now.IsValid()) { display.println("RTC lost confidence in the DateTime!"); } if (SerialBT.available()) { Blu_Rec_Data = SerialBT.read(); } if(Blu_Rec_Data == 'f' ||Blu_Rec_Data =='d' ||Blu_Rec_Data =='s' ||Blu_Rec_Data =='t') { last_Rec_Data = Blu_Rec_Data; } } void TheDisplay(const RtcDateTime& dt) { if (last_Rec_Data =='f') { display.clearDisplay(); display.setCursor(0,2); display.setTextSize(2.9); display.print(dt.Hour()); display.print(":"); display.print(dt.Minute()); display.print(":"); display.print(dt.Second()); display.setCursor(8,30); display.setTextSize(1); display.print("Date: "); display.print(dt.Day()); display.print(":"); display.print(dt.Month()); display.print(":"); display.print(dt.Year()); display.print(" "); display.display(); } if(last_Rec_Data == 'd') { display.clearDisplay(); display.setCursor(0,2); display.setTextSize(2.9); display.print("Date: "); display.print(dt.Day()); display.print(":"); display.print(dt.Month()); display.print(":"); display.print(dt.Year()); display.print(" "); display.display(); } if(last_Rec_Data == 's') { HTTPClient http; http.begin("https://api.wazirx.com/sapi/v1/ticker/24hr?symbol=shibinr"); int httpCode = http.GET(); if (httpCode > 0) { String payload = http.getString(); //display.println(payload); DynamicJsonDocument doc(1024); DeserializationError error = deserializeJson(doc, payload); if (error) { display.println("Error: "); // handle error } else { String lastPrice = doc["lastPrice"].as<String>(); float bidPrice = doc["bidPrice"]; float askPrice = doc["askPrice"]; display.println(lastPrice); display.display(); } } else { // handle error } http.end(); delay(1000); // delay for 1 minute display.println("Delayed"); display.display(); } if(last_Rec_Data == 't') { display.clearDisplay(); display.setCursor(0,2); display.setTextSize(2.9); // display.print(" Time: "); display.print(dt.Hour()); display.print(":"); display.print(dt.Minute()); display.print(":"); display.print(dt.Second()); display.display(); } }
6 Related questions 0 php,image download 0 Image Download button PHP 0 Download Manager Wordpress Related questions 0 php,image download 0 Image Download button PHP 0 Download Manager Wordpress 0 Create a download button using html and php 1 Download image on button click 0 Download button automatically start downloading image 0 How can I add a download button? 1 Download image by clicking with PHP 0 Force image download - .php files download 0 how can i create a download button on it? Load 7 more related questions Show fewer related questionsSorted by: Reset to defaultKnow someone who can answer? Share a link to this question via email, Twitter, or Facebook.
ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJobm5raWuAdoGOmqmdrZmjvG61w55krKCfrLavs4yeqqlrYmLArLHTnJ9mrJ%2BkeqO1xmamrqxdpLNuv8%2Bamp5lmKTEbsDOZp2isF2ewQ%3D%3D