The use of the ESP8266 in the world of IoT

User avatar
By kaygisizugur
#84259 greetings to everyone
I previously used the esp 8266 12 e dev kit i with firebase for iot.
But since the pins were not enough,
I wanted to continue the same project with esp 32.
But esp 8266 in 2 seconds
esp 32,40 seconds to do the job
How do I speed up esp 32?
Or is there a free database running faster than Firebase?
The codes of esp 32 are as follows

Code: Select all#include <WiFi.h>                                               
#include <IOXhop_FirebaseESP32.h>

#include <OneWire.h>
#include <DallasTemperature.h>

#define FIREBASE_HOST "xx"
#define FIREBASE_AUTH "xx"
#define WIFI_SSID "xx"
#define WIFI_PASSWORD "xx"
String fireStatus = "";
String fireStatus1 = "";
String fireStatus2 = "";
String fireStatus3 = "";
String fireStatus4 = "";
String fireStatus5 = "";
int led = 2;
int led2 = 3;
int led3 = 4;
int led4 = 5;
int led5 = 6;
int led6 = 7;
OneWire ds(15);                                                                 
void setup() {
Serial.begin(115200);
pinMode(2, OUTPUT);               
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
while (WiFi.status() != WL_CONNECTED) {
  }
  Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH);
}
void loop() {
  fireStatus = Firebase.getString("aa1");
  if (fireStatus == "1") {             
    digitalWrite(2, HIGH);
    Firebase.setString("aa1e", "1");
  }
  else if (fireStatus == "0") {
    digitalWrite(2, LOW);
    Firebase.setString("aa1e", "0");
  }
    fireStatus1 = Firebase.getString("aa2");
  if (fireStatus1 == "1") {             
    digitalWrite(3, HIGH);
    Firebase.setString("aa2e", "1");
  }
  else if (fireStatus1 == "0") {
    digitalWrite(3, LOW);
    Firebase.setString("aa2e", "0");
  }
      fireStatus2 = Firebase.getString("aa3");
  if (fireStatus2 == "1") {                 
    digitalWrite(4, HIGH);
    Firebase.setString("aa3e", "1");
  }
  else if (fireStatus2 == "0") {
    digitalWrite(4, LOW);
    Firebase.setString("aa3e", "0");
  }
fireStatus3 = Firebase.getString("aa4");
  if (fireStatus3 == "1") {               
    digitalWrite(5, HIGH);
    Firebase.setString("aa4e", "1");
  }
  else if (fireStatus3 == "0") {
    digitalWrite(5, LOW);
    Firebase.setString("aa4e", "0");
  }
  fireStatus4 = Firebase.getString("aa5");
  if (fireStatus4 == "1") {             
    digitalWrite(6, HIGH);
    Firebase.setString("aa5e", "1");
  }
  else if (fireStatus4 == "0") {
    digitalWrite(6, LOW);
    Firebase.setString("aa5e", "0");
  }
}
User avatar
By sebastian678
#84376 Both chips have a 32-bit processor. The ESP32 is dual core 160MHz to 240MHz CPU whereas the ESP8266 is a single core processor that runs at 80MHz. ... This means that you can easily control and monitor devices remotely via Wi-Fi or Bluetooth (in case of ESP32) for a very low price...
https://routerlogin.ink