ESP32WROOM32 did NOT Run until I sent something to Serial.

drwho30
Posts: 3
Joined: Tue May 14, 2024 1:13 pm

ESP32WROOM32 did NOT Run until I sent something to Serial.

Postby drwho30 » Mon Nov 11, 2024 5:59 pm

Hi! I'm using Arduino IDE v2.3.3 - ESP32 Dev Module - esp32 by Espressif Systems v3.0.7
my board did NOT run until I sent something to Serial then it start booting and run normal.
i need help auto run please! Thanks

here booting info that i got

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:4832
load:0x40078000,len:16460
load:0x40080400,len:4
load:0x40080404,len:3504
entry 0x400

My code:

Code: Select all

  String str_Rec;
  int pos_Equal;
  bool DI1 = true;
  String pointName;
  String pointValue;

  String str_Send;

void setup() {
  // put your setup code here, to run once:
  Serial.setTimeout(200); // timeOut 200 ms
  Serial.begin(115200, SERIAL_8N1);
  delay(3000);
}

void loop() {

  if (Serial.available() > 0)  // reply only if you receive data:
  {
    str_Rec = Serial.readString();
    pos_Equal = str_Rec.indexOf("=?");

    if (pos_Equal != -1)  
    {
      pointName = str_Rec.substring(0, pos_Equal);
      if (DI1==true)
      {
        str_Send = pointName + "=" + "ON"; 
        DI1 = !DI1;
      }
      else
      {
        str_Send = pointName + "=" + "OFF"; 
        DI1 = !DI1;
      }
      Serial.println(str_Send); 
    }
 }
  delay(1);
}
      

Who is online

Users browsing this forum: No registered users and 61 guests