ESP8266 mini sends SMS when door opens

แชร์
ฝัง

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

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

    Thanks Viktor for the time you spent on this project. I got it working in the end but I had to use "esp8266 by esp8266 community v.2.4.2" the exact version you've used. Version 3.x did not work but perhaps I have to give it a go again as there were few minor typos that I had to deal with after that. Will update this in due course. Let me know what later version(s) you've tried since. I am sure you moved on and do some other funky stuff, but hey...Thanks once again.

    • @ViktorKjartansson
      @ViktorKjartansson  2 ปีที่แล้ว

      You're welcome Ibrahim - have to make more videos 🙂

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

    Thank you so much Sir Viktor.
    One question. How to use that PLIVO??How do i get the code for that??Again,thank you so much!

  • @MaxGoddur
    @MaxGoddur 5 ปีที่แล้ว

    Is there a method for sending an SMS text message without using third-party websites as in IFTTT or the one you used. Would like to keep the message sent and received within the LAN.

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

    Hi sir. So we can use normal esp8266 for this project, right?

  • @junaidhkv4153
    @junaidhkv4153 3 ปีที่แล้ว

    Can you give the magnetic switch
    Product link for buy

  • @miratechsolutions5777
    @miratechsolutions5777 4 ปีที่แล้ว

    What was the total cost at the end (prices sum of of all elemennts)?

  • @anandkeskar6338
    @anandkeskar6338 3 ปีที่แล้ว

    Thank you so much 😊

  • @michaelcarroll4832
    @michaelcarroll4832 2 ปีที่แล้ว

    Hi Viktor; What is the name of the USB cable to the ESP 8266 called? Where can I purchase it? Thanks;Mike

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

      Hi, its called micro usb cable like here
      www.amazon.com/XIAE-Braided-Charging-Aluminum-More-Black/dp/B088GVSFWZ/ref=sr_1_3?crid=C02G6TONBCI8&dchild=1&keywords=micro+usb+cable&qid=1620957998&sprefix=micro+usb%2Caps%2C243&sr=8-3

    • @michaelcarroll4832
      @michaelcarroll4832 2 ปีที่แล้ว

      @@ViktorKjartansson Thank you for your reply. I appreciate your response and your video.

    • @michaelcarroll4832
      @michaelcarroll4832 2 ปีที่แล้ว

      @@ViktorKjartansson Do you have videos on the ESP32? What manufacture (Please send a link) do you recommend for development and what you have used ? There are so many cb out there. !! Do you prefer the ESP 8266 or ESP 32?
      Thanks again for your responses. !! :)

    • @ViktorKjartansson
      @ViktorKjartansson  2 ปีที่แล้ว

      @@michaelcarroll4832 Hi, the ESP32 is little more powerful so i would recommend it

  • @ericrandall3539
    @ericrandall3539 3 ปีที่แล้ว

    Just some helpful advice - many people watch TH-cam on their phones. You can’t read a thing because your text is SO small. The screen is over half who’re space with some microscopic text. Zoom to what you’re doing.

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

    Hi, possible to use this to get notification when garage door is open?

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

    I'm a novice, well, I really have no clue on how to build what I want. Was wondering if you could give me some advice or even help me build this little project, if possible. I'd be more than happy to pay you for your time. I'm looking to build a very small or very slim wireless/ wifi window sensor. The smallest possible that's activated by a very small magnet. I need the activation to send a signal straight to my cell phone through my home router (without having to manipulate the settings on my router). I can download "homeassistant" or "mylife" or run a small simple phone app. The intent here is not to adjust any setting on my router. I'd like to get at least 75 - 150ft signal to my router. I have a 3d printer and can make a housing for the battery and board...just wondering if this is possible? Any advice would be much appreciated. Thank you for your help.

    • @ViktorKjartansson
      @ViktorKjartansson  3 ปีที่แล้ว

      If you buy these two very small things:
      SonOff bridge: www.banggood.com/SONOFF-ZBBridge-Smart-Zigbee3_0-Bridge-with-4-SNZB-Sensors-APP-Wireless-Remote-Controller-Smart-Home-Bridge-Work-with-Alexa-Google-Home-Voice-Control-p-1730291.html?rmmds=search&cur_warehouse=CN
      and
      SonOff window detector: www.banggood.com/SONOFF-DW2-Wi-Fi-Wireless-Door-or-Window-Sensor-No-Gateway-Required-Support-to-Check-History-Record-on-APP-p-1674773.html?rmmds=detail-left-hotproducts__4&cur_warehouse=CN
      And install the eWeLink app you get push notifications any time window is open/closed.

    • @raymerritt788
      @raymerritt788 3 ปีที่แล้ว

      Ty Victor. But I want the device to send the signal straight to home router......not Alexa....not googke asstant....straight to my router then to my cell through an app. Also, needs to be smaller than a match box and thin as possible. Great suggestion though..ty

    • @ViktorKjartansson
      @ViktorKjartansson  3 ปีที่แล้ว

      @@raymerritt788 Yes, the bridge is connected directly to your router via WIFI and the app is ready eWeLink

  • @xfarsys
    @xfarsys 5 ปีที่แล้ว +2

    you should check 10:48 and, thanks for the video

  • @Animace
    @Animace 4 ปีที่แล้ว

    Hello, I have used your approach; however, I get 400 Bad Request answer from PLIVO. Do you have an idea what might be wrong? Can you help me out, please?

    • @ViktorKjartansson
      @ViktorKjartansson  4 ปีที่แล้ว

      Hi, you have to use https not http when you send to PLIVO

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

    Thanks for sharing such an Awesome project. Can you please share the code for the same.
    Awaiting your earliest response.

    • @ViktorKjartansson
      @ViktorKjartansson  3 ปีที่แล้ว +4

      Hi, here is the code: OpenDetector.ino
      #include
      #include
      #include "credentials.h"
      int switchRead=D1;
      bool hasSentMessage = false;
      void setup() {
      Serial.begin(115200);
      pinMode(LED_BUILTIN, OUTPUT);
      pinMode(switchRead, INPUT_PULLUP);
      connectWifi();
      }
      void loop() {
      if (digitalRead(switchRead) == HIGH) {
      digitalWrite(LED_BUILTIN, LOW);
      Serial.println("Door Open");
      if (!hasSentMessage) {
      sendMessage();
      }
      } else {
      Serial.println("Door Closed");
      hasSentMessage = false;
      }
      digitalWrite(LED_BUILTIN, HIGH);
      delay(1000);
      }
      void connectWifi() {
      WiFi.mode(WIFI_STA);
      WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
      Serial.println("connecting");
      while (WiFi.status() != WL_CONNECTED) {
      Serial.print(".");
      delay(500);
      }
      Serial.print("connected: ");
      Serial.println(WiFi.localIP());
      digitalWrite(LED_BUILTIN, HIGH);
      }
      void sendMessage() {
      Serial.println("sendMessage");
      HTTPClient http;
      http.begin(String("api.plivo.com/v1/Account/") + AUTH_ID + String("/Message/"), FINGERPRINT);
      http.addHeader("Content-Type", "application/json");
      http.addHeader("Authorization", "Basic " + AUTH_TOKEN);
      String postMessage = String("{\"src\":\"") + FROM_TELEPHONE + String("\",\"dst\":\"") + TO_TELEPHONE + String("\",\"text\":\"Main door is OPEN!\"}");
      Serial.println(postMessage);
      auto httpCode = http.POST(postMessage);
      if (httpCode < 0) {
      Serial.printf("POST failed, error: %s
      ", http.errorToString(httpCode).c_str());
      }
      Serial.println(httpCode);
      http.writeToStream(&Serial);
      http.end();
      hasSentMessage = true;
      }

    • @jamesbrown2163
      @jamesbrown2163 3 ปีที่แล้ว

      @@ViktorKjartansson Thanks Viktor, you're a good man.

  • @WMCLComputers
    @WMCLComputers 5 ปีที่แล้ว

    @
    Viktor Kjartansson There is in the second line an #include that is never shown in the tutorial who do we get that file or code?

  • @stevenoltay
    @stevenoltay 3 ปีที่แล้ว

    Why have you not shared the code?....

  • @Dark-uh6sc
    @Dark-uh6sc 2 ปีที่แล้ว

    SMS?

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

    Just the project im looking for, could you please share the code. Thankx.

  • @paulcowley3786
    @paulcowley3786 3 ปีที่แล้ว

    sorry Viktor, i see no code,please help. Thankx

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

    In India where should I get this bro.

    • @ViktorKjartansson
      @ViktorKjartansson  5 ปีที่แล้ว

      I ordered everything from China: www.banggood.com

  • @SergioPendola
    @SergioPendola 3 ปีที่แล้ว

    Sketch, program?

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

      1 year late but
      #include
      #include
      #include "credentials.h"
      int switchRead=D1;
      bool hasSentMessage = false;
      void setup() {
      Serial.begin(115200);
      pinMode(LED_BUILTIN, OUTPUT);
      pinMode(switchRead, INPUT_PULLUP);
      connectWifi();
      }
      void loop() {
      if (digitalRead(switchRead) == HIGH) {
      digitalWrite(LED_BUILTIN, LOW);
      Serial.println("Door Open");
      if (!hasSentMessage) {
      sendMessage();
      }
      } else {
      Serial.println("Door Closed");
      hasSentMessage = false;
      }
      digitalWrite(LED_BUILTIN, HIGH);
      delay(1000);
      }
      void connectWifi() {
      WiFi.mode(WIFI_STA);
      WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
      Serial.println("connecting");
      while (WiFi.status() != WL_CONNECTED) {
      Serial.print(".");
      delay(500);
      }
      Serial.print("connected: ");
      Serial.println(WiFi.localIP());
      digitalWrite(LED_BUILTIN, HIGH);
      }
      void sendMessage() {
      Serial.println("sendMessage");
      HTTPClient http;
      http.begin(String("api.plivo.com/v1/Account/") + AUTH_ID + String("/Message/"), FINGERPRINT);
      http.addHeader("Content-Type", "application/json");
      http.addHeader("Authorization", "Basic " + AUTH_TOKEN);
      String postMessage = String("{\"src\":\"") + FROM_TELEPHONE + String("\",\"dst\":\"") + TO_TELEPHONE + String("\",\"text\":\"Main door is OPEN!\"}");
      Serial.println(postMessage);
      auto httpCode = http.POST(postMessage);
      if (httpCode < 0) {
      Serial.printf("POST failed, error: %s
      ", http.errorToString(httpCode).c_str());
      }
      Serial.println(httpCode);
      http.writeToStream(&Serial);
      http.end();
      hasSentMessage = true;
      }

  • @root8able
    @root8able 3 ปีที่แล้ว

    why do you need a breadboard? can't you connect it directly?

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

    Is the code available somewhere? Thanks.

    • @ViktorKjartansson
      @ViktorKjartansson  3 ปีที่แล้ว

      Yes, here in comments

    • @arniep740
      @arniep740 3 ปีที่แล้ว

      @@ViktorKjartansson I don't see your code anywhere in the comments. Do you have a link to it?

  • @ViktorKjartansson
    @ViktorKjartansson  4 ปีที่แล้ว +3

    Hi, here is the code: OpenDetector.ino
    #include
    #include
    #include "credentials.h"
    int switchRead=D1;
    bool hasSentMessage = false;
    void setup() {
    Serial.begin(115200);
    pinMode(LED_BUILTIN, OUTPUT);
    pinMode(switchRead, INPUT_PULLUP);
    connectWifi();
    }
    void loop() {
    if (digitalRead(switchRead) == HIGH) {
    digitalWrite(LED_BUILTIN, LOW);
    Serial.println("Door Open");
    if (!hasSentMessage) {
    sendMessage();
    }
    } else {
    Serial.println("Door Closed");
    hasSentMessage = false;
    }
    digitalWrite(LED_BUILTIN, HIGH);
    delay(1000);
    }
    void connectWifi() {
    WiFi.mode(WIFI_STA);
    WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
    Serial.println("connecting");
    while (WiFi.status() != WL_CONNECTED) {
    Serial.print(".");
    delay(500);
    }
    Serial.print("connected: ");
    Serial.println(WiFi.localIP());
    digitalWrite(LED_BUILTIN, HIGH);
    }
    void sendMessage() {
    Serial.println("sendMessage");
    HTTPClient http;
    http.begin(String("api.plivo.com/v1/Account/") + AUTH_ID + String("/Message/"), FINGERPRINT);
    http.addHeader("Content-Type", "application/json");
    http.addHeader("Authorization", "Basic " + AUTH_TOKEN);
    String postMessage = String("{\"src\":\"") + FROM_TELEPHONE + String("\",\"dst\":\"") + TO_TELEPHONE + String("\",\"text\":\"Main door is OPEN!\"}");
    Serial.println(postMessage);
    auto httpCode = http.POST(postMessage);
    if (httpCode < 0) {
    Serial.printf("POST failed, error: %s
    ", http.errorToString(httpCode).c_str());
    }
    Serial.println(httpCode);
    http.writeToStream(&Serial);
    http.end();
    hasSentMessage = true;
    }

  • @nguyenchuong986
    @nguyenchuong986 3 ปีที่แล้ว

    can it work with ESP32 Camera??

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

    Has anyone developed a simple add on current sensor that detects current flow in the door bell wires when the doorbell button is pressed. When it senses the current it will send either a email or text message. Sort of a poor man DIY Ring Door bell for those that already have a camera looking at their front door.

    • @ViktorKjartansson
      @ViktorKjartansson  3 ปีที่แล้ว

      Yes, now you can buy such buttons and put them instead of your doorbell - then they send (via zigbee or RF) signal to main station which can then send the signal to MQTT server which anybody can listen too - then you get the signal you can send sms/email/push or do what you want.
      www.banggood.com/5pcs-SONOFF-SNZB-01-ZB-Wireless-Switch-Mini-Size-Link-ZB-Bridge-with-WiFi-Devices-Make-Them-Smarter-via-eWeLink-APP-IFTTT-p-1741713.html?rmmds=search&cur_warehouse=CN

    • @n1kkri
      @n1kkri 3 ปีที่แล้ว

      @@ViktorKjartansson What's the total cost to do this project with ZB Bridge (I have no experience with this) vs. buying a Ring 3 currently selling for $139 sale ? I was hoping for a simpler approach. Add device to doorbell chime with connection either using a small current probe onto one of the wires, or small reed switch placed near the chime solenoid or other method. The device connects to my wifi and sends either email or text without requiring any additional fees.

    • @n1kkri
      @n1kkri 3 ปีที่แล้ว

      @@ViktorKjartansson I was looking for a product already built and cheap. Current probe goes on a wire and when it senses a change in current flow it will send a text message. Not something to replace doorbell button.

    • @n1kkri
      @n1kkri 3 ปีที่แล้ว

      @@ViktorKjartansson I am not familar with ZB devices but I believe they rely on additional hardware to send text message. I am looking for a simple stand alone device.

    • @n1kkri
      @n1kkri 3 ปีที่แล้ว

      I just tried following your steps to load the software for adruino. I don't have a board yet but thought I could learn
      how you load in a file into the program to look at it. I got lost at 7:16 (Open Detector) where do I find that?

  • @ahmedayachi2036
    @ahmedayachi2036 4 ปีที่แล้ว +2

    Thanks for this video, the code please :)

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

    where is the code?

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

      2 years later but
      #include
      #include
      #include "credentials.h"
      int switchRead=D1;
      bool hasSentMessage = false;
      void setup() {
      Serial.begin(115200);
      pinMode(LED_BUILTIN, OUTPUT);
      pinMode(switchRead, INPUT_PULLUP);
      connectWifi();
      }
      void loop() {
      if (digitalRead(switchRead) == HIGH) {
      digitalWrite(LED_BUILTIN, LOW);
      Serial.println("Door Open");
      if (!hasSentMessage) {
      sendMessage();
      }
      } else {
      Serial.println("Door Closed");
      hasSentMessage = false;
      }
      digitalWrite(LED_BUILTIN, HIGH);
      delay(1000);
      }
      void connectWifi() {
      WiFi.mode(WIFI_STA);
      WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
      Serial.println("connecting");
      while (WiFi.status() != WL_CONNECTED) {
      Serial.print(".");
      delay(500);
      }
      Serial.print("connected: ");
      Serial.println(WiFi.localIP());
      digitalWrite(LED_BUILTIN, HIGH);
      }
      void sendMessage() {
      Serial.println("sendMessage");
      HTTPClient http;
      http.begin(String("api.plivo.com/v1/Account/") + AUTH_ID + String("/Message/"), FINGERPRINT);
      http.addHeader("Content-Type", "application/json");
      http.addHeader("Authorization", "Basic " + AUTH_TOKEN);
      String postMessage = String("{\"src\":\"") + FROM_TELEPHONE + String("\",\"dst\":\"") + TO_TELEPHONE + String("\",\"text\":\"Main door is OPEN!\"}");
      Serial.println(postMessage);
      auto httpCode = http.POST(postMessage);
      if (httpCode < 0) {
      Serial.printf("POST failed, error: %s
      ", http.errorToString(httpCode).c_str());
      }
      Serial.println(httpCode);
      http.writeToStream(&Serial);
      http.end();
      hasSentMessage = true;
      }

  • @kochunkit6871
    @kochunkit6871 2 ปีที่แล้ว

    Can you give me code?

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

      #include
      #include
      #include "credentials.h"
      int switchRead=D1;
      bool hasSentMessage = false;
      void setup() {
      Serial.begin(115200);
      pinMode(LED_BUILTIN, OUTPUT);
      pinMode(switchRead, INPUT_PULLUP);
      connectWifi();
      }
      void loop() {
      if (digitalRead(switchRead) == HIGH) {
      digitalWrite(LED_BUILTIN, LOW);
      Serial.println("Door Open");
      if (!hasSentMessage) {
      sendMessage();
      }
      } else {
      Serial.println("Door Closed");
      hasSentMessage = false;
      }
      digitalWrite(LED_BUILTIN, HIGH);
      delay(1000);
      }
      void connectWifi() {
      WiFi.mode(WIFI_STA);
      WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
      Serial.println("connecting");
      while (WiFi.status() != WL_CONNECTED) {
      Serial.print(".");
      delay(500);
      }
      Serial.print("connected: ");
      Serial.println(WiFi.localIP());
      digitalWrite(LED_BUILTIN, HIGH);
      }
      void sendMessage() {
      Serial.println("sendMessage");
      HTTPClient http;
      http.begin(String("api.plivo.com/v1/Account/") + AUTH_ID + String("/Message/"), FINGERPRINT);
      http.addHeader("Content-Type", "application/json");
      http.addHeader("Authorization", "Basic " + AUTH_TOKEN);
      String postMessage = String("{\"src\":\"") + FROM_TELEPHONE + String("\",\"dst\":\"") + TO_TELEPHONE + String("\",\"text\":\"Main door is OPEN!\"}");
      Serial.println(postMessage);
      auto httpCode = http.POST(postMessage);
      if (httpCode < 0) {
      Serial.printf("POST failed, error: %s
      ", http.errorToString(httpCode).c_str());
      }
      Serial.println(httpCode);
      http.writeToStream(&Serial);
      http.end();
      hasSentMessage = true;
      }

  • @brfilmservice91
    @brfilmservice91 5 ปีที่แล้ว

    sniðugt..

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

    I'm sorry but where is this code posted?
    At the beginning of your video you post where to buy everything but I do not see a reference to the code anywhere.
    If I missed that part of the video then I apologize in advance.
    Also, I would recommend NOT putting your hand in the way of your object of discussion, it's distracting.
    Great video otherwise.

    • @ViktorKjartansson
      @ViktorKjartansson  4 ปีที่แล้ว

      Thanks for your comment - I agree hands are borgin :-)

  • @Dark-uh6sc
    @Dark-uh6sc 2 ปีที่แล้ว

    Cod?

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

      6 months late but
      #include
      #include
      #include "credentials.h"
      int switchRead=D1;
      bool hasSentMessage = false;
      void setup() {
      Serial.begin(115200);
      pinMode(LED_BUILTIN, OUTPUT);
      pinMode(switchRead, INPUT_PULLUP);
      connectWifi();
      }
      void loop() {
      if (digitalRead(switchRead) == HIGH) {
      digitalWrite(LED_BUILTIN, LOW);
      Serial.println("Door Open");
      if (!hasSentMessage) {
      sendMessage();
      }
      } else {
      Serial.println("Door Closed");
      hasSentMessage = false;
      }
      digitalWrite(LED_BUILTIN, HIGH);
      delay(1000);
      }
      void connectWifi() {
      WiFi.mode(WIFI_STA);
      WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
      Serial.println("connecting");
      while (WiFi.status() != WL_CONNECTED) {
      Serial.print(".");
      delay(500);
      }
      Serial.print("connected: ");
      Serial.println(WiFi.localIP());
      digitalWrite(LED_BUILTIN, HIGH);
      }
      void sendMessage() {
      Serial.println("sendMessage");
      HTTPClient http;
      http.begin(String("api.plivo.com/v1/Account/") + AUTH_ID + String("/Message/"), FINGERPRINT);
      http.addHeader("Content-Type", "application/json");
      http.addHeader("Authorization", "Basic " + AUTH_TOKEN);
      String postMessage = String("{\"src\":\"") + FROM_TELEPHONE + String("\",\"dst\":\"") + TO_TELEPHONE + String("\",\"text\":\"Main door is OPEN!\"}");
      Serial.println(postMessage);
      auto httpCode = http.POST(postMessage);
      if (httpCode < 0) {
      Serial.printf("POST failed, error: %s
      ", http.errorToString(httpCode).c_str());
      }
      Serial.println(httpCode);
      http.writeToStream(&Serial);
      http.end();
      hasSentMessage = true;
      }

  • @ViktorKjartansson
    @ViktorKjartansson  4 ปีที่แล้ว

    And here is the credentials.h - you must put your credentials here
    #define WIFI_SSID "YourWIFIName"
    #define WIFI_PASSWORD "YourWIFIPassword"
    #define AUTH_ID String("MAZ123456789012345OT")
    #define AUTH_ID_TOKEN String("MWZlNzI3Y2Qx1234567891234567892MDcx");
    #define AUTH_TOKEN String("TUFaMTIzNDU2Nzg5MDEyMzQ1T1Q6TVdabE56STNZMlF4MTIzNDU2Nzg5MTIzNDU2Nzg5Mk1EY3g=")
    #define FROM_TELEPHONE String("+12019999999")
    #define TO_TELEPHONE String("+4791999999")
    #define FINGERPRINT String("11:68:5A:34:9A:28:0D:91:9E:CC:8F:99:59:0A:D4:4A:FF:C5:50:6A")

  • @MrBobWareham
    @MrBobWareham 3 ปีที่แล้ว

    Sounds like you are so bored with what you are doing so disinterested