The current Espressif documentation integrating with Eclipse are kind of broken and did not work for me (they are changing from make files to use CMake). The good news is that I have found a way to easily integrate the IDF with Eclipse which is documented below. Because I’m using the ESP32 in combination with the NXP Kinetis and SDK, it makes sense to have everything in the MCUXpresso IDE (I’m using the Version 11.0.0).
Here’s an open source hardware development board for Espressif audio development framework, the ESP32-ADF, from Olimex:
With ESP32-WROOM-B module with 8MB RAM and 4MB of Flash, two microphones, two 3W speakers, codec, amplifier, Lipo charger, USB with programming, Audio 3.5mm jack, ESP32-ADF board offers everything you need to start playing with Espressif Audio Development Framework.
In the previous two posts of this tutorial, I explained how to perform an over-the-air update of the firmware running on the esp32 chip.
Sometimes you may need to revert to the factory firmware, that is the firmware stored in the flash memory when the chip was programmed. Many consumer devices have a button or a pin that, if you press it for some seconds, triggers a reset function:
In this post I’ll show you how to add this functionality to your project.
As explained in a previous post, the flash memory connected to the esp32 chip is divided into some partitions, based on a layout configured when you program the chip.
Partitions that can store firmwares are of the app type. The partition that contains the firmware programmed via USB, has the factory subtype.
The esp-idf framework includes a method to search partitions in the flash memory:
In the following video you can see how to perform a factory reset. In the video you can also learn how to “count” the number of seconds a button is pressed to trigger the reset function only after a fixed threshold (3 seconds in my example). Enjoy!
I recently decided to update the Polar Coaster project. The primary reason was to update the controller to use Grbl_ESP32 firmware. I also thought I could make it smaller, lighter and remove a little cost.
The old controller was not custom made and just sort of tacked onto the back. This increased the size and didn’t look very good. It had a Bluetooth module, but you still had to stream the gcode. You could use an Android app, but that was still a little awkward.
The controller runs Grbl_ESP32. This was recently updated to include pen machine features. This allows precise control and calibration of the pen servo. You can control the speed, timing and endpoints of the servo travel.
I have done several pen and laser machines lately, so I decided to create a custom PCB for Grbl_ESP32 for these types of machines. This is a small (70mm x 60mm) PCB with all the features a pen plotter or laser cutter/engraver would need.
These typically use stepper motors for the X and Y axes. On pen plotters, the Z axis is controlled by a servo or solenoid. On lasers you need an accurate PWM for laser power control.
A board to control your CNC machine with Grbl_ESP32 designed by Bart Dring, that is available on GitHub:
This is a Grbl_ESP32 CNC Development board. This is a quick and easy way to use and test CNC on the ESP32 controller.
Grbl is a great CNC firmware that has been around for nearly a decade. It was originally designed for the Arduino UNO and basic 3 axis CNC routers, but it has been ported to other CPUs and was the basis for many other CNC and 3D printer firmwares.
The firmware was written using the Arduino IDE to make it as user friendly as possible. If you have experience with Arduinos, this will not be much different.
In the previous post of this tutorial, I explained how it is possible to update your board Over-The-Air thanks to a feature of the Freshen IoT dashboard.
Today I’ll show you how to update the firmware running on an esp32 chip using only components included in the esp-idf framework, without the need of any external tools or platforms.
The esp-idf framework offers a set of native functions to implement, in your program, the ability to be updated over the air.
Those functions are grouped in the app_update component and to use them in your program you have to include the corresponding header file:
Altough the use of the native functions is not very difficult (on Github you can find an example program), Espressif developers have added a component to the framework that makes it even easier the over the air update if the new firmware is located on a web site.
The esp_https_ota component uses the OTA API to update the firmware of your board, downloading the binary file that contains the new firmware from a web site. As the name suggests, the only requirement (for security reason) is that the web site supports the secure version of the protocol (HTTPS).
The component is able to automatically identify an OTA partition in the flash memory that is not in use and to save the new firmware in that partition. It then configures the chip to boot from that partition:
The use is very simple. First create an esp_http_client_config_t struct to configure the URL of the file with the new firmware and the SSL certificate of the server (or the certificate of the CA that signed it):
You have to provide the certificate in PEM format. To store the certificate in your program, you can leverage the embedding binary files functionality of the firmware, as I already explained in a previous tutorial.
Then you only have to call the function:
esp_err_t ret = esp_https_ota(&ota_client_config);
to start the update process. If – when the process is complete – the ret variable contains a positive result (ESP_OK), you can reboot the chip to run the new firmware:
A real application would probably need to periodically check if a new firmware is available and, only in that case, to start the update process. How can it be done?
In the program I wrote for this post and that is explained in the video below, I’m going to show a way widely used also in commercial products… enjoy the show
I’ve been working on an ESP32 module. Part of the problem I’ve been seeing with inexpensive IoT dev boards, is that the design around the power system hasn’t been very good. Here’s my attempt to fix that. This is a battery-ready module with a proper lithium battery charge circuit, lithium battery protection circuit, power supply, and antenna, all in a 1 inch by 1 inch package.
The goal is to have a tiny, inexpensive module that can immediately accept a battery and be deployed in the field, along with 30 of its mates.
AM Radio transmissions are based on a carrier signal which is modulated by the audio signal. It’s a very basic principle but prone to noise from the environment. Using the ESP32 it is really simple to generate an analog signal using the built-in DACs. With the provided code here just a wire as an antenna has to be connected to the pin 25 of the ESP32. The transmission will end up on the AM frequency ~835kHz.