HiLetGo ESP32 for WeMos Mini D1 Module

I purchased a HiLetgo ESP32 ESP-32 ESP-32S ESP32S WiFi Bluetooth Wireless Board Module Based ESP-WROOM-32 Dual Core Mode CPU from Amazon mainly because it has a Lipo battery manager circuit onboard and I want to build a project that is battery powered. The package states it is a HiLetGo ESP32 for WeMos Mini D1 Module. The processor appears to be ESP-WROOM-32. It is also marked LOLIN32.

I am running Windows 10 with Arduino IDE 2.3.2. I installed the UART to USB driver and am able to connect through COM6. I have the ESP32 by Espressif installed.
The device powers up with the blue LED flashing. I do not see an exact description in the list of ESP boards to choose from. If I select WEMOS LOLIN32 and click Board Info I get:
BN:Unknown
VID: 0x10C4
PID: 0xEA60
SN: 0001
I entered the Blink LED program by Rick Santos to test the board. When I try to download, it compiles but I get an error:

A fatal error occurred: Failed to connect to ESP32: Wrong boot mode detected (0x13)! The chip needs to be in download mode.
For troubleshooting steps visit: Troubleshooting - ESP32 - — esptool.py latest documentation
Failed uploading: uploading error: exit status 2

I am not sure just what the problem is, or how to correct it. Is this board even compatible with the IDE? Do I need to install some other board from the manager?

The IDE works with other ESP8266 Boards I own.

Any suggestions would be most helpful.
thank you in advance.

have you checked the Amazon reviews?
some members experienced the same thing if that's your board

seems also the battery connector can be reversed / unprotected.

I am not using the battery at this time, instead powering from the USB. I will check the reviews, thanks.

I have the battery issue resolved, it was reverse polarity but I corrected it before connecting to the board. The battery charges from the USB. I also added a 1000 pF capacitor between EN and GND per one of the reviews on Amazon. It said a "small" capacitor; not sure what "small" means here. When I compile my sketch I get an error: My sketch does not have any interrupts that I am aware of, but apparently SoftwareSerial.h has a call to include avr/interrupt.h that is causing a problem if I understand the error message. My code is attached and it works fine without errors on two ESP8266 boards. Any ideas what I should do to correct this? I tried adding a zip file "AVR-INTERRUPT-HANDLING-master.zip" to the IDE but I get an error that this is for AVR only.

c:\Users\bbutc\OneDrive\Documents\Arduino\libraries\SoftwareSerial\SoftwareSerial.cpp:41:10: fatal error: avr/interrupt.h: No such file or directory
#include <avr/interrupt.h>
^~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: exit status 1

/***************************************************************************
* HiLetGo ESP32 BE-820 GPS Dog Collar 
* -- using BE-280 GPS
*  by Josh Hrisko | Maker Portal LLC (c) 2021
*  modified by Bob Butcher to elimiante storage
***************************************************************************/
#include <TinyGPS++.h>
#include <SoftwareSerial.h>
static const int RXPin = D2, TXPin = D1; // pins for ATGM336H GPS device
static const uint32_t GPSBaud = 38400; // default baudrate of ATGM336H GPS device
double street = 105.110815;            //longitude of end of driveway
double dist_feet = 0;
TinyGPSPlus gps;
SoftwareSerial ss(TXPin, RXPin);
void setup() {
  Serial.begin(112500); // start serial monitor for debugging
  ss.begin(GPSBaud);
}  
void loop() {
  while (ss.available() > 0){
    if (gps.encode(ss.read()) && gps.location.isValid() && gps.date.isValid() && gps.time.isValid()){
      double longit = String(gps.location.lng(),8).toDouble();
      dist_feet = (longit+ street)*360000;  //dist from end of driveway
      Serial.println(dist_feet,1);
    }
  }
}

You have an ESP32, you can’t use code developped specifically for AVR registers/architecture like SoftwareSerial.

The ESP32 has multiple hardware serial ports, so use one of those instead of the Software Serial instance

Serial2 is solid - there are potentials for conflicts with Serial1,3

Look into espsoftserial

If anyone is looking for an ESP32 source non pareil

Success! I finally found a routine that works. The board selected is WEMOS LOLIN32. I eliminated the 8266 routines and am now using Serial for the serial monitor and Serial2 for the GPS. Note that the pin numbering of the LOLIN 32 is rather random, number labels seem to correspond to GPIO number. Upload on the IDE does not put the board in download mode, it must be done manually.

To enter download mode both GPIO 0 (Pin 23, labeled 0) must be connected to GND and held low until firmware upload is complete. No capacitor is required on EN. Then press Reset button to enter download mode. Now it should be possible to upload the sketch into firmware. Once upload succeeds, remove the GND fromGPIO 0 Pin and Press Reset to run the firmware.

/***************************************************************************
* HiLetGo ESP32 BE-820 GPS Dog Collar 
* -- using BE-280 GPS
*  by Josh Hrisko | Maker Portal LLC (c) 2021
*  modified by Bob Butcher to eliminate storage
* To download GND GPIO 0 & GPIO 2 then press reset.
* To run un-ground GPIO 0 & 2 and Press Reset
***************************************************************************/
#include <TinyGPS++.h>
//#include <SoftwareSerial.h>
// #include <interrupt.h>
//static const int RXPin = D2, TXPin = D1; // pins for ATGM336H GPS device
static const uint32_t GPSBaud = 38400; // default baud rate of BE-280 GPS device
double street = 105.110815;            //longitude of end of driveway
double dist_feet = 0;
TinyGPSPlus gps;
// SoftwareSerial ss(TXPin, RXPin);
void setup() {
  Serial.begin(115200);  // start serial monitor for debugging
  // ss.begin(GPSBaud);
  Serial2.begin(GPSBaud);
}  
void loop() {
  while (Serial2.available() > 0){
    if (gps.encode(Serial2.read()) && gps.location.isValid() && gps.date.isValid() && gps.time.isValid()){
      double longit = String(gps.location.lng(),8).toDouble();
      dist_feet = (longit+ street)*360000;  //dist from end of driveway
      Serial.println(dist_feet,1);
    }
  }
}

I finally found a solution to make this work correctly. The ESP32 board works a bit differently from some other boards. First in order to download any sketch to the board via the USB connector and Arduino IDE, you must ground GPIO 0 and GPIO 2, then press the reset button to enter bootloader mode. It may also be necessary to unplug and plug in the USB connector to enter bootloader mode. The serial monitor will then display

16:15:27.793 -> ets Jul 29 2019 12:21:46
16:15:27.793 -> 
16:15:27.793 -> rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))
16:15:27.793 -> waiting for download

You can now upload the sketch. When upload is finished, unground GPIO 0 and GPIO 2 and press the reset button to run the sketch.
In order to get the second serial UART working you must add code to create a hardware serial UART and define the pins used. A software serial will not work with this board. Here is the full code.

#include <TinyGPS++.h>
#include <HardwareSerial.h> //required to use additional Serial UART's
HardwareSerial MySerial(1); //Declare a hardware serial, serial1 in this case
static const uint32_t GPSBaud = 38400; // default baudrate of BE-280 GPS device
double street = 105.110815;            //longitude of end of driveway
double dist_feet = 0; //distance from end of driveway
TinyGPSPlus gps;  //declare a gps
void setup() {
  Serial.begin(115200); // start serial monitor for debugging
// Note the format for setting a serial port is as follows: Serial2.begin(baud-rate, protocol, RX pin, TX pin);
  MySerial.begin(GPSBaud, SERIAL_8N1, 16, 17);  //start second serial to read GPS data
  pinMode(LED_BUILTIN, OUTPUT); //LED will blink when receiving data
 }  
void loop() {
  while (MySerial.available() > 0){
    if (gps.encode(MySerial.read()) && gps.location.isValid() && gps.date.isValid() && gps.time.isValid()){
      double longit = String(gps.location.lng(),8).toDouble();  //extract longitude as a double
      dist_feet = (longit+ street)*360000;  //dist west from end of driveway in feet
      Serial.println(dist_feet,1);  //print on serial monitor if connected
      digitalWrite(LED_BUILTIN, HIGH);   // turn the LED off (HIGH is off for ESP32)
      delay(750);                       // wait for 3/4 second
      digitalWrite(LED_BUILTIN, LOW);    // turn the LED on
      delay(250);                       // wait for 1/4 second
    }
  }
}
/*
 * 
 * There are three serial ports on the ESP known as U0UXD, U1UXD and U2UXD.
 * 
 * U0UXD is used to communicate with the ESP32 for programming and during reset/boot.
 * U1UXD is unused and can be used for your projects. Some boards use this port for SPI Flash access though
 * U2UXD is unused and can be used for your projects. 
* Baud-rates available: 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, or 115200, 256000, 512000, 962100
 *  Protocols available:
 * SERIAL_5N1   5-bit No parity 1 stop bit
 * SERIAL_6N1   6-bit No parity 1 stop bit
 * SERIAL_7N1   7-bit No parity 1 stop bit
 * SERIAL_8N1 (the default) 8-bit No parity 1 stop bit
 * SERIAL_5N2   5-bit No parity 2 stop bits 
 * SERIAL_6N2   6-bit No parity 2 stop bits
 * SERIAL_7N2   7-bit No parity 2 stop bits
 * SERIAL_8N2   8-bit No parity 2 stop bits 
 * SERIAL_5E1   5-bit Even parity 1 stop bit
 * SERIAL_6E1   6-bit Even parity 1 stop bit
 * SERIAL_7E1   7-bit Even parity 1 stop bit 
 * SERIAL_8E1   8-bit Even parity 1 stop bit 
 * SERIAL_5E2   5-bit Even parity 2 stop bit 
 * SERIAL_6E2   6-bit Even parity 2 stop bit 
 * SERIAL_7E2   7-bit Even parity 2 stop bit  
 * SERIAL_8E2   8-bit Even parity 2 stop bit  
 * SERIAL_5O1   5-bit Odd  parity 1 stop bit  
 * SERIAL_6O1   6-bit Odd  parity 1 stop bit   
 * SERIAL_7O1   7-bit Odd  parity 1 stop bit  
 * SERIAL_8O1   8-bit Odd  parity 1 stop bit   
 * SERIAL_5O2   5-bit Odd  parity 2 stop bit   
 * SERIAL_6O2   6-bit Odd  parity 2 stop bit    
 * SERIAL_7O2   7-bit Odd  parity 2 stop bit    
 * SERIAL_8O2   8-bit Odd  parity 2 stop bit    
*/

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.