Wellys Dev

  • Home
  • Search/Topics
  • Writings
  • About

    2022

  • 2022-03-11
    ESP32: Automation

    Where I discuss different methods of automating the process of compiling/linking/loading code for an embedded microcontroller.

    Update March 13, 2022

    For automation to work well, it needs to work on multiple platforms along with other automation. For example, I use git as my versioning system, and GitHub for Dashboard, the repository for this entry. The problem I had with Option 2 ESP32 and Make below was that it is difficult to incorporate environmental variables. Environmental variables are values used locally to define specific aspects of your development environment. I use the environmental variables, AVR_PORT and AVR_MCU in my AVR_C code to set the microcontroller and serial port. On my Mac in my .zshrc file, I have

  • 2022-02-17
    ESP32: Using a modular approach

    Where I examine the differences between writing a monolithic program versus a much more modular program.

    Important

    While I display some of the code on this page, the absolute truth of working code is on github. Use it to fully understand and/or implement what I describe below. The github site also contains the latest information in its README.

    Introduction

    Many of the examples of programming the ESP32 are monolithic programs, the data gathering code is combined with the setup code and the web display code. A monolithic approach is not a good programming practice for several reasons. I’ll go into detail as to why you won’t want to program in this manner, as well as how to write code in a more modular fashion.

  • 2022-02-11
    ESP32: Solving Issues with Arduino Development

    Where I demonstrate identifying and solving specific issues with developing code for the ESP32 using the Arduino framework.

    Use Both the IDE and the CLI

    While my entries are primarily related to using arduino-cli, I will use the IDE for a couple of reasons:

    1. To test something that might work or should work, however, it isn’t. For example, if I buy a new board, I’ll use the IDE and blink to simply check if the board works.
    2. To upload data to the SPIFFS (of LittleFS ) filesystem. Its very easy (see below) to add SPIFFS file upload capability to the IDE. Its not quite as easy using the command line and/or I haven’t spent time attempting to understand it.
    3. To find the USB port. Sometimes the easiest method of determing the USB port is to fire up the IDE, attach the board and see what port shows up.

    Sublime Text Integration

    Moved to here - Automation

  • 2022-02-09
    ESP32: Using arduino-cli

    This is a raw dump of my exploring using the arduino-cli with the ESP32. I wanted to find something that was better than the Arduino IDE, however, not as complex as VS Code/PlatformIO. Using arduino-cli, allows me to use my programming editor, Sublime Text as my code editor as well as some simple automation (coming later).

    Using arduino-cli with ESP32

    Documentation and Tutorial Links

    • Getting Started — Arduino-ESP32 2.0.2 documentation
    • http://esp32.net/
    • https://github.com/espressif/arduino-esp32
    • L1: Intro to the ESP32 - Physical Computing
    • https://www.survivingwithandroid.com/arduino-cli-compile-upload-manage-libraries-cores-boards/
    • https://peppe8o.com/installing-external-libraries-with-arduino-cli-on-raspberry-pi/
    • 160+ ESP32 Projects, Tutorials and Guides with Arduino IDE | Random Nerd Tutorials
    • Overview | Adafruit HUZZAH32 - ESP32 Feather | Adafruit Learning System
    • ESPRESSIF Documentation
    • ESP32 Arduino Forum
    • ESP Without The Arduino IDE | Grav
    • https://randomnerdtutorials.com/esp32-dht11-dht22-temperature-humidity-web-server-arduino-ide/
    • https://arduino.github.io/arduino-cli/0.19/getting-started/
    • https://www.devdungeon.com/content/arduino-cli-tutorial
    • https://microcontrollerelectronics.com/the-arduino-command-line-interface-cli/
    • Arduino Pro

    Install arduino-cli

    # install from github
    curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
    # verify installation
    arduino-cli version
    
    # if the system is unable to find arduino-cli, see note below.
    bash: command not found: arduino-cli
    
    # add an alias to make it easier to use (add to the .bashrc file)
    alias ac="arduino-cli"
    
    # setup configuration file
    arduino-cli config init
    Config file written: /home/username/.arduino15/arduino-cli.yaml
    # Documentation for file: https://arduino.github.io/arduino-cli/0.19/configuration/ 
    
    # if using a 3rd party board, add to yaml file
    board_manager:
      additional_urls:
        - https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
    arduino-cli core update-index
    arduino-cli board listall
    arduino-cli core install esp32:esp32
    Platform esp32:esp32@2.0.2 already installed
    

    Note:

    Upon installing, arduino-cli, a great way to test it is to verify its version using arduino-cli version. However if the system is unable to find arduino-cli, you will get this:

  • 2021

  • 2021-06-08
    ESP32 MicroPython Coding Setup

    A short entry to explain how to code using MicroPython on the ESP32.

    Background

    In my introduction to Micropython, I mentioned how I wrote MicroPython for the ESP32 on a Mac. As I stated, Phillip van Allen has a nice process, however I like my process more. This entry will review how I develop code as it might be helpful to others.

    Mac Process

    Serial Monitor

    I use a paid application called Serial for serial communication with devices. There are free products, however, I found when using Serial, I’m more productive and I’m able to setup custom settings for each device to maximize throughput while taking care of the idiosyncrasies of each device. I’m also able to connect and disconnect Serial from the device easily and quickly, which is why my approach works so well.

  • 2021-06-07
    Testing MicroPython with the Labrador: PWM

    Where I continue to use the Labrador to test the PWM functionality of the ESP32.

    Sources

    • Makeability Lab Lesson 3: Fading an LED with PWM
    • ESP32-GetStarted: PWM
    • MicroPython PWM
    • Espressif: LED Control

    Background

    We continue to use the Labrador to evaluate how the HUZZAH32 operates. In this case, we’ll dive into how to use the H/W PWM functions as compared to doing it in software.

    The PWM functionality is called LEDC by Espressif, the manufacturer of the ESP32. This stands for LED control and it works quite well for fading, controlling brightness etc of an LED. That said, we can understand it far better if we observe the signals using the Labrador.

  • 2021-06-06
    Testing MicroPython with the Labrador: Blink

    Where I use the Labrador to test specific functions of the ESP32 running MicroPython.

    Sources

    • Quick reference for the ESP32
    • ESP32-GetStarted
    • Adafruit HUZZAH32
    • ESP32-DevKitC I think this is the same as the HiLetGo version I have
    • ESP32 Makeability Lab

    Background

    The best way to begin to understand a board is to play with it. In more technical terms, this means writing software and learning how the board responds. The higher the capability of the board, the greater the need for examining the board with high functioning tools. In our case, we are going to keep things very inexpensive, however, extremely capable and powerful.

  • 2021-06-05
    MicroPython

    Where I investigate using MicroPython on the HUZZAH32.

    Background

    I have spent quite a few years using Python to develop applications. I like the language, however I believed it wasn’t a good candidate for microcontrollers. Given the strong development behind both CircuitPython and MicroPython, I though it would be a good idea to test it and determine via testing and not assumptions.

    Sources

    • Micro Python on ESP32 (HUZZAH32)
    • Getting Started on ESP32
    • MicroPython
    • MicroPython Documentation

    Getting Started

    I followed the steps Wolf Paulus provides on his website and had no problems. I am using macOS Big Sur with the Apple native USB drivers. Which means I’m using /dev/tty.usbserial-01F4D567 and not /dev/tty.SLAB_USBtoUART. I haven’t had any problems…yet.

  • 2021-05-31
    ESPForth 7.0

    Where I find a much, more evolved version of ESPForth. While investigating a bug I found in ESPForth (now called ESPForth6), I ran across a new version of ESPForth 7.0, which I’ll refer to as ESPForth7.

    Sources

    • GitHub eForth Source
    • Documentation and ino file

    Comments

    Each time I used ESPForth6, I would experience a bug with the word “constant”.

    So I began to investigate ESPForth. Arduino-Forth who had been using FlashForth has now begin to investigate it. Which led me to the sites above. The good news is that I downloaded the ino file for ESPForth 7.05 and it compiled and loaded the first time.

  • 2021-05-28
    PinTest

    Where I write an Arduino program to test pins on a specific board in order to confirm a Forth HAL for the same board.

    Pin Testing

    When writing software which will control a circuit, it is best to confirm the behavior of circuit using known or familar test software before attempting to write with a new language. For example, I am developing a HAL/Primitive/User layer for the ESP32 using ESPForth. As the board, the Adafruit HUZZAH32 has an Arduino framework already developed for it, it is a good idea to test the board using the Arduino C++ code before testing it with the ESPForth words.

Page 1 of 2
Copyright © 2025 Lief Koepsel
  • Home
  • Search/Topics
  • Writings
  • About