Adsense HTML/JavaScript

Showing posts with label ESP8266. Show all posts
Showing posts with label ESP8266. Show all posts

Sunday, October 17, 2021

Identify ESP chip and flash using esptool

Here to identify ESP chip and flash using esptool.py

First, you have to identify the USB port connect to ESP. In Linux/Raspberry Pi

- Before connect your ESP device to USB, run following command to clear dmesg buffer:

$ sudo dmesg -c

- Connect your ESP32 device to USB, and then run dmesg:

$ dmesg

-  You will find some like "cp210x converter now attached to ttyUSB0". Where /dev/ttyUSB0 is the USB port connected to ESP device.

TO Read Chip ID, enter the command:

$ esptool.py --chip auto --port /dev/ttyUSB0 chip_id
TO read SPI flash manufacturer and device ID, enter the command:
$ esptool.py --chip auto --port /dev/ttyUSB0 flash_id
Here is the output for ESP32-DevKitC V4 with ESP32-D0WD-V3 (revision 3) chip and 8MB flash.


ESP8266 with ESP8266EX chip and 4MB flash.


ESP32-S2-Saola-1 with ESP32-S2 chip and 4MB flash.


ESP32-C3-DevKitM-1 with unknown ESP32-C3 (revision 3) and 4MB flash.






Monday, November 16, 2020

Install esptool on Raspberry Pi OS (32 bit)

esptool.py is a Python-based, open source, platform independent, utility to communicate with the ROM bootloader in Espressif ESP8266 & ESP32 chips, and also ESP32-S2.

To install on Raspberry Pi (running 32 bit Raspberry Pi OS), open Terminal and enter the command:

$ sudo pip install esptool

or install Development mode, allows you to run the latest development version from this repository.

$ git clone https://github.com/espressif/esptool.git
$ cd esptool
$ pip install --user -e .


Thursday, September 17, 2020

Program Seeeduino XIAO as USB-to-Serial bridge, to access HC-08 BLE 4.0 Module/ESP WiFi Modules.


HC-08 is a Bluetooth 4.0 low energy module. It provide TTL Serial interface. If we want to access it using PC, normal a USB-to-Serial adapter is used.

In this exercise, Seeeduino XIAO is programmed as a USB-to-Serial bridge to read/write HC-08 from Raspberry Pi using Arduino IDE's Serial Monitor.

Connection between Seeeduino XIAO and HC-08

XIAO		HC-08
=====================
3V3		VCC
GND		GND
TX		RX
RX		TX

For the code, simple foreward date from SerialUSB to Serial1, and foreward Serial1 to SerialUSB.

X_USBbridge.ino

/*
Xiao act as a bridge between USB and Serial device

It's assumed the device is running 3V3
Connection
Xiao Rx   - device Tx
Xiao Tx   - device Rx
XIAO GND  - device GND
XIAO 3V3  - device VCC

*/

void setup()
{
  pinMode(LED_BUILTIN, OUTPUT);
  
  delay(1000);
  SerialUSB.begin(9600);
  Serial1.begin(9600);

  //wait serial ports to device
  //while(SerialUSB);
  while(!Serial1);
  
  //Blink the LED 3 times to indicate program started
  for(int i=0; i<3; i++){
    digitalWrite(LED_BUILTIN, HIGH);
    delay(500);
    digitalWrite(LED_BUILTIN, LOW);
    delay(500);
  }
}

void loop()
{
  if(SerialUSB.available() > 0){
    Serial1.write(SerialUSB.read());
  }

  if(Serial1.available() > 0){
    SerialUSB.write(Serial1.read());
  }
}

This video show how it work.

Before HC-08 connected (LED blinking), You can read/write HC-08 status with AT Command.
After HC-08 connected with test app on Android phone (LED on), you can send/receive text to/from the app. 

To know where/how to download datasheet (with AT Command Set) and test app for HC-08, read the post "HC-08 Bluetooth Module (BLE 4.0)".

To install Seeeduino XIAO board to Arduino IDE, read the post "Seeeduino XIAO".


This can be used to access HC-04 Dual Mode BLE SPP Bluetooth Module also.



Next:


Access ESP WiFi Modules:

With baud rate changed to 115200, it can access ESP WiFi modules. Tested with ESP-01S and ESP-12S.

X_USBbridge_115200.ino

/*
Xiao act as a bridge between USB and Serial device

It's assumed the device is running 3V3
Connection
Xiao Rx   - device Tx
Xiao Tx   - device Rx
XIAO GND  - device GND
XIAO 3V3  - device VCC

*/

void setup()
{
  pinMode(LED_BUILTIN, OUTPUT);
  
  delay(1000);
  SerialUSB.begin(115200);
  Serial1.begin(115200);

  //wait serial ports to device
  //while(SerialUSB);
  while(!Serial1);
  
  //Blink the LED 3 times to indicate program started
  for(int i=0; i<3; i++){
    digitalWrite(LED_BUILTIN, HIGH);
    delay(500);
    digitalWrite(LED_BUILTIN, LOW);
    delay(500);
  }
}

void loop()
{
  if(SerialUSB.available() > 0){
    Serial1.write(SerialUSB.read());
  }

  if(Serial1.available() > 0){
    SerialUSB.write(Serial1.read());
  }
}


Arduino IDE run on Raspberry Pi, to program Xiao as bridge to access ESP-01S: