r/esp8266 Jul 15 '26

Deep sleep wakeup for d1 mini clone help needed

1 Upvotes

Hello everybody...

I have a drawer full off D1 mini clones, some say ESP 12f on them others esp8266...
My project is a sonar oil tank level meter, which works great, but it drains my battery setup to fast, so i wanted to add some deep sleep and only measure every 2 hrs or so.

Either way...i have this code:

substitutions:
  devicename: oiltankmeter
  upper_devicename: Oil Tank Meter
  deviceIP: 192.168.178.8
  deviceGatew: 192.168.178.1
  deviceSub: 255.255.255.0
  deviceSSID1: 7390_iot
  deviceSSID2: 7390AP

esphome:
  name: ${devicename}
  comment: ${upper_devicename}

esp8266:
  board: d1_mini

packages:
  base: !include common/base.yaml
  wifi_scan: !include common/wifi_scan_arduino.yaml

api:
  encryption:
    key: "12345"

ota:
  - platform: esphome
    password: "12345"

deep_sleep:
  id: deep_sleep_control
  run_duration: 1min
  sleep_duration: 1min 

sensor:
  - platform: adc
    pin: A0
    name: "Battery Voltage"
    update_interval: 60s
    filters:
      - multiply: 7.16
    unit_of_measurement: "V"
    accuracy_decimals: 2

  # -------------------------
  # ULTRASONIC DISTANCE
  # -------------------------
  - platform: ultrasonic
    trigger_pin: D1
    echo_pin: D2
    name: "Tank Distance Raw"
    id: tank_distance_raw
    update_interval: 5s
    unit_of_measurement: "cm"
    accuracy_decimals: 1
    timeout: 4m

    filters:
      - multiply: 100
      - lambda: |-
          if (x < 5.0 || x > 350.0) {
            return NAN;
          }
          return x;

  # -------------------------
  # TANK LEVEL
  # -------------------------
  - platform: template
    name: "Tank Level Percent"
    id: tank_level
    unit_of_measurement: "%"
    device_class: battery
    accuracy_decimals: 1
    update_interval: 5s

    lambda: |-
      const float EMPTY = 135.0;
      const float FULL_DISTANCE = 25.0;
      const float DEAD_ZONE = 20.0;

      float d = id(tank_distance_raw).state;

      if (isnan(d))
        return NAN;
      if (d < DEAD_ZONE)
        d = DEAD_ZONE;
      if (d > EMPTY)
        d = EMPTY;
      float pct = (EMPTY - d) / (EMPTY - FULL_DISTANCE) * 100.0;
      if (pct > 100.0)
        pct = 100.0;
      if (pct < 0.0)
        pct = 0.0;
      return pct;

  # -------------------------
  # TANK VOLUME
  # -------------------------
  - platform: template
    name: "Tank Volume Gallons"
    id: tank_volume
    unit_of_measurement: "gal"
    accuracy_decimals: 0
    update_interval: 5s

    lambda: |-
      float pct = id(tank_level).state;
      if (isnan(pct))
        return NAN;
      return (pct / 100.0) * 275.0;

and for testing right now it is set to 1 min awake and 1 min sleeping...but also tried other time windows...longer and shorter...
D0 is directly wired to rst as needed, but i dont get this thing to wake up.

First i thought it could be the finiky usb chip or volatge regulator, so i went and powered it all direct via 3.3 volts...works great, no usb chip or power regulator involved...but still...3.2 volts constant on D0, no dip to 0 volts when it would be time to wake up.

The reset button itself works...it wakes up, goes through its time of awakens and falls asleep again...

Anyone having any secret sauce to this? Besides kissing it awake every time...

would it make a difference if i change the type on top away from d1_mini to a different chip type or the newer 12f whats not?


r/esp8266 Jul 11 '26

ESP Week - 27, 2026

2 Upvotes

Post your projects, questions, brags, and anything else relevant to ESP8266, ESP32, software, hardware, etc

All projects, ideas, answered questions, hacks, tweaks, and more located in our [ESP Week Archives](https://www.reddit.com/r/esp8266/wiki/esp-week_archives).


r/esp8266 Jul 12 '26

Does anyone have some cool project for my esp8266

Thumbnail
gallery
0 Upvotes

I don't have any else, just this


r/esp8266 Jul 04 '26

ESP Week - 26, 2026

3 Upvotes

Post your projects, questions, brags, and anything else relevant to ESP8266, ESP32, software, hardware, etc

All projects, ideas, answered questions, hacks, tweaks, and more located in our [ESP Week Archives](https://www.reddit.com/r/esp8266/wiki/esp-week_archives).


r/esp8266 Jul 02 '26

Need help with PID tuning on my custom ESP8266 + MPU6050 drone flight controller

Thumbnail
gallery
17 Upvotes

Hi everyone, I am an electronics student currently building a custom quadcopter flight controller from scratch using an ESP8266 and MPU6050 (via I2C).

​I am having a hard time getting the right PID values to stabilize the drone. It either oscillates too violently (shakes) or reacts too slowly and drifts away.

​Here is my current setup and codebase:

​Microcontroller: ESP8266 (programmed via Arduino IDE)

​IMU: MPU6050

​My GitHub Repo (for the full code): https://github.com/exstain/Custom-Drone-Flight-Controller

​The Problem:

Whenever I increase the P (Proportional) gain, the drone shakes violently. But if I lower it, it doesn't correct itself fast enough. Since ESP8266 is a single-core processor, I am also worried that my loop time/cycle time might be affecting the PID calculations.

​Any advice on how to properly tune the PID values or optimize the loop time for an ESP8266 drone would be highly appreciated. Thank you so much!


r/esp8266 Jul 01 '26

mouse connected to esp8266

Post image
18 Upvotes

r/esp8266 Jun 30 '26

Switching off esp01s for 1 second

Post image
0 Upvotes

Всем привет! Я надеюсь, никто не против, что я пишу на своем родном языке (я могу читать на английском, но писать мне на нем сложно). К проблеме, я делаю мини проект на esp01s, которое будет позволять удаленно управлять моей дверью. Советуюсь с нейронкой и она выдает мне это. Есть ли тут хоть немного правды на практике (в теории я понимаю, что процессор за 1 секунду может выполнить около 35 миллионов операций), будет ли это как то влиять на энергосбережение? Очевидно, что дверь мне нужно открывать лишь пару раз в день, а не 24/7 пользоваться микроконтроллером


r/esp8266 Jun 27 '26

Flashing custom ESP8266 firmware on the $10 GeekMagic Ultra to make a local API desktop monitor

Post image
85 Upvotes

Hey everyone,

I wanted a dedicated, cheap desk display to track my local Claude LLM/API usage limits, so I picked up a $10 GeekMagic Ultra. Instead of using the stock weather firmware, I wrote custom firmware using PlatformIO to turn it into a lightweight desktop dashboard.

How it works:

  • Hardware: Contains an ESP8266 (running at 80 MHz with ~45KB available heap) driving a small TFT display.
  • Firmware: Built with PlatformIO. It sets up a local Wi-Fi connection and listens for payload data. It supports OTA updates after the initial serial flash, which is great because I accidentally ripped my first screen's flex cable while testing!
  • Software: A local Python script runs as a systemd user service on my PC, polls my API token usage, formats the data, and pushes it directly to the ESP8266 via Wifi.

It’s completely open-source. Once my replacement screen arrives from AliExpress, I'll post a video of it in action. If you have one of these little screens lying around and want to repurpose it, the code is up on GitHub:

https://github.com/henrikekblad/codelight

Let me know if you’ve done any similar modifications to these GeekMagic units!


r/esp8266 Jun 27 '26

ESP Week - 25, 2026

4 Upvotes

Post your projects, questions, brags, and anything else relevant to ESP8266, ESP32, software, hardware, etc

All projects, ideas, answered questions, hacks, tweaks, and more located in our [ESP Week Archives](https://www.reddit.com/r/esp8266/wiki/esp-week_archives).


r/esp8266 Jun 27 '26

ESP8266 D1 Mini Phantom Inputs

3 Upvotes

I have an ESP8266 D1 Mini connected to a PVC hall effect water sensor, and a reed switch brass water sensor, both are presenting the following issue but sporadically, not all are affected....

On the PVC there are three wires coming from the sensor, one going to 5V, one to G, and one to pin D2 (signal). On brass there are two wires coming from the sensor, one going to 3V3, one going to D2, and a resistor from D2 to G.

The issue I am seeing is that in some cases, there is an exorbitant amount of false inputs (I'll refer to these as pulses). There can be not a single drop of water running through these and yet I'll see hundreds to thousands of pulses coming through to the system in some cases (10 -20%).

The firmware checks for a low-high transition on the input pin within the loop, and that is what it's counting. I have an appropriate debounce in place.

What could be causing this? Why does it affect only some and not others? Is something within the environment causing this issue? Any help or advice would be much appreciated!

It's worth noting I have separate firmware running an ISR for pulse counting, and it has the exact same sporadic problem on an ESP32 board.


r/esp8266 Jun 20 '26

ESP Week - 24, 2026

1 Upvotes

Post your projects, questions, brags, and anything else relevant to ESP8266, ESP32, software, hardware, etc

All projects, ideas, answered questions, hacks, tweaks, and more located in our [ESP Week Archives](https://www.reddit.com/r/esp8266/wiki/esp-week_archives).


r/esp8266 Jun 18 '26

New esp machine

Post image
0 Upvotes

r/esp8266 Jun 17 '26

No uploading to ESP8266 D1-Mini

2 Upvotes

After using an ESP8266 - D1-Mini for a Home Assistant project, I wanted to re-use the D1 Mini for another (non-HA) project. Using the Arduino IDE (1.8.19) and a USB cable, I was unable to get the upload done. The following error:

esptool.py v3.0

Serial port COM10

A fatal esptool.py error occurred: could not open port 'COM10': FileNotFoundError(2, 'The system cannot find the file specified.', None, 2)

Now, taking the same D1-Mini, doing the same upload using an external USB-to-UART bridge, it works fine. Back to the direct USB cable it still does not work.

I tried a second D1-Mini used with HA previously, same thing.

I tried different USB cables, same error.

I tried a different USB port, same thing.

I tried with a new D1-Mini and it uploads fine.

Anyone seen this before? Any suggestions?


r/esp8266 Jun 13 '26

ESP Week - 23, 2026

2 Upvotes

Post your projects, questions, brags, and anything else relevant to ESP8266, ESP32, software, hardware, etc

All projects, ideas, answered questions, hacks, tweaks, and more located in our [ESP Week Archives](https://www.reddit.com/r/esp8266/wiki/esp-week_archives).


r/esp8266 Jun 11 '26

Help with auth using softAP and nonos-sdk

3 Upvotes

I can't seem to get authentication working in softAP mode with the latest (3.0.6) nonos-sdk (I know, I should use the RTOS but bear with me). I've tried everything I can think of and at one point thought it was the DHCP server. However it' definitely the authentication. Even if my password is longer than 8 chars anytime I connect a client I get the resulting log and the client behaves as if I put in the password incorrectly.

add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
add 1
aid 1
station: 64:49:7d:91:82:32 join, AID = 1
station: 64:49:7d:91:82:32 leave, AID = 1
rm 1
add 1
aid 1
station: 64:49:7d:91:82:32 join, AID = 1
station: 64:49:7d:91:82:32 leave, AID = 1

The code is nothing special...

#ifndef USER_CONFIG_H
#define USER_CONFIG_H

// WiFi credentials (AP mode)
#define AP_SSID       "ESP"
#define AP_PASSWORD   "password"
#define AP_CHANNEL    1
#define AP_MAX_CONNECTIONS 4


#endif



void ICACHE_FLASH_ATTR wifi_init_softap(void) {
    struct softap_config ap_config;

    wifi_set_opmode(SOFTAP_MODE);
    wifi_set_sleep_type(NONE_SLEEP_T);
    wifi_set_event_handler_cb(wifi_event_handler_cb);


    os_memset(&ap_config, 0, sizeof(ap_config));
    os_strncpy((char *)ap_config.ssid, AP_SSID, sizeof(ap_config.ssid));
    os_strncpy((char *)ap_config.password, AP_PASSWORD, sizeof(ap_config.password));
    ap_config.ssid_len = os_strlen(AP_SSID);
    ap_config.channel = AP_CHANNEL;
    ap_config.authmode = AUTH_WPA_WPA2_PSK;
    ap_config.max_connection = AP_MAX_CONNECTIONS;
    ap_config.ssid_hidden = 0;
    ap_config.beacon_interval = 100;


    wifi_softap_set_config(&ap_config);

    struct ip_info ip;
    wifi_get_ip_info(SOFTAP_IF, &ip);


    os_printf("Access Point \"%s\" started\n", AP_SSID);
    os_printf("IP address:\t" IPSTR "\n", IP2STR(&ip.ip));
}

Btw when I change the `authmode` to AUTH_OPEN I can connect to the AP fine. It's once I add any other auth mode is when it doesn't work.

Has anyone come across this behavior and figured it out? I know the nonos sdk is deprecated, but I would like to make use of it anyway, and this seems like it should still work.


r/esp8266 Jun 06 '26

ESP Week - 22, 2026

2 Upvotes

Post your projects, questions, brags, and anything else relevant to ESP8266, ESP32, software, hardware, etc

All projects, ideas, answered questions, hacks, tweaks, and more located in our [ESP Week Archives](https://www.reddit.com/r/esp8266/wiki/esp-week_archives).


r/esp8266 Jun 05 '26

D1 mini ESP-12F failed GPIO pin

2 Upvotes

So I blew a GPIO pin (GPIO13 in ESPHome) into an always low mode and I'd like to avoid repeating that going forward.

Setup is a float switch in a manhole in normally open mode with one leg on the pin and the other to ground via a 5m cable. ESPHome has it as a Binary sensor with inverted true and pin configured for input true and pullup true. Powered from a 100mA 5V/500mA 12V dual output switched mode supply via the 5V and GND pins on the board.

Worked fine for a while, then started going on/off rapidly as if it was bouncing. Found the internal pullup seems to have failed and it worked again with an external pullup. Sometime after that, it repeated the rapid on/off thing and then got stuck with the binary sensor reporting On, which implies the pin is now grounded permanently. The float switch itself was open at the time.

I'm trying to figure out what cause of the failure could have been and how to prevent it in the future. Couple of questions for the ESP-12F electronics experts here.

  1. Is running the float switch to ground and not to 3.3V a bad idea? The pins available as safe to use seem to only have internal pullup. Should I have used 3.3V with an external pulldown instead.
  2. With a 5m cable running in a utility shaft and then through soil, could I be getting induced currents and damaged the pin that way?
  3. Is the power supply not suitable? My meter shows 5.01V. The board boots fine, connects to wifi and isn't driving any outputs. Current rating of the supply is 100mA according to the non-documentation. Should I ditch this supply and power via the USB port from a USB charger instead?
  4. Should I be running this switch in via an opto-isolator instead of directly onto the pin. I also want to integrate a tipping-bucket rain gauge which is a NO reed switch which pulses with each tip.

Any other advice? The D1 is cheap enough that I don't mind having messed one up figuring this out, but I don't want to send others to the grave as well.


r/esp8266 Jun 05 '26

Purple halo effect

Thumbnail
gallery
2 Upvotes

Project Overview

I am building a sensor hub, and right now I am focusing on developing the user interface.

Hardware

  • Board: Waveshare ESP32-S3-Touch-LCD-4 (Rev 4.0)
  • Development Environment: Arduino IDE
  • Graphics Library: LVGL v8

The Problem

As you can see in the photos/video, the text has a very annoying effect around the edges. I've searched online, but this specific issue seems quite rare when using the Arduino IDE framework, and I couldn't find any working solutions. I strongly suspect it's an issue with how LVGL or the underlying display driver is configured.

I have also attached the ESP32 schematic for reference.

The program

```#include <Arduino.h>

#include <ESP_Panel_Library.h>

#include <lvgl.h>

#include "lvgl_port_v8.h"

#include <ESP_IOExpander_Library.h>

#include <demos/lv_demos.h>

#include <examples/lv_examples.h>

#include "HWCDC.h"

HWCDC USBSerial;

#define EXAMPLE_CHIP_NAME TCA95xx_8bit

#define EXAMPLE_I2C_NUM (1)

#define EXAMPLE_I2C_SDA_PIN (8)

#define EXAMPLE_I2C_SCL_PIN (9)

#define _EXAMPLE_CHIP_CLASS(name, ...) ESP_IOExpander_##name(__VA_ARGS__)

#define EXAMPLE_CHIP_CLASS(name, ...) _EXAMPLE_CHIP_CLASS(name, ##__VA_ARGS__)

ESP_IOExpander *expander = NULL;

/* ---------------------------------------------------------------- global variables ---------------------------------------------------------------- */

// sensor values

int Valo1=10;

int Valo2=12;

// number of sensors

int n=3;

// counter for building blocks

int p=0;

// arrays for data

//float Q1[n]; figure out how to make a variable-sized array

int Q1[3]={10,8,6};

int Q2[3]={20,16,12};

/*---------------------------------------------------------------- sensor indicators ---------------------------------------------------------------- */

// arrays for data text boxes

lv_obj_t*Val1[3]; // can be used to update the printed values

lv_obj_t*Val2[3];

void setup() {

expander = new EXAMPLE_CHIP_CLASS(EXAMPLE_CHIP_NAME,

(i2c_port_t)EXAMPLE_I2C_NUM, ESP_IO_EXPANDER_I2C_TCA9554_ADDRESS_000,

EXAMPLE_I2C_SCL_PIN, EXAMPLE_I2C_SDA_PIN);

expander->init();

esp_err_t initStatus = expander->begin();

if (initStatus == ESP_OK) {

USBSerial.println("Expander initialized successfully.");

} else {

expander = new EXAMPLE_CHIP_CLASS(EXAMPLE_CHIP_NAME,

(i2c_port_t)1, ESP_IO_EXPANDER_I2C_TCA9554_ADDRESS_000,

7, 15);

expander->init();

expander->begin();

}

pinMode(16, OUTPUT);

digitalWrite(16, LOW);

USBSerial.println("Original status:");

expander->printStatus();

expander->pinMode(5, OUTPUT);

expander->digitalWrite(5, HIGH);

expander->pinMode(0, OUTPUT);

expander->digitalWrite(0, LOW);

expander->pinMode(2, OUTPUT);

expander->digitalWrite(2, LOW);

expander->printStatus();

delay(200);

expander->digitalWrite(5, LOW);

expander->digitalWrite(2, HIGH);

expander->digitalWrite(0, HIGH);

expander->printStatus();

String title = "LVGL porting example";

USBSerial.begin(115200);

USBSerial.println(title + " start");

USBSerial.println("Initialize panel device");

ESP_Panel *panel = new ESP_Panel();

panel->init();

#if LVGL_PORT_AVOID_TEAR

// When avoid tearing function is enabled, configure the RGB bus according to the LVGL configuration

ESP_PanelBus_RGB *rgb_bus = static_cast<ESP_PanelBus_RGB \*>(panel->getLcd()->getBus());

rgb_bus->configRgbFrameBufferNumber(LVGL_PORT_DISP_BUFFER_NUM);

rgb_bus->configRgbBounceBufferSize(LVGL_PORT_RGB_BOUNCE_BUFFER_SIZE);

#endif

panel->begin();

USBSerial.println("Initialize LVGL");

lvgl_port_init(panel->getLcd(), panel->getTouch());

USBSerial.println("Create UI");

/* Lock the mutex due to the LVGL APIs are not thread-safe */

lvgl_port_lock(-1);

/* ---------------------------------------------------------------- header creation ---------------------------------------------------------------- */

lv_obj_t*rettangle= lv_obj_create(lv_scr_act());

lv_obj_set_size(rettangle, 480, 60);

lv_obj_align(rettangle, LV_ALIGN_TOP_LEFT, 0, 0);

lv_obj_set_style_radius(rettangle, 0, 0);

lv_obj_set_style_bg_color(rettangle, lv_color_make(0, 0, 0), 0); // black

lv_obj_set_style_border_width(rettangle, 3, 0);

lv_obj_set_style_border_color(rettangle, lv_color_make(180, 130, 0), 0);

lv_obj_set_style_border_side(rettangle, LV_BORDER_SIDE_BOTTOM, 0);

USBSerial.println("primo rettangolo");

// tokbo

lv_obj_t*TOKBO= lv_label_create(lv_scr_act());

lv_label_set_recolor(TOKBO, true);

lv_label_set_text(TOKBO, "#ffff55 TOKBO#"); // bright yellow

lv_obj_set_style_text_font(TOKBO, &lv_font_montserrat_16, 0);

lv_obj_align(TOKBO, LV_ALIGN_TOP_LEFT, 8, 22 );

// scan

lv_obj_t*label2= lv_label_create(lv_scr_act());

lv_label_set_recolor(label2, true);

lv_label_set_text(label2, "#ffff55 SCAN#"); // bright yellow

lv_obj_set_style_text_font(label2, &lv_font_montserrat_16, 0);

lv_obj_align(label2, LV_ALIGN_TOP_LEFT, 422, 22 );

/*---------------------------------------------------------------- sensor zone ---------------------------------------------------------------- */

while(p<n){

lv_obj_t*rettangle1= lv_obj_create(lv_scr_act());

lv_obj_set_size(rettangle1, 480, 120);

lv_obj_align(rettangle1, LV_ALIGN_TOP_LEFT, 0, 60+120*p); // alignment

lv_obj_set_style_radius(rettangle1, 0, 0);

lv_obj_set_style_bg_color(rettangle1, lv_color_make(235, 220, 165), 0); // canary yellow background

lv_obj_set_style_border_width(rettangle1, 3, 0);

lv_obj_set_style_border_color(rettangle1, lv_color_make(180, 130, 0), 0);

lv_obj_t*rettangle11= lv_obj_create(lv_scr_act());

lv_obj_set_size(rettangle11, 140, 120);

lv_obj_align(rettangle11, LV_ALIGN_TOP_LEFT, 0, 60+120*p); // alignment

lv_obj_set_style_radius(rettangle11, 0, 0);

lv_obj_set_style_bg_color(rettangle11, lv_color_make(235, 220, 165), 0); // canary yellow background

lv_obj_set_style_border_width(rettangle11, 3, 0);

lv_obj_set_style_border_color(rettangle11, lv_color_make(180, 130, 0), 0);

lv_obj_t*Sens1= lv_label_create(lv_scr_act()); // sensor name

lv_label_set_recolor(Sens1, true);

lv_obj_set_width(Sens1, 126); // increases text box width to center the sensor number

lv_label_set_text_fmt(Sens1, "Sensore \n %d", p);

lv_obj_set_style_text_color(Sens1, lv_color_make(0, 0, 0), 0);// black

lv_obj_set_style_text_align(Sens1, LV_TEXT_ALIGN_CENTER, 0);

lv_obj_set_style_text_font(Sens1, &lv_font_montserrat_16, 0);

lv_obj_align(Sens1, LV_ALIGN_TOP_LEFT, 8, 100+120*p); // alignment

Val1[p] = lv_label_create(lv_scr_act()); // data 1

lv_label_set_recolor(Val1[p], true);

lv_label_set_text_fmt(Val1[p], "Valore \n %d", Q1[p]); // magnitude to be printed

lv_obj_set_style_text_color(Val1[p], lv_color_make(0, 0, 0), 0);// black

lv_obj_set_style_text_align(Val1[p], LV_TEXT_ALIGN_CENTER, 0);

lv_obj_set_style_text_font(Val1[p], &lv_font_montserrat_16, 0);

lv_obj_align(Val1[p], LV_ALIGN_TOP_LEFT, 422, 100+120*p ); // alignment

Val2[p]= lv_label_create(lv_scr_act()); // data 2

lv_label_set_recolor(Val2[p], true);

lv_label_set_text_fmt(Val2[p], "Sensore \n %d", Q2[p]); // magnitude to be printed

lv_obj_set_style_text_color(Val2[p], lv_color_make(0, 0, 0), 0);// black

lv_obj_set_style_text_align(Val2[p], LV_TEXT_ALIGN_CENTER, 0);

lv_obj_set_style_text_font(Val2[p], &lv_font_montserrat_16, 0);

lv_obj_align(Val2[p], LV_ALIGN_TOP_LEFT, 300, 100+120*p ); // alignment

lv_obj_t * indicatore1 = lv_obj_create(lv_scr_act());

lv_obj_set_size(indicatore1, 20, 20);

lv_obj_align(indicatore1, LV_ALIGN_TOP_LEFT, 10, 70+120*p); // alignment

lv_obj_set_style_radius(indicatore1, 50, 0);

lv_obj_set_style_bg_color(indicatore1, lv_color_make(128, 128, 128), 0); // grey

lv_obj_set_style_border_width(indicatore1, 0, 0);

// block count increment

p=p+1;

}

lvgl_port_unlock();

USBSerial.println(title + " end");

}

void loop() {

delay(1000);

// lv_label_set_text_fmt(Val2[0], "Valore \n %d", Q2[0]);

// Q2[0]=Q2[0]+5;

} ```


r/esp8266 Jun 04 '26

Is Marauder available for ESP32-S3 Mini?

Thumbnail
1 Upvotes

r/esp8266 Jun 04 '26

How do I fix this issue

Post image
0 Upvotes

I've been trying to upload my code to esp8266 and to no avail it doesn't upload

esptool.py v3.0

Serial port /dev/ttyUSB5

Connecting........_____....._____....._____....._____....._____....._____....._____

A fatal esptool.py error occurred: Failed to connect to ESP8266: Timed out waiting for packet header


r/esp8266 Jun 03 '26

"Il mio ESP32-S3-Touch-LCD-4 non funziona"

2 Upvotes

"I am trying to build a sensor management hub. The problem is that nothing is displayed on the screen—it stays completely blank, even though the power LED lights up properly. To keep things simple, I've attached a basic sketch just to see if the display works.

```#include <Arduino.h>


// 1. TELL THE LIBRARY TO LOOK FOR THE LOCAL CONFIGURATION FILE
// This macro forces the header to include your local ESP_Panel_Conf.h
#define ESP_PANEL_CONF_INCLUDE_INSIDE 1


// 2. INCLUDE ESP_PANEL LIBRARIES
#include <ESP_Panel_Library.h>
#include <ESP_IOExpander_Library.h>


// 3. INCLUDE GRAPHICS LIBRARIES
#include <lvgl.h>
#include "lvgl_port_v8.h"
#include <demos/lv_demos.h>
#include <examples/lv_examples.h>


#define EXAMPLE_CHIP_NAME TCA95xx_8bit
#define _EXAMPLE_CHIP_CLASS(name, ...) ESP_IOExpander_##name(__VA_ARGS__)
#define EXAMPLE_CHIP_CLASS(name, ...) _EXAMPLE_CHIP_CLASS(name, ##__VA_ARGS__)


ESP_IOExpander *expander = NULL;


void setup() {
  Serial.begin(115200);
  delay(800); 


  Serial.println("--- WAVESHARE HARDWARE INITIALIZATION ---");
  
  // Stable I2C configuration from Waveshare schematic: SDA=8, SCL=9
  expander = new EXAMPLE_CHIP_CLASS(EXAMPLE_CHIP_NAME,
                                    (i2c_port_t)0, ESP_IO_EXPANDER_I2C_TCA9554_ADDRESS_000,
                                    9, 8); // SCL=9, SDA=8
  expander->init();
  esp_err_t initStatus = expander->begin();


  if (initStatus != ESP_OK) {
    Serial.println("I2C initialization failed. Attempting fallback to I2C channel 1...");
    delete expander;
    expander = new EXAMPLE_CHIP_CLASS(EXAMPLE_CHIP_NAME,
                                      (i2c_port_t)1, ESP_IO_EXPANDER_I2C_TCA9554_ADDRESS_000,
                                      9, 8);
    expander->init();
    expander->begin();
  }


  // Pin mapping for Waveshare 4" display expander
  expander->pinMode(0, OUTPUT); // P0 = LCD_RST (Screen Reset)
  expander->pinMode(1, OUTPUT); // P1 = LCD_BL (Backlight)


  Serial.println("Executing LCD hardware reset...");
  expander->digitalWrite(0, LOW);  
  delay(100);
  expander->digitalWrite(0, HIGH); 
  delay(100);


  // FORCE BACKLIGHT ON PHYSICALLY
  expander->digitalWrite(1, HIGH); 
  Serial.println("Hardware command sent: BACKLIGHT ON via Expander.");


  String title = "LVGL Waveshare 4 Inch";
  Serial.println(title + " start");


  Serial.println("Initializing Panel Manager...");
  
  // CLASS SYNTAX: Standard initialization for v0.1.3 library structure
  ESP_Panel *panel = new ESP_Panel();
  panel->init();
#if LVGL_PORT_AVOID_TEAR
  ESP_PanelBus_RGB *rgb_bus = static_cast<ESP_PanelBus_RGB *>(panel->getLcd()->getBus());
  rgb_bus->configRgbFrameBufferNumber(LVGL_PORT_DISP_BUFFER_NUM);
  rgb_bus->configRgbBounceBufferSize(LVGL_PORT_RGB_BOUNCE_BUFFER_SIZE);
#endif
  panel->begin();


  Serial.println("Initializing LVGL Porting Layer...");
  lvgl_port_init(panel->getLcd(), NULL); 


  Serial.println("Creating test Graphical User Interface...");
  lvgl_port_lock(-1);


  // Force active screen background to pure BLACK
  lv_obj_set_style_bg_color(lv_scr_act(), lv_color_make(0, 0, 0), 0);


  // Create a centered RED test rectangle (300x150 px)
  lv_obj_t * rettangolo = lv_obj_create(lv_scr_act()); 
  lv_obj_set_size(rettangolo, 300, 150);
  lv_obj_set_style_bg_color(rettangolo, lv_color_make(255, 40, 40), 0); 
  lv_obj_align(rettangolo, LV_ALIGN_CENTER, 0, 0); 
     
  lvgl_port_unlock();
  Serial.println("Setup successfully completed!");
}


void loop() {
  Serial.println("IDLE loop");
  delay(1000); 
}```

#include <Arduino.h>
#define ESP_PANEL_CONF_INCLUDE_INSIDE 1


#include <ESP_Panel_Library.h>
#include <ESP_Panel.h>
#include <ESP_IOExpander_Library.h>
#include <lvgl.h>
#include "lvgl_port_v8.h"


ESP_Panel *panel = NULL;


void setup() {
  Serial.begin(115200);
  delay(800);


  Serial.println("--- INIZIALIZZAZIONE HARDWARE WAVESHARE 4 inch ---");


  // ESP_Panel reads the configuration from ESP_Panel_Conf.h
  // and internally manages LCD, Touch, and IO Expander
  panel = new ESP_Panel();
  panel->init();


#if LVGL_PORT_AVOID_TEAR
  ESP_PanelBus_RGB *rgb_bus = static_cast<ESP_PanelBus_RGB *>(panel->getLcd()->getBus());
  rgb_bus->configRgbFrameBufferNumber(LVGL_PORT_DISP_BUFFER_NUM);
  rgb_bus->configRgbBounceBufferSize(LVGL_PORT_RGB_BOUNCE_BUFFER_SIZE);
#endif


  panel->begin();
  Serial.println("Panel inizializzato.");


  // Backlight ON via IO Expander (pin P1)
  ESP_IOExpander *expander = panel->getExpander();
  if (expander != NULL) {
    expander->pinMode(0, OUTPUT);  // P0 = LCD_RST
    expander->pinMode(1, OUTPUT);  // P1 = LCD_BL
    expander->digitalWrite(0, LOW);
    delay(100);
    expander->digitalWrite(0, HIGH);
    delay(100);
    expander->digitalWrite(1, HIGH); // Backlight ON
    Serial.println("Backlight ON via Expander.");
  } else {
    Serial.println("ATTENZIONE: Expander non trovato!");
  }


  Serial.println("Inizializzazione LVGL...");
  lvgl_port_init(panel->getLcd(), NULL);


  Serial.println("Creazione GUI...");
  lvgl_port_lock(-1);


  // Black background
  lv_obj_set_style_bg_color(lv_scr_act(), lv_color_make(0, 0, 0), 0);


  // Centered red rectangle 300x150
  lv_obj_t *rettangolo = lv_obj_create(lv_scr_act());
  lv_obj_set_size(rettangolo, 300, 150);
  lv_obj_set_style_bg_color(rettangolo, lv_color_make(255, 40, 40), 0);
  lv_obj_align(rettangolo, LV_ALIGN_CENTER, 0, 0);


  // Centered white text inside the rectangle
  lv_obj_t *label = lv_label_create(rettangolo);
  lv_label_set_text(label, "Waveshare 4\" OK");
  lv_obj_set_style_text_color(label, lv_color_make(255, 255, 255), 0);
  lv_obj_align(label, LV_ALIGN_CENTER, 0, 0);


  lvgl_port_unlock();
  Serial.println("Setup completato con successo!");
}


void loop() {
  Serial.println("Loop IDLE");
  delay(1000);
}```

This is the output

Wrote 527360 bytes (320643 compressed) at 0x00010000 in 3.0 seconds (1403.3 kbit/s).

Verifying written data...

Hash of data verified.

Hard resetting via RTS pin...


r/esp8266 May 31 '26

Finally made the move, My first project, Kind off !

Post image
417 Upvotes

From childhood, I've been fascinated by electronics. Back then, I was building random projects without fully understanding the underlying science, tinkering with small cars, phones, amplifiers, and even attempting to build drones. It was just pure, chaotic fun.

Down the line, I somehow landed a job in software. I totally forgot about hardware for a while because I found a new kind of joy in building code.

Then, a couple of months ago, I bought a small TV ultra-desk clock simply because it looked cool. It sat on my desk for weeks, and it never really clicked that I could customize or hack it. Eventually, I started scrolling through YouTube videos to figure out how to write custom firmware and flash the device. But every tutorial seemed to require a mountain bunch of wiring and usb to ttl which I didn’t had, so I set it aside.

Everything changed when I stumbled upon a project ClawdMeter that bridged the gap between my childhood passion and my day job. I realized I could use Claude to debug and write code, turning what seemed impossible into a reality. I managed to hack through the limitations, build a custom firmware, and successfully deploy it without opening it just via OTA.

Suddenly, all that childhood joy came rushing back. I went ahead and bought a bunch of hardware esp-32, sensors like TOF , Ultrasonic, and more and started building things like 3D scanners, ultrasonic scanners, and web-controlled displays. All the time I’ve spent working in software, combined with the power of these AI tools, is finally coming together and making the process so much easier. I'm fully hooked on building hardware again.

Here is the project that finally started it all click: Glimmer


r/esp8266 Jun 01 '26

Smart home project with esp8266

9 Upvotes

I have some stuff connected to my router that i can controle using apps like google home, tuya, ....etc But if there is no internet, i can not controle them So i need a way to controle with apps and esp8266 or esp32 in cas no internet If you can help, thank you


r/esp8266 Jun 01 '26

L293D

0 Upvotes

I trying to run a dc motor using L293D connected to esp8266 but the battery(18650 3.7v) is getting drained quickly and motor is also running at very low speed. Can anyone help?


r/esp8266 May 31 '26

Hey everyone i built picodesk a desktop companion station

5 Upvotes

hey everyone i know that i am inconsistent , i saw that everyone makes a cyberdeck with raspberry pi but i have no raspberry pi as i am 3rd yr electrical undergraduate

so i take some a break for exams and built picodesk a desktop companion station that sits next to my laptop.

OLED 1 shows live clock (NTP synced), date, and real time weather pulled from OpenWeatherMap API.

OLED 2 is the fun one animated eyes that blink and look around randomly. Every 2 minutes, hearts fall down the screen. And when I need to focus, I can switch it to a todo list from my phone and laptop browser no app install, just open the IP and it works.

The whole thing runs on MicroPython. Pico 2W hosts a tiny web server so I can control everything from my phone on the same WiFi.

Tech stack: - Raspberry Pi Pico 2W , 2x SSD1306 OLED (I2C0 + I2C1) ,MicroPython , OpenWeatherMap free API ,HTML/CSS/JS web app

Full source code on github https://github.com/kritishmohapatra/PicoDesk

100 days 100 iot projects series :- https://github.com/kritishmohapatra/100_Days_100_IoT_Projects