ESP32 Using the HW timers

When I started programming on the ESP32 there was no Ticker library available as I was used to from the ESP8266 and Arduino. So I decided to write some code that makes it easy for me to use the ESP32’s hardware timers. But before I explain the code, some essentials about the HW timers. There are only 4 HW timers available, so the code snippet I made is supporting only 4 timers. The code snippet for the HW timer wrapper

Read more

Change partition size (Arduino IDE)

DEPRECATED. The partition size can now be choosen from the Tools–>Partition Scheme menu. To change the partition size for ESP32 using Arduino IDE I recommend this approach: Create a new partition description file in <LOCATION_OF_ARDUINO_ESP32>/tools/partitions , e.g max.csv

The above example gives you a partition size of 0x1E0000 or 1966080 bytes on cost of a smaller SPIFFS partition. Edit <LOCATION_OF_ARDUINO_ESP32>/boards.txt Make a copy of the board description that you want to change the partition size for, in this example

Read more

ESP32 WiFi setup over Bluetooth Serial (ESP32 code)

In my other post I wrote about setting up the ESP32 WiFi credentials over BLE. While testing and playing around with different phones, I found that even a quite new (but as well very cheap phone) I have does not support BLE. So I sat back in front of my development IDE and wrote something similar, but this time using Bluetooth Serial as communication. Most of the code is the same as in ESP32 WiFi setup over BLE so I

Read more

ESP32 WiFi setup over BLE (ESP32 code)

Most small applications that we write have the WiFi credentials integrated in the code. But sometimes you do not want to have your WiFi credentials in the source code, specially if it is open source and maybe accessible as a repository on Github or Bitbucket. Having the WiFi credentials in the code is as well not practical if you sell your devices to others that need to setup the WiFi credentials according to their local network. There are several solutions

Read more

ESP32 Bluetooth Serial and BLE server running together

There is a new kid coming into the arduino-esp32 world. A Bluetooth Serial library that allows you to use Bluetooth (not BLE) like a serial port. This way you can connect the ESP32 over Bluetooth to an Android app like the Serial Bluetooth Terminal and use it as a serial in/out interface. The library is not yet in the arduino-esp32 repository, but I grabbed a preview from copercini’s repo. It is working fine, I could connect my Android tablet to my

Read more

WiFi connection problem – NVS corrupted

If you have WiFi connection problems where WiFi.status() always returns WL_NO_SSID_AVAIL even you are sure that the AP is available and working, it might be that the NVS storage has been corrupted. The NVS storage is the place where esp-idf stores the WiFi credentials. See issue wifi connection problem on Arduino-esp32. To check if your NVS storage is corrupted you can use ESP32-Show_nvs_keys provided by stickbreaker. If your NVS storage is corrupted you can use the following code snippet to

Read more

ESP32 OTA status on TFT display

If you have your ESP32 connected to a display, wouldn’t it be nice to see the status of an OTA update in real time on this display? I thought it is a nice little add on to my application. And as it is working fine within my ESP32 weather station, I share here as a stand alone code, which makes it easier to understand and integrate into your own application. In this example I will use a 1.44″ TFT display from Elecrow.

Read more

Communication between devices that doesn’t require a server (TCP code examples)

TCP packet communication Instead of implementing a “full” web server, I decided to go to a simpler TCP server – client connection. This eliminates overhead in the protocol but as well limits the usage. It is not possible to just use a browser (Chrome, Firefox, …) to send commands to a device. But I was not planing to use browsers anyway. TCP client (control device) example for ESP8266 To be able to send a packet over TCP it is only

Read more
Free Link Directory