Git Product home page Git Product logo

esp8266-wifi-light-dimmer's People

Contributors

theb-1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

esp8266-wifi-light-dimmer's Issues

Timer does not work for ESP8266 Arduino Core layer than 2.4.1

Dear,

Unfortunately the board keeps rebooting if using ESP8266 Arduino cores later than version 2.4.1. I have found out this is related to the timer and interruption, but still did not figured out why. If anybody could help with this, it would be much appreciated.

Regards,

Luciano

220V 50Hz Reboot Issue

I am using your code for 220V 50Hz but esp8266 resets any time, I tried to change hw_timer_arm(dimDelay); value by hit and trial but of no use , can you please help me to calculate it for 50Hz. Best Regards.

Picture of the board

Do you have the picture of the board? I'm having difficult to built the board. Do you have some video working too? Thanks

reconnect to MQTT

hey,
once the MQTT server goes down due to electricity fault for example i need to reset completely the esp8266,
is it possible to add a reconnect function ?

thank you :)

Hardware Timer interrupts OTA updates

Hello, I found this problem. My code depends upon Hardware Timer and now when I decided to add OTA functionality, I found out that it interrupts with OTA update. Reference - ayushsharma82/ElegantOTA#66 .
I'm using the hw_timer.h in my code and want to solve this issue. It'll be great if anyone can help me.

NMI Timer

I implemented a dimmer based on the NMI timer, but I got a point:

In 'stand by', the NMI timer handle the interrupt repeatedly by intervals precisally of 1.677.722 uS (or ~1,67 s). This automatically interrupt can be disabled or changed the time interval?

When I implemented the NMI timer I got a delay on the turn ON and OFF, and studying the code I saw it happens because the change of state is handled by the "dimTimerISR" and not by the "zcDetectISR". To solve that I changed my code to this:

void dimTimerISR() {

  if (curBrightness < 255 && curBrightness > 0) { { // to prevent unexpected pulses every 1,67s
    digitalWrite(outPin, HIGH);
    delayMicroseconds(20);
    digitalWrite(outPin, LOW);
  }
  
}

void zcDetectISR() {

  if (zcState == 0) {
    zcState = 1;

    if (curBrightness < 255 && curBrightness > 0) {

      int dimDelay = 30 * (255 - curBrightness) + 400;
      hw_timer_arm(dimDelay);

    }

    if (fade == 1) {
      if (curBrightness > tarBrightness || (state == 0 && curBrightness > 0)) {
        curBrightness -= 1;
      }
      else if (curBrightness < tarBrightness && state == 1 && curBrightness < 255) {
        curBrightness += 1;
      }
    }
    else {
      if (state == 1) {
        curBrightness = tarBrightness;
      }
      else {
        curBrightness = 0;
      }
    }

    if (curBrightness == 0) {
      state = 0;
      digitalWrite(outPin, 0);
    }
    else if (curBrightness == 255) {
      state = 1;
      digitalWrite(outPin, 1);
    }

    zcState = 0;
  }
}

I actually dont know if it is OK use the 'delayMicroseconds(20);' inside the NMI handler. And I can't think a better algorithm to get the dimmer working without the delay to power ON and OFF. Any ideas or comments?

LED Light Bulb

hey, i must ask, what i takes to dim a LED light bulb?
will this solution work?
are there any specific LED Light bulbe that will work?
thank you

Configuration (brightness value) not getting saved after sending command via HTTP

After connecting my AC Dimmer with wemos mini I am unable to save the configuration via HTTP GET command. I tried using this: 192.168.0.x/?b=0
This makes the output voltage to drop and then it rises again and when I open the page 192.168.0.x to check the configuration it shows b=255. Which means it is not getting saved. Any ideas?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.