Control ESP-01 relay module from browser, 09/27/2022

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 ก.ย. 2022
  • Control ESP-01 relay module from web browser, 09/27/2020
    ESP8266 NodeMCU Relay Module - Control AC Appliances (Web Server)
    - randomnerdtutorials.com/esp82...
    ESP01/01S RELAY MODULE TUTORIAL
    - www.instructables.com/ESP0101...
    Example sketch on Google Drive:
    - drive.google.com/file/d/1AgGK...
    ------------------------------
    Background music:
    Anywhere - Nico Anuch
    ------------------------------
    Track: Anywhere - Nico Anuch [Audio Library Release]
    Music provided by Audio Library Plus
    Watch: • Anywhere - Nico Anuch ...
    Free Download / Stream: alplus.io/anywhere
    ------------------------------

ความคิดเห็น • 29

  • @rubikcube4646
    @rubikcube4646 4 หลายเดือนก่อน

    Hello, I want to ask whether I can control this ESP-01 module using another network and in a place far from the ESP-01 module at home which is connected to WiFi.

  • @Power_UP_PK
    @Power_UP_PK 7 หลายเดือนก่อน

    Compilation error: 'D3' was not declared in this scope.
    Please guide

  • @dacianfd8418
    @dacianfd8418 ปีที่แล้ว

    Can you add webserver code for 4 relay
    ?

  • @DEVLOKS
    @DEVLOKS ปีที่แล้ว +1

    Thanks forked fine
    it will not work with 4g and 5g wifi so try to use old hotspot (or wifi)
    but Thanks man

  • @amateamchannel3687
    @amateamchannel3687 ปีที่แล้ว

    When suddenly the electric power supply goes out and at that time the status of the relay module is ON. Then the electric power supply turns ON again, does the status of the relay module remain ON?

    • @cyberello
      @cyberello  ปีที่แล้ว +1

      No, the relay will start with the default value. In this case it is off.
      You can set the default to on if you like too. Just replace the relay setting in the setup() with digitalWrite(Relay1, HIGH);
      It its possible to persist the state of the relay. But it require to write the relay state to EEPROM. I use it with the regular ESP8266. I've tried with the ESP-01, but have not succeed. I guest there might be no EEPROM or the read-write is different method.

    • @amateamchannel3687
      @amateamchannel3687 ปีที่แล้ว

      @@cyberello Thank you for updating the information about the differences between ESP8266 and ESP-01. (For the ESP-01) Is it possible to add a simple backup power (rechargeable battery) to maintain the last state? Possible with 3 volt LIR2032 (CR2032) coin button battery

    • @cyberello
      @cyberello  ปีที่แล้ว +1

      Yes, I think it is possible to use the back up battery. But I never tried it before.

  • @georgiosentani4930
    @georgiosentani4930 ปีที่แล้ว

    Need add button at GPIO4 for manually switching

    • @cyberello
      @cyberello  ปีที่แล้ว

      GPIO4 is Pin# 4 or D2
      In the sketch I use D3 for Relay1 in line# 12. If you need more Pin or change to GPIO4 you can do it there.
      int Relay1 = D2; // For replace with GPIO4 or
      int Relay1 = D3;
      int Relay2 = D2; // For adding GPIO4
      Then set up the Relay for output.
      If you need another button on the page you can add it in the BUTTONPLACEHOLDER section. 😊

    • @georgiosentani4930
      @georgiosentani4930 ปีที่แล้ว

      @@cyberello You did not understand. I wanted to add a physical button to control directly in case of network failure.

    • @cyberello
      @cyberello  ปีที่แล้ว

      Oh, sorry about that.
      In this case you will need to set buttons for input as:
      int button = D2; // For adding GPIO4
      Then in setup():
      pinMode(button, INPUT);
      Then add button reading in loop()
      int buttonPush = digitalRead(button);
      if (buttonPush == 1) { // This will set trigger On/Off value for relay
      digitalWrite(Relay1, !digitalRead(Relay1));
      digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
      }
      I did not test this sketch yet. It should work fine. If not please let me know. 😊
      More information from this video:
      th-cam.com/video/Af0nZ6xYnIE/w-d-xo.html

  • @EmilM000
    @EmilM000 ปีที่แล้ว

    how to shutdown AP??

    • @cyberello
      @cyberello  ปีที่แล้ว +1

      What do you mean by AP? WiFi access point? In that case, the module is a WiFi client not acting like access point. So, you will need to know the module IP address.
      The module is running it's own tiny internal web server. Then you can control it using web browser and open the IP address of the module.
      Is it the anwser you are looking for?

  • @ScottSavageTechnoScavenger
    @ScottSavageTechnoScavenger ปีที่แล้ว

    Nice vid.
    Using Arduino IDE 2.0 I see. How do you like it?

    • @cyberello
      @cyberello  ปีที่แล้ว

      Thank you very much.
      I like it. The UI is more modernized and improve the flow of the development process. Especially selecting board and connections.
      Also the integration of the serial output log window is easy to use.
      I hope you will like it too. 😂

  • @marlonjaheraldanaperez4244
    @marlonjaheraldanaperez4244 ปีที่แล้ว

    D1 or D3 does not work, shows error 😥

  • @GersonDev
    @GersonDev ปีที่แล้ว

    I can turn on a light bulb remotely, I can turn on a light bulb from my house, from my work

  • @samfred_robotics
    @samfred_robotics ปีที่แล้ว

    The code did not work

    • @cyberello
      @cyberello  ปีที่แล้ว

      Let me help. Please tell me more about the error you have or how you do.
      There are some possibility that the code might not work for your environment. First guest is the WiFi connection. Then the IP is change some how.
      I use it on every lights and fans in my house. We can fix it. 😊

    • @samfred_robotics
      @samfred_robotics ปีที่แล้ว

      @@cyberello I uploaded the code successfully but the serial monitor did not show the IP address

    • @samfred_robotics
      @samfred_robotics ปีที่แล้ว

      @@cyberello I will be so glad if you can help out

    • @cyberello
      @cyberello  ปีที่แล้ว

      I think the problem is the WiFi connection.
      Please make sure that you connect it to 2.4G WiFi not 5G.
      Then please check the line# 6 and 7.
      You need to use your WiFi name and password. In my case I change it to
      6 #define STASSID "cyberello_wifi"
      7 #define STAPSK "cyberello_password"
      You can also check the line 184 to 187. It will stuck in this loop in case there is no WiFi connection.
      I hope this might help. 😊

    • @samfred_robotics
      @samfred_robotics ปีที่แล้ว

      @@cyberello change the name but the WiFi is not showing on my phone
      Thanks for your time I will try some other methods too