Sunday, December 20, 2020

ESP32: Get chip info

ESP_info.ino, to get chip info of ESP32.
#include <Esp.h>

void setup() {
  Serial.begin(115200);
  Serial.printf("\n\n---Start---\n");
  Serial.print("Chip Revision: ");
  Serial.print(ESP.getChipRevision());
  Serial.printf("\nCpuFreqMHz(): %lu", (unsigned long)ESP.getCpuFreqMHz());
  Serial.printf("\nSdkVersion: %s", ESP.getSdkVersion());
  Serial.printf("\nFlashChipSize: %lu", (unsigned long)ESP.getFlashChipSize());
}

void loop() {
  
}

Run on ESP32-DevKitC V4 with ESP32-WROVER-E module:


Saturday, December 19, 2020

ESP32 Bluetooth serial example

It's a simple example of ESP32 Bluetooth serial communication, run on ESP32-DevKitC V4.

The video show how it run, to communicate with Python/Raspberry Pi. The Python code is in my another blog: HelloRaspberryPi - Python (on Raspberry Pi) Bluetooth communicate with ESP32 SerialToSerialBT, using pybluez.

To make the ESP32 examples appear in examples list, you have to choose board of ESP32 first. It's ESP32 Wrover Module in may case.

The example available in Arduino IDE MENU > File > Examples > Bluetooth Serial (under Examples for Wrover Module) > SerialToSerialBT.


I make a little bit modification to display its Bluetooth MAC address.
// ref: Examples > BluetoothSerial > SerialToSerialBT

#include "BluetoothSerial.h"
#include "esp_bt_device.h"

#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it
#endif

BluetoothSerial SerialBT;

void printDeviceAddress() {
 
  const uint8_t* point = esp_bt_dev_get_address();
 
  for (int i = 0; i < 6; i++) {
 
    char str[3];
 
    sprintf(str, "%02X", (int)point[i]);
    Serial.print(str);
 
    if (i < 5){
      Serial.print(":");
    }
 
  }
}

void setup() {
  Serial.begin(115200);
  Serial.println("\n---Start---");
  SerialBT.begin("ESP32test"); //Bluetooth device name
  
  Serial.println("The device started, now you can pair it with bluetooth!");
  Serial.println("Device Name: ESP32test");
  Serial.print("BT MAC: ");
  printDeviceAddress();
  Serial.println();
}

void loop() {
  if (Serial.available()) {
    SerialBT.write(Serial.read());
  }
  if (SerialBT.available()) {
    Serial.write(SerialBT.read());
  }
  delay(20);
}

The function printDeviceAddress() is copy from dfrobot ESP32 Arduino: Getting the Bluetooth Device Address.

Next:


Friday, December 18, 2020

ESP32-DevKitC V4 - ESP32-WROVER-E module, with ESP32-D0WD-V3 embedded

ESP32-DevKitC V4 is a small-sized ESP32-based development board produced by Espressif. Most of the I/O pins are broken out to the pin headers on both sides for easy interfacing. Developers can either connect peripherals with jumper wires or mount ESP32-DevKitC V4 on a breadboard.



To cover a wide range of user requirements, the following versions of ESP32-DevKitC V4 are available with different ESP32 modules:
  • ESP32-WROOM-32E
  • ESP32-WROOM-32UE
  • ESP32-WROOM-32D
  • ESP32-WROOM-32U
  • ESP32-SOLO-1
  • ESP32-WROVER-E
  • ESP32-WROVER-IE
My board is installed with ESP32-WROVER-E module.

ESP32-WROVER-E and ESP32-WROVER-IE are two powerful, generic WiFi-BT-BLE MCU modules. ESP32-WROVER-E comes with a PCB antenna, and ESP32-WROVER-IE with an IPEX antenna. They both feature a 4 MB external SPI flash and an additional 8 MB SPI Pseudo static RAM (PSRAM). 

At the core of the module is the ESP32-D0WD-V3 chip, For details on the part numbers of the ESP32 family of chips, please refer to the document ESP32 Datasheet.

Espressif has released one wafer-level change on ESP32 Series of products (ECO V3). ESP32 ECO V3 User Guide is one of the must see document describes differences between V3 and previous ESP32 silicon wafer revisions.



To install ESP32 on Arduino IDE Boards Manager:

Arduino IDE Menu > File> Preferences
Enter the url in the "Additional Board Manager URLs":

To enter more than one URL, separate it with a comma.

Then:
Menu > Tools > Board > Boards Manager…
Search and install ESP32

related:

Examples (in Arduino framework):

Usefull links: