Tuesday, May 12, 2020

New Espressif’s ESP development boards received, ESP32-S2, ESP32 aand ESP8266.

Just received ESP development boards from Espressif, ESP32-S2-Saola-1, ESP32-DevKitC V4, and ESP8266-DevKitC.





ESP32-S2-Saola-1 v1.2



ESP32-S2-Saola-1 is a small-sized ESP32-S2 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-S2-Saola-1 on a breadboard.

To cover a wide range of users’ needs, ESP32-S2-Saola-1 supports:

  • ESP32-S2-WROVER
  • ESP32-S2-WROVER-I
  • ESP32-S2-WROOM
  • ESP32-S2-WROOM-I

The full model name of my board is ESP32-S2-Saola-1R, with chip embedded ESP32-S2-WROVER comes with a PCB antenna, 4 MB flash and 2 MB PSRAM.

reference:
ESP32-S2-Saola-1
- ESP32-S2-WROVER & ESP32-S2-WROVER-I Datasheet
- ESP32-S2-WROOM & ESP32-S2-WROOM-I Datasheet

ESP32-DevKitC V4



ESP32-DevKitC is an entry-level development board. It has all the ESP32 pins exposed and is easy to connect and use.

My board named ESP32-DevKitC-VE, with Module ESP32-WROVER-E, comes with a PCB antenna, 4 MB flash and 8MB PSRAM.

reference:
ESP32-DevKitC Overview
ESP32-DevKitC V4 Getting Started Guide
- ESP32-WROVER-E & ESP32-WROVER-IE Datasheet

next:
ESP32-DevKitC + 2.8inch 240x320 SPI TFT (ILI9341) using TFT_eSPI library

ESP8266-DevKitC



ESP8266-DevKitC is an Espressif compact development board based on ESP8266 modules. All of the I/O pins of the module are broken out to the female header connectors on both sides of the board for easy interfacing. Developers can connect these pins to peripherals as needed.

My board named ESP8266DevKitC-02D-F, with module ESP-WROOM-02D, come with female header.

referene:
- ESP8266-DevKitC Getting Started Guide
- ESP-WROOM-02D/02U Datasheet

Next:
ESP8266 (NodeMCU/ESP8266 DevKitC) + SSD1306 I2C OLED, Platform IO.


ESP32-S2 vs ESP32 vs ESP8266


(graph source: ESP32S2 tweet)

Friday, May 8, 2020

Install VS Code/PlatformIO IDE on Ubuntu 20.04, to program Arduino/ESP8266/STM32.

This video show how to install VS Code/PlatformIO IDE on Ubuntu 20.04 (run on Windows 10/VirtualBox), to program Arduino. And also set upload port in platformio.ini and add USB permission to user.


Visit Visual Studio Code download page to download .deb version for Ubuntu.

After downloaded, open Terminal and switch to the downloaded folder and run the command to install VS Code:

$ sudo apt install ./<file>.deb

(reference: Visual Studio Code on Linux)

After installed, search and run VSCode.

In VS Code, select Extensions tab, enter platformIo in the search box, and click to install platformIO IDE.


(This screen shot after PlatformIO IDE installed. Before install, you can see a Install button.)

If you report with error of ModuleNotFoundError: No module named 'distutils.***'

Enter the command to install python3-distutils:

$ sudo apt-get install python3-distutils

(reference: https://github.com/platformio/platformio-vscode-ide/issues/907)

Close and restart VS Code to complete installation.

Now you can select PlatformIO on the left, and create a New Project. For Arduino Uno, steps refer to the above video.

May be you have to specify the upload port in platformio.ini. Open platformio.ini and add the code:
upload_port = /dev/ttyACM0

where /dev/ttyACM0 is the USB port.

Also have to add permission of the USB port to user. Enter the command in Terminal:
$ sudo usermod -a -G dialout <username>
$ sudo chmod a+rw /dev/ttyACM0

more:
2.8" 320*240 TFT Touch Screen shield (ILI9341 8 bit I/F) on Uno, using MCUFRIEND_kbv and Adafruit GFX Libraries
TFT Touch Screen shield (ILI9341 8 bit) + Uno, calibration and simple touch drawing example.


Platform IO + ESP8266/ESP32

With PlatformIO IDE installed, you can also program ESP8266/ESP32 board of Arduino framework. This video show the steps.



The following video show how to install library in PlatformIO, for I2C SSD1306 OLED driver for ESP8266/ESP32.


This example run on ESP32 (WEMOS Lolin32 with integrated SSD1306/OLED driver).

#include <Wire.h>
#include <SSD1306Wire.h>

SSD1306Wire display(0x3C, 5, 4);

void setup() {
  // put your setup code here, to run once:

  display.init();
  display.flipScreenVertically();
  display.setTextAlignment(TEXT_ALIGN_LEFT);
  display.setFont(ArialMT_Plain_16);
}

void loop() {
  // put your main code here, to run repeatedly:

  display.clear();
  display.drawString(0, 0, "ESP32/OLED");
  display.drawString(0, 20, "Hello PlatformIO");
  display.display();

  delay(1000);
  
}


Reference:
~ My old post: ESP32 + OLED Module

Next:
ESP8266 (NodeMCU/ESP8266 DevKitC) + SSD1306 I2C OLED, Platform IO.


PlatformIO + STM32

PlatformIO also can program STM32, such as NUCLEO-F401RE Board.



KEY FEATURES of NUCLEO-F401RE Board:

- Common features
  • STM32 microcontroller in LQFP64 package
  • 1 user LED shared with Arduino™
  • 1 user and 1 reset push-buttons
  • 32.768 kHz crystal oscillator
  • Board connectors:Arduino™ Uno V3 expansion connectorST morpho extension pin headers for full access to all STM32 I/Os
  • Flexible power-supply options: ST-LINK, USB VBUS or external sources
  • On-board ST-LINK debugger/programmer with USB re-enumeration capability: mass storage, Virtual COM port and debug port
  • Comprehensive free software libraries and examples available with the STM32Cube MCU Package
  • Support of a wide choice of Integrated Development Environments (IDEs) including IAR™, Keil® and GCC-based IDEs

- NUCLEO-F401RE Board-specific features
  • External SMPS to generate Vcore logic supply
  • 24 MHz HSE
  • Board connectors:External SMPS experimentation dedicated connectorMicro-AB or Mini-AB USB connector for the ST-LINKMIPI® debug connector
  • Arm® Mbed Enabled™ compliant
Reference: NUCLEO-F401RE

Steps to create  a new project for NUCLEO-F401RE Board, using Arduino and Mbed framework.


Error: libusb_open() failed with LIBUSB_ERROR_ACCESS

To make PlatformIO run on Ubuntu, in addition to add USB permission to user as describe above, you have to install udev rules (99-platformio-udev.rules) also.

Enter the commands in Terminal:

$ curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core/master/scripts/99-platformio-udev.rules | sudo tee /etc/udev/rules.d/99-platformio-udev.rules

$ sudo service udev restart

After this file is installed, physically unplug and reconnect your board.


Update VS Code for Ubuntu

If update of VS Code is available and you are asked to Download Update.


Just close VS Code and run the commands in Terminal:

$ sudo apt-get install apt-transport-https
$ sudo apt-get update
$ sudo apt-get install code # or code-insiders

reference: https://code.visualstudio.com/docs/setup/linux

Updated 1.46.0 currently@2020-06-11



Monday, April 13, 2020

ESP-NOW: Easiest Wireless Communication Between ESP Boards (ESP-32 and ESP8266 Compatible)

ESP-NOW is a fast connectionless communication protocol developed by Espressif that features short packet transmission and allows multiple boards (ESP-32 and ESP8266 Compatible) to exchange data without using Wi-Fi.


For complete project details (schematics + source code), visit https://randomnerdtutorials.com/esp-now-two-way-communication-esp32/
Getting Started with ESP-NOW on ESP32 ~ https://randomnerdtutorials.com/esp-now-esp32-arduino-ide/
Getting Started with ESP-NOW on ESP8266 ~ https://randomnerdtutorials.com/esp-now-esp8266-nodemcu-arduino-ide/