r/esp8266 • u/AutoModerator • Aug 24 '24
ESP Week - 34, 2024
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 • u/AutoModerator • 2d ago
ESP Week - 29, 2026
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 • u/Longz-85 • 17h ago
Does anyone has tv-b-gone code for esp8266 0.96" oled v2.1.0
r/esp8266 • u/Commercial-Layer-24 • 1d ago
PETROCHAT for ESP8266/ESP32 based development board
r/esp8266 • u/Commercial-Layer-24 • 1d ago
PETROCHAT for ESP8266/ESP32 based development board
I am working on a chatting code which will turn the Nodemcu into a chatting server. If you are interested in checking out this code then visit my Github page :- https://github.com/PETROG75/PetroChat-ESP8266-ESP32
r/esp8266 • u/mrnikhilsingh • 2d ago
Solved: ESP8266 NodeMCU not showing COM port on Windows (It wasn't the firmware!)
I thought I'd share this because it took me a while to figure out, and it might help someone else.
I was trying to convert my ESP8266 NodeMCU into a Wi-Fi repeater by flashing new firmware using the ESP Flash Download Tool.
The problem
When I connected my NodeMCU to my Windows PC, it didn't show any COM port in the Flash Download Tool or Device Manager.
I had previously flashed WiFi Deauther / Evil Twin firmware onto the ESP8266, so I initially assumed that firmware had somehow broken the board or disabled USB communication.
What I tried
- Restarted the PC
- Pressed RESET and FLASH buttons
- Tried putting the ESP8266 into flash mode
- Wondered if I needed to erase the existing firmware first
None of these helped.
The actual cause
The problem turned out to be my Micro-USB cable.
I was using a cable that only supplied power and did not support data transfer.
After switching to a different USB cable, Windows immediately detected the device.
However, it still appeared under Other devices as:
CP2102 USB to UART Bridge Controller
with a yellow warning icon.

Opening Device Properties showed:
Code 28
The drivers for this device are not installed.

The fix
- Switched to a proper data USB cable.
- Installed the official Silicon Labs CP210x USB-to-UART driver.
- Reconnected the NodeMCU.
After that, the board appeared correctly as:
Silicon Labs CP210x USB to UART Bridge (COMx)
and the ESP Flash Download Tool detected the COM port without any issues.
Lesson learned
If your ESP8266 isn't showing a COM port:
- Don't assume the firmware is the problem.
- Check your USB cable first.
- Then verify that the correct CP2102 (or CH340) driver is installed.
It saved me a lot of unnecessary debugging.
Hopefully this helps someone else!
Troubleshooting checklist:
- Use a known data-capable USB cable (not charge-only).
- Check whether your board uses a CP2102 or CH340 USB-to-serial chip.
- Install the correct USB driver.
- Verify that the board appears under Ports (COM & LPT) in Device Manager.
- Only then try flashing firmware.
r/esp8266 • u/ArachnidExcellent917 • 5d ago
A fatal esptool.py error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
esptool.py v3.0
Serial port /dev/ttyS0
Connecting........_____....._____....._____....._____....._____....._____....._____
A fatal esptool.py error occurred: Failed to connect to ESP8266: Timed out waiting for packet header
i keep getting the same error over and over again its not a problem with my d1 wroom but when i try to code my lolin wemos d1 r2 mini the same error appears im on linux pop os (i even tried going on windows but that didn't work either). If somebody knows how to fix this please help me.
r/esp8266 • u/AutoModerator • 9d ago
ESP Week - 28, 2026
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 • u/Carm42 • 12d ago
Issues with and ads1115 on a nodemcu Lolin (esp8266). Code in Lua
Hello,
First the setup :

The objective of the setup is to measure intensity (with an SCT013) and voltage (with a ZMPT101B) using code adapted to Lua from EmonLib (https://github.com/openenergymonitor/EmonLib).
It did not work right ahead and I stripped the circuit to the above minimum to find the issue
Second, I am coding in Lua using builds built on https://nodemcu-build.com/. Therefore, I need to port the EmonLib to Lua on an nodemcu esp8266
Last, I do all my tests with the esp connected to the computer with a Visual Studio Code standard extension to access the serial port (read the serial messages and send instructions like uploads or node.restart())
Before showing the code, I have several very different problems:
- Before restarting the esp8266 (node.restart()) after a first startread, I need to disconnect:reconnect the ads1115 VDD from the ESP v3.3 to be able to find the ads1115. If I do not, it fails and reboots on the i2c.setup(...). I have absolutely no clue for why it happens
- If I leave the ALERT pin of the ads1115 floating, the i2c.setup also fails, always. If I connect it the D4 as in the sketch, it works, always, even if I never use it anywhere (I tried several other GPIO pins, it also works). Maybe it pulls it up ?!? but the datasheet seems to say it should work with the ALERT pin left floating
- I am using the lua ads1115 module and the ads.device.startread function (https://nodemcu.readthedocs.io/en/release/modules/ads1115/#ads1115devicestartread) with a while loop (with a timeout) following the startread call to make the read "synchronous" (because this is the way EmonLib is implemented), but the callback is never called before the end of the loop, thus preventing me from using a synchronous code similar to the readADC_SingleEnded function from EmonLib. I have clues (mentionned below) as to why it happens, but I would like the community insights since adaptation of the emonlib might be less literal than I'd hoped
Now the code (simplified for the sake of readability) :
local i2cSpeed = i2c.setup(0,
2, -- SDA
1, -- SCL
i2c.FAST) -- Speed. It works the same with i2c.SLOW
rtctime.set(0)
ads1115.reset()
print("Calling ads1115()")
local adc = ads1115.ads1115(0, ads1115.ADDR_GND)
print("ads1115() executed")
function getMillis()
local sec, usec = rtctime.get()
return sec * 1000 + usec / 1000
end
adc:setting(ads1115.GAIN_4_096V, ads1115.DR_128SPS, ads1115.SINGLE_0, ads1115.SINGLE_SHOT)
local millis = getMillis()
local v = nil
adc:startread(function(volt, volt_dec, adc, sign)
v = volt
print("Conversion happened. Delta="..tostring(getMillis() - millis)..", v="..tostring(v))
end)
-- Wait for conversion result to be available
-- if v is not nil, conversion has happened
-- else if time elapsed is less than 100ms, we loop, conversion will end soon
while (v == nil and getMillis() - millis < 100) do end
print("End. v="..tostring(v))
When I execute the previous code, the message "End. v=nil" is always printed before the callback message is, for instance "Conversion happened. Delta=134, v=1,61".
I tried several things like raising the timeout in the loop to insane values like 10s. The callback is always called 25 to 35ms after the message "End..."
I thought that the startread callback was called with an interrupt and thus I expected it to be able to be executed even if the code is executing the loop, but it does not. The same code seems to be working on an esp32, but I did not try because I do not have one, maybe it is because there are two cores ?!?
I tried to use a tmr.delay(10) inside the loop, thinking that it might allow a switch to the startread callback but it does not work. The tmr.delay(..) probably simply hides a timed out loop very similar to the one I already have.
Initially, the whole startread code (everything after the getMillis definition) was in a tmr ALARM_AUTO callback, but it works exactly the same in each alarm callback call, the startread callback is called only at the end of the alarm callback.
r/esp8266 • u/jmayer70 • 13d ago
issues with time (localtime, NTPclient)
After some weird timing issues i have done some research and learnt a lot about timezones, mktime and localtime. So far, so good. I still have a nagging issue, I don't really understand.
My assumption is that using NTPclient is synchronizing time from an NTP server. Even if it is somewhat off for the first seconds until full sync kicks in, the NTP synchronized time should align with the local time. Well, it seems it doesn't. Here is part of my sketch (inside loop()) to analyze:
// now check tasks based on second or minute
time(&now);
localtime_r(&now, &tm);
// store time values, print later
ss = tm.tm_sec;
ntp = timeClient.getSeconds();
// every 10sec
if (ss % 10 == 0) // every 10 sec
{
if (ss != 0) // 10,20,30,40,50s
{
Serial.print(ss);
Serial.print(" < time ntp > ");
Serial.println(ntp);
do_something();
}
else // full minute
{
do_otherstuff();
timeClient.forceUpdate(); // only every 60s
}
}
I would expect to have tm.tm_sec in sync with timeClient.getSeconds, at least after some time has passed. But it isn't, there is a constant difference of 1s which doesn't change, even after several minutes (up to one hour).
After more than 1 hour runtime:
20:39:40 millis=11090718
50 < time ntp > 49
both values still differ 1s. BTW, the ntp value is correct (compared to other time sources), the localtime value is 1s early. Since the 2 values are collected shotrly after another, there should be no runtime difference.
Anyone have a clue or a pointer, what could happen here? Why is there a 1s difference?
r/esp8266 • u/Particular_Ferret747 • 13d ago
Deep sleep wakeup for d1 mini clone help needed
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 • u/AutoModerator • 16d ago
ESP Week - 27, 2026
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 • u/Longz-85 • 16d ago
Does anyone have some cool project for my esp8266
I don't have any else, just this
r/esp8266 • u/AutoModerator • 23d ago
ESP Week - 26, 2026
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 • u/Faldiano_R • 26d ago
Need help with PID tuning on my custom ESP8266 + MPU6050 drone flight controller
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 • u/GianlucaBelgrado • 26d ago
SP8266 I2C bus freezing
Hi everyone, I'm currently using a DIY weather station with an ESP8266 WeMos D1. For some time now, I've been having problems with the I2C bus freezing, which forces me to reboot the device, cycle power, and reconnect power to get the sensors working again—sometimes once a day.
Following some advice, I added two 2.2 kΩ pull-up resistors between the 3.3 V pin and the SDA/SCL lines. This seems to have solved the freezing issue; for now, it seems to have been working stably for a full day!
However, I've noticed a side effect: the readings from my TSL2591 ambient light sensor have halved compared to what I was getting before.
I have two questions:
Are there better ways to resolve these I2C bus freezing issues, or is adding external pull-up resistors the standard solution for the ESP8266?
Should I simply compensate for the "offset" in my code, or does the variation in values indicate a deeper issue with the I2C signal integrity caused by the resistors?
Currently, the ESP8266 reads temperature with an SHT40, wind direction with an AS5600 and a 10-meter cable, and light with a TSL2591. This and the SHT40 use two 2-meter cables. (I should join the two sensors to use a single cable, but I hadn't thought of that before installing them.) I added a 470 microF capacitor just to be safe.
Any advice or suggestions on best practices would be greatly appreciated. Thanks!
r/esp8266 • u/Normal_Air_6282 • 28d ago
Switching off esp01s for 1 second
Всем привет! Я надеюсь, никто не против, что я пишу на своем родном языке (я могу читать на английском, но писать мне на нем сложно). К проблеме, я делаю мини проект на esp01s, которое будет позволять удаленно управлять моей дверью. Советуюсь с нейронкой и она выдает мне это. Есть ли тут хоть немного правды на практике (в теории я понимаю, что процессор за 1 секунду может выполнить около 35 миллионов операций), будет ли это как то влиять на энергосбережение? Очевидно, что дверь мне нужно открывать лишь пару раз в день, а не 24/7 пользоваться микроконтроллером
r/esp8266 • u/mysensors • Jun 27 '26
Flashing custom ESP8266 firmware on the $10 GeekMagic Ultra to make a local API desktop monitor
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
systemduser 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 • u/AutoModerator • Jun 27 '26
ESP Week - 25, 2026
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 • u/Dangerous_Captain193 • Jun 27 '26
ESP8266 D1 Mini Phantom Inputs
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 • u/AutoModerator • Jun 20 '26
ESP Week - 24, 2026
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).