No video

How To: Pick the right pins on the NodeMCU ESP8266 and ESP32

ESP8266 NodeMCU Pin Diagram: github.com/the...
ESP32 NodeMCU Pin Diagram: github.com/the...
The ESP32 Pins Outputting a PWM signal at startup that had duty cycles low enough that they didn't trigger the relay were: P14, P5, P0, P15, P8, P7, and P6.
Buy an ESP8266 NodeMCU: amzn.to/2K0hgjS
Buy an ESP32 NodeMCU: amzn.to/2JVgEvx
*As an Amazon Associate I earn a % of qualifying purchases at no cost to you.*
Support my channel:
Patreon: / thehookup
Tesla Refferal Code: www.tesla.com/...
Music by www.BenSound.com

Пікірлер: 147

  • @teddyruxpin3811
    @teddyruxpin38112 жыл бұрын

    I JUST SPENT 9 HOURS DEBUGGING MY CODE TRYING TO FIGURE OUT WHY MY NODEMCU WOULD NOT BOOT IF MY TOGGLE SWITCH WAS IN THE OFF POSITION. AAAAAAAHHHHHRRRGGGGGG! THANK YOU Mr. TheHookUp!!!!!

  • @1dolar1note1
    @1dolar1note16 жыл бұрын

    This video could've saved me an entire week around one month ago. But still I highly appreciate finding this video, very useful.

  • @jonjingleheimerschmidt5153
    @jonjingleheimerschmidt51532 жыл бұрын

    "I troubleshooted my code." "I troubleshot my code" is probably more accurate but it still a word I NEVER hear anyone use. I find both words to be so awkward that I usually say "I did some troubleshooting" or "after troobleshooting" which also have the advantage of being active voice. Thanks for the video and for indulging me in the thoughts I think at 6 a.m. before drinking coffee. :)

  • @jonjingleheimerschmidt5153

    @jonjingleheimerschmidt5153

    2 жыл бұрын

    "D1 pin mode inPIT" :) This video is useful as useful can possibly be and the trivial errors make it human and personable.

  • @NERDfirst
    @NERDfirst6 жыл бұрын

    Thank you so much for this! I was using a WeMos D1 and was considering doing the same as well because of the occasional unexpected behavior on certain pins. Your diagrams will come very much in handy!

  • @jonjingleheimerschmidt5153
    @jonjingleheimerschmidt51532 жыл бұрын

    This video gets a "OMG, So helpful!" rating. Even as a visually impaired person I can actually read the chart clearly. Oh-so-thank-you-thank-you-thank-you.

  • @AzaB2C
    @AzaB2C4 жыл бұрын

    Nice. Appreciate the clear concise info. Troubleshooting and figuring out ESP8266 pin usage caveats/quirks via trial and error at 1am without this info/insight wasn't fun. Cheers!

  • @Gocast2
    @Gocast23 жыл бұрын

    This is so handy. I've been thinking my bunch of 8266's could handle a lot of outputs, but now I realize I need a esp32.

  • @tackleit
    @tackleit6 жыл бұрын

    Thanks .. I was observing the same results when i used certain GPIOs with ESP8266 and concluded GPIO2 was the worst to work with relays .. Thanks again for all the hard work you put in figuring everything out .

  • @KP-nc9gk
    @KP-nc9gk6 жыл бұрын

    Wow! This explains a lot why I am having weird behavior on my project. My lights suddenly blinking on and off for a short period. Now I know! Thanks!

  • @2Ustfu
    @2Ustfu6 жыл бұрын

    Excellent video...absolutely did not know that not all pins are created equal.

  • @markmacherey4744
    @markmacherey47446 жыл бұрын

    I ran into the same issue while putting a D1 mini in one of my fish feeders, every time it rebooted it would fire and feed the fish... Vary frustrating, spent days trouble shooting.. Wasn't easy finding the answer. Thanks for the video this should help a lot of people.

  • @michaelthelen5297

    @michaelthelen5297

    4 жыл бұрын

    Oh man, a fish feeder... Thats is a great idea!

  • @JesusGamayon
    @JesusGamayon6 жыл бұрын

    Thank you Rob, you saved me a lot of troubleshooting time! Looking forward for more of your videos!

  • @sameerk12982
    @sameerk129823 жыл бұрын

    Hello from India.... Thank you very much for this easy to understand and very helpful video with valuable information.

  • @poornamith
    @poornamith5 жыл бұрын

    wow. That was a one great explanation video. No wonder why my NodeMCU project was irritating as hell without knowing all these GPIO issues. Thanks a lot mate. You deserve more subs than this. :D

  • @car5on777
    @car5on7775 жыл бұрын

    This was exactly what I was looking for. Sadly there just isn't much documentation on this board. I appreciate the tedious testing you've done for us!!

  • @allersvp
    @allersvp4 жыл бұрын

    as my usual with you, i hit LIKE first THEN i watch the video.. my trusted remote friend :) .. i learned alot from u 4m scratch .. now i am doing great :) .. still learning from u as well.

  • @imranebrahim4839
    @imranebrahim48395 жыл бұрын

    This is very informative and will be a great help to me as I get frustrated when I try to run a code and it does not work , I end up just giving up on the project. Thanks

  • @bq4069
    @bq4069 Жыл бұрын

    Thank you, the effort / time, you put into this. Saved me a lot.

  • @williammiller4143
    @williammiller41436 жыл бұрын

    Thank you! The issue you mentioned of certain pins briefly going high was a huge problem for me in implementing a garage door opener. I did not realize it was only some pins so for a while I gave up. I got around the problem with high reliability using a Sonoff “inching module”. The description is found below. For a little over five bucks I believe this is a great solution. It has two modes, one of witch is momentary relay activation via an external button. It can relay messages via MQTT and integrates nicely with Home Assistant. I got off subject a bit but again, a geat video. Thanks! Channel Inching /Self-Locking WiFi Wireless Switch 5V 12V Model: IM160722001.

  • @randycouch2816
    @randycouch28166 жыл бұрын

    Thanks Rob. And thank you for all your time you put into helping us.

  • @rafac13
    @rafac135 жыл бұрын

    Life saver! Thank you for taking the time and effort to do the tests and making the video! 👍👍👍

  • @NahYeahMate
    @NahYeahMate6 жыл бұрын

    While I really love all your videos, can't help but get a bit disappointed every time I see your new video isn't the one you promised a long time ago about how to make the external voice activated roller shades 😉

  • @TheHookUp

    @TheHookUp

    6 жыл бұрын

    It's coming, I'm trying to wait for youtube to approve my monetization. I ended up spending $100 buying parts to make the shades for the video so I'd like to at least break even. I passed the threshold for monetization about 1.5 months ago, but I guess they are pretty backed up with approving them.

  • @NahYeahMate

    @NahYeahMate

    6 жыл бұрын

    The Hook Up that sucks. So you're pretty much getting nothing from your recent videos? Tha shades video will be a hit

  • @TheHookUp

    @TheHookUp

    6 жыл бұрын

    Yeah, I'm not anywhere close to making positive money, ha. That's okay, I'm mostly doing this for fun.

  • @NahYeahMate

    @NahYeahMate

    6 жыл бұрын

    The Hook Up and your helping many many people learn this steeeep learning curve of home automation arena 😁 Keep up the great work and thank you!

  • @NahYeahMate

    @NahYeahMate

    6 жыл бұрын

    By the way, I'd also like to see if you have any ideas on how to make them run on battery pack with recharge capibilty. Or better yet, battery pack connected with solar panel

  • @AJSquirrel53
    @AJSquirrel533 жыл бұрын

    Wow, thank you so much for this! Who would've known! I'm sure you will save me and others many frustrating hours of testing

  • @GregSvoboda
    @GregSvoboda5 жыл бұрын

    Thumbs up if you've watch this video 100x's... one for every time you're about to start a new project.

  • @TheHookUp

    @TheHookUp

    5 жыл бұрын

    I'm embarrassed to say that at least 50 of the views on this video are me double checking my memory.

  • @MeisterQ
    @MeisterQ4 жыл бұрын

    I know this Video is older but: "undocumented node-mcus" yeah... Thats why i started creating custom PCBs for all of my Projects. But even there i had alot of misstakes using wrong pins (ESP866 and ESP32). But after studing the datasheets and recommendations from espressif how to do a basic wiring and pullup/pulldown of special pins, i got it. I think you wont do any failures anymore, if you made a custom PCB with one of this ESPs and basic schematics and parts. Projects will look nicer and more professional also. I made a custom pcb for that rollershades DIY project. I threw away the PCB which came with the 5V Stepper Motor and created my own layout with integrated ESP-12 and ULN2003 Driver. Its looking so good (To bad i cant attach a picture here)

  • @TheHookUp

    @TheHookUp

    4 жыл бұрын

    I agree custom PCBs are cool, but for prototyping NodeMCUs are still king. I've been working on a few custom PCBs as well, would you mind sharing your gerber file with me? smarthomehookup@gmail.com

  • @MeisterQ

    @MeisterQ

    4 жыл бұрын

    @@TheHookUp sure I will. I could also share the whole project (in easyeda) if you need.

  • @polclota
    @polclota6 жыл бұрын

    Good approach, I was planning to do the same and voilà...here you are! Thanks!

  • @fadyatef5399
    @fadyatef5399 Жыл бұрын

    this video is very very helpful. continue the great work

  • @whitefields5595
    @whitefields55953 жыл бұрын

    I wish I had found you 6 hours ago ............ Subscribed

  • @HedroomMax
    @HedroomMax3 жыл бұрын

    Thanks dude!! You saved me a lot of time. Greets from Argentina!

  • @romycruz4498
    @romycruz44983 жыл бұрын

    Big thank you Bro'. This is a BIG BIG help to newbies like me. This is a LOT of help not to confuse my already confused brain. Huhhh, where are those boards I threw away? !

  • @gratefulamateur1393
    @gratefulamateur13936 ай бұрын

    Now you tell me! 😉 Thanks for a really great video!

  • @andrewloughran5812
    @andrewloughran58126 жыл бұрын

    Great to know before starting a NodeMCU project

  • @markferrick10
    @markferrick106 жыл бұрын

    Thanks Rob. Very useful video.

  • @r1chmk
    @r1chmk2 жыл бұрын

    Thanks for this! Great reference

  • @Str33tfalcon
    @Str33tfalcon3 жыл бұрын

    Great Video!! Short and informative. I like!!

  • @ToniLopezMM
    @ToniLopezMM6 жыл бұрын

    thanks very much for taking the time to do this video. i'm already subscribe.😃 to your channel.

  • @FilmFactry
    @FilmFactry5 жыл бұрын

    Just subscribed. Very clear excellent info!!!

  • @juanstivenmunozgarcia4716
    @juanstivenmunozgarcia47165 жыл бұрын

    Thank you so much. You are great continue do it please

  • @garymcleanuk
    @garymcleanuk5 жыл бұрын

    I had the same issue and drove me mad for a few hours. The boot mode can change on 8266 depending on 3 specific pins being high or low

  • @emil92056
    @emil920566 жыл бұрын

    Thanks for this video, it will be a go to for me in the future

  • @ukshaandumasia1446
    @ukshaandumasia14469 күн бұрын

    life saver thank you

  • @RoeyBenAmotz
    @RoeyBenAmotz6 жыл бұрын

    Thank you. Just what I was looking for

  • @ddhruvarora
    @ddhruvarora9 ай бұрын

    helpful indeed!!

  • @gsax1
    @gsax1 Жыл бұрын

    Great work. Wish I knew about this a few months ago. What about GPIO13 on the ESP32? I did not see any reference on your diagram. It seems to drive a servo ok.

  • @pioneer5555
    @pioneer55555 жыл бұрын

    Thanks so much for this. I couldn't figure out why my nodemcu wasn't booting!! I was grounding D3 :|

  • @pioneer5555

    @pioneer5555

    5 жыл бұрын

    D2 doesnt like being an INPUT_PULLUP either

  • @renesolaire8319
    @renesolaire83193 жыл бұрын

    Thank you very MUCH ! just starting using ESP8266 and it did 1/ reset with watchdog 2/ not responding to the GPIOS .Why they did this ? I Had ideas maybe have a trick with the pins and took a look at youtube !!! found D8 on the board, usual nice pin on arduino, then I was playing with it declaring as digital 8 in the soft !!!

  • @techbymo
    @techbymoАй бұрын

    Thank you so much 🙏

  • @lontongtepungroti2777
    @lontongtepungroti27774 жыл бұрын

    Thank you so much sir! so helpfull

  • @MaheshDodke
    @MaheshDodke5 жыл бұрын

    Thank You So Much for the info !!

  • @ady8077
    @ady80775 жыл бұрын

    Great info, but how often would a nodemcu reboot, I was planning on using 1 to monitor my alarm panel, but need 5 inputs and 1 output

  • @TheHookUp

    @TheHookUp

    5 жыл бұрын

    Theoretically it doesn't need to reboot ever, but it depends on the Wi-Fi strength and power supply consistency. A node mcu can handle 5 inputs and one output easily.

  • @ady8077

    @ady8077

    5 жыл бұрын

    @@TheHookUp Thanks, so if I was to use D1,2,5,6 and 7 as the inputs, D8 would be ok to output to a relay as long as it doesn't get pulled high ?

  • @cybrhckr
    @cybrhckr4 жыл бұрын

    At least pins "5 6 7" are all running high if they are not put in pinmode with specific code for esp8266. which was the best cork I got with a mux switch.

  • @muratozturk2134
    @muratozturk2134 Жыл бұрын

    that's great, thank you so much.

  • @pannipahansen3702
    @pannipahansen37026 жыл бұрын

    Request. You had asked for requests for future videos. My Home assistant somehow finds my Kidde Smoke Alarms and also a Kidde CO detector. The devices are interconnected and when one is turned on they will all respond, further Kidde suggests a weekly test. If you click on them they show status unknown. It would be nice to run a weekly test (say Saturday at noon) and capture this status.

  • @TheHookUp

    @TheHookUp

    6 жыл бұрын

    That's interesting, do you know what model of kidde smoke alarms they are?

  • @DRWriggs
    @DRWriggs2 жыл бұрын

    Thank you for making this video! It is incredibly helpful. Is any modification required to use GPIO9 and GPIO10 on the ESP8266. I have seen elsewhere that these pins should not be used.

  • @maxr382
    @maxr3823 жыл бұрын

    Thanks You!!!!!! This helps!

  • @MrNams
    @MrNams2 жыл бұрын

    Can't we use D0 as input,i used and found that,initially it was high as i made it input pull up, when i made it low by momentary switch, it remained low? It took lot of time to find this bug. Please explain about this.

  • @zakariajawas
    @zakariajawas3 жыл бұрын

    Thank you, very helpful

  • @johnbrianalmazan6522
    @johnbrianalmazan65224 ай бұрын

    1:55 how do you install the definitions file for NodeMCU ESP8266 in Arduino IDE?

  • @ampedandvolted
    @ampedandvolted4 жыл бұрын

    well, this is a great video. thank you

  • @datrandomdugggy5537
    @datrandomdugggy55373 жыл бұрын

    i wrote this code for the 8266 void setup() { // put your setup code here, to run once: pinMode(5, OUTPUT); } void loop() { // put your main code here, to run repeatedly: digitalWrite(5, LOW); } but when i than hook up a led to to pin 5 nothing absolutely nothing happens any ideas?

  • @kiranghatge4301
    @kiranghatge43012 жыл бұрын

    Hello, Can you please help to guide me for project call pick to light with the help of esp ,,,,,, I wa9to user esp and addressable led to identify the rack location

  • @curtcarpenter2677
    @curtcarpenter26775 жыл бұрын

    Very helpful -- thanks!

  • @smilekarthik
    @smilekarthik2 жыл бұрын

    is there a way to telnet nodemcu and set the GPIO pin state controlling the GPIO Pins from telnet port

  • @uvatham
    @uvatham5 жыл бұрын

    Good, thanks for information

  • @lmaoroflcopter
    @lmaoroflcopter4 жыл бұрын

    Bloody hell... That explains a lot.

  • @Detroit_Playa
    @Detroit_Playa3 жыл бұрын

    Subscribed 🙏🏻

  • @Gaatech
    @Gaatech6 жыл бұрын

    Great info. How can you tell and find libraries that work on the esp32.

  • @TheJoeFletch
    @TheJoeFletch4 жыл бұрын

    Great video. I was looking for something like this to pick an MCU that has the most number of inputs to connect to all of my door and window reed switches and then connect it to Home Assistant for statuses (and then automations later on). The ESP32 appears to have 21 good input pins. Are there any other MCU's that I could use with ESPHome to sync with Home Assistant?

  • @EnergeticWaves
    @EnergeticWaves5 жыл бұрын

    great video, thanks.

  • @TheMahdifarhat
    @TheMahdifarhat3 жыл бұрын

    can you please teach us how to make a scene switch to switch scene on home assistant using esp32? like like control4 one and etc

  • @NiceEyeballs
    @NiceEyeballs Жыл бұрын

    Thanks

  • @EducationalTheatre
    @EducationalTheatre2 жыл бұрын

    in esp8266 can you able to take 8 input switches and 8 output relay or only 4 i/p and 4 o/p only please tell me

  • @viniciusnoyoutube
    @viniciusnoyoutube5 жыл бұрын

    Thank you!

  • @ronstarmk
    @ronstarmk6 жыл бұрын

    Great video. I use the Wemos D1 mini for a lot of my projects. Have you seen anything like your diagrams for pins on the D1 mini? I think I ran into this issue on pin 2 this week.

  • @TheHookUp

    @TheHookUp

    6 жыл бұрын

    I think they should be the same as the NodeMCU one. According to the diagram, pin 2 is high on boot and will cause boot failure if pulled low.

  • @ronstarmk

    @ronstarmk

    6 жыл бұрын

    That's what I was seeing, thanks.

  • @rkaid7
    @rkaid75 жыл бұрын

    holy shit thank you!

  • @lucaswybrandt7058
    @lucaswybrandt70586 жыл бұрын

    Thanks!

  • @mudssaradrees4817
    @mudssaradrees48175 жыл бұрын

    At A0 can it read signal by ADC 712 (AC current) and display it?

  • @konstantinshuliko1782
    @konstantinshuliko17824 жыл бұрын

    Спасибо, полезно)

  • @EnergeticWaves
    @EnergeticWaves5 жыл бұрын

    this stuff is hassle enough without weird mappings.

  • @TheRainHarvester
    @TheRainHarvester3 жыл бұрын

    Do these pin's behavior apply to the ESP12e module?

  • @mahesh_d
    @mahesh_d5 жыл бұрын

    Please help me as the problem is, whenever the esp8266 turns on / power came, it triggeres all the relay to high state. That cause all the switch to turn on. Please tell me the solution

  • @ishtiqueahamed9516

    @ishtiqueahamed9516

    5 жыл бұрын

    mahesh d do u solve the problem....? I face same problem...

  • @samazoa
    @samazoa5 жыл бұрын

    I LOST MY WIFI AND CANNOT DETECTED BY MY COMPUTER ON ESP8266 HOW CAN I RECOVER PLEAS

  • @jarchdm
    @jarchdm6 жыл бұрын

    Hi have been watching your videos with interest. Have a rpi home auto system. Using it for doorbell. just bought a dvr and a bunch of cameras and would like to learn how to get a pic from the front door camera when someone presses the doorbell. Tried to have a look at open vc but that looks scarily complicated.

  • @TheHookUp

    @TheHookUp

    6 жыл бұрын

    Are you using home assistant? Which DVR did you get? There are many different factors that will play into how you retrieve an image from them.

  • @jarchdm

    @jarchdm

    6 жыл бұрын

    The Hook Up wow that was quick. I'm at the moment using node red. Working on getting into home assistant. I have a Chinese dvr with xmeye installed on it. Guess I'll have to lean home assistant first. I'm ok with node red and dashboard but guess that's not integrated enough for pop up in android

  • @jarchdm

    @jarchdm

    6 жыл бұрын

    Maybe a video on how to transition from node red to home assistant would be helpful

  • @jarchdm

    @jarchdm

    6 жыл бұрын

    Oops sorry see you already did that video. I'll study it carefully

  • @jarchdm

    @jarchdm

    6 жыл бұрын

    The Hook Up .Ok I gave hassio a few days and I hate it. Coming from the clean crisp modular system of node red getting into the configuration yaml nightmare of hassio is just horrible. Going to stick with node red.

  • @amanmittal4232
    @amanmittal42324 жыл бұрын

    Bro i want to connect a hard drive with this esp8266 or esp32 and use them as a server through which i can access my hard drive data wirelessly is that possible in any way??

  • @TheHookUp

    @TheHookUp

    4 жыл бұрын

    No.

  • @amanmittal4232

    @amanmittal4232

    4 жыл бұрын

    @@TheHookUp can you tell me how i can make my hard drive wireless?

  • @mahantkeyur
    @mahantkeyur4 жыл бұрын

    Your video is very informative and useful for me. I want to connect 11 output devices with esp8266 nodemcu. Kindly suggest the pins. I was trying to use Tx and Rx Pin as output using //********** CHANGE PIN FUNCTION TO GPIO ********** //GPIO 1 (TX) swap the pin to a GPIO.FUNCTION_3 pinMode(1,FUNCTION_3 ); //GPIO 3 (RX) swap the pin to a GPIO. pinMode(3, FUNCTION_3); But, It couldn't work for me Kindly help me. Thank you,

  • @douwebrouwer2715
    @douwebrouwer27155 жыл бұрын

    I have a problem. I have a esp8266. model is hw-628. I tried everything to connect to it, but printing serial things like "test" work, but if i set all the outputs on, that don't work. I also changed in windows --> devices --> com to a upload speed of 115200. That made that I can upload, but i can't get any furder. ​code: ​void setup() { for (int i = 0; i pinMode(i, OUTPUT); } Serial.begin(115200); } void loop() { for (int i = 0; i digitalWrite(i, HIGH); } Serial.println("test"); delay(500); for (int i = 0; i digitalWrite(i, LOW); } Serial.println("test"); delay(1000); }

  • @TheHookUp

    @TheHookUp

    5 жыл бұрын

    The ESP will not work if you try to set all pins as outputs. Take a look at the diagram in the description for which pins can become outputs.

  • @douwebrouwer2715

    @douwebrouwer2715

    5 жыл бұрын

    if i attach the esp to the pc and open in the arduino IDE the serial monitor: this is the output. ets Jan 8 2013,rst cause:4, boot mode:(3,0) wdt reset load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d vbb28d4a3 ~ld

  • @TheHookUp

    @TheHookUp

    5 жыл бұрын

    @@douwebrouwer2715 That is the boot error you would expect from an incorrect pin configuration. Are the other pins grounded or floating?

  • @douwebrouwer2715

    @douwebrouwer2715

    5 жыл бұрын

    @@TheHookUp I search the WWW and there was a wrong schematic. I tried your solution with your schematic and it works. I tried to make a smart 5050 rgb led strip and this helped me al lot. Thank you for your fast answer.

  • @kiwijunglist
    @kiwijunglist5 жыл бұрын

    does the diagram apply to the wemos d1 mini which has less pins available?

  • @TheHookUp

    @TheHookUp

    5 жыл бұрын

    Same concept applies to all ESP8266 based chips.

  • @HFSoluciones
    @HFSoluciones5 жыл бұрын

    What mode and pin do you recommend for turning on and off a single led?

  • @TheHookUp

    @TheHookUp

    5 жыл бұрын

    pinMode(pin#, OUTPUT)

  • @HFSoluciones

    @HFSoluciones

    5 жыл бұрын

    Sorry, I didn´t ask the hole thing.....I meant inside Tasmota...

  • @jhonlee1581
    @jhonlee15815 жыл бұрын

    ESP32 GPIO13???

  • @Shariki569
    @Shariki5694 жыл бұрын

    where can i find the 5 volt pin?

  • @TheHookUp

    @TheHookUp

    4 жыл бұрын

    If you are powering it with a 5V source there will be 5v on VCC. Otherwise it doesn’t have a regulated 5V output, only 3.3V.

  • @browaruspierogus2182
    @browaruspierogus21826 жыл бұрын

    Pins should not cause any problems during boot because they are floating and nothing should happen. At least esp32 has no such problems except dedicated flash pins

  • @TheHookUp

    @TheHookUp

    6 жыл бұрын

    This is not true based on the data I collected through testing.

  • @Milkex
    @Milkex6 жыл бұрын

    push ups now

  • @ijazahmad7525
    @ijazahmad75256 жыл бұрын

    nodemcu esp 8266 not reconnect if connection of wifi lost,till i repower it

  • @TheHookUp

    @TheHookUp

    6 жыл бұрын

    can you post the code you are using?

  • @ijazahmad7525

    @ijazahmad7525

    6 жыл бұрын

    @@TheHookUp yes.. i am using firebase i post code here just a mint

  • @ijazahmad7525

    @ijazahmad7525

    6 жыл бұрын

    #include #include #define WIFI_SSID "----" #define WIFI_PASSWORD "roora" //this firebase project was deleted //you'll need to enter your own firebase info #define FIREBASE_HOST "home-automation-1122.firebaseio.com" #define FIREBASE_AUTH "h--------" #define LED1 5 #define LED2 4 #define LED3 0 #define LED4 2 #define LED5 14 #define LED6 12 #define LED7 13 #define LED8 15 void setup() { pinMode(LED1,OUTPUT); digitalWrite(LED1,0); pinMode(LED2,OUTPUT); digitalWrite(LED2,0); pinMode(LED3,OUTPUT); digitalWrite(LED3,0); pinMode(LED4,OUTPUT); digitalWrite(LED4,0); pinMode(LED5,OUTPUT); digitalWrite(LED5,0); pinMode(LED6,OUTPUT); digitalWrite(LED6,0); pinMode(LED7,OUTPUT); digitalWrite(LED7,0); pinMode(LED8,OUTPUT); digitalWrite(LED8,0); Serial.begin(9600); WiFi.begin(WIFI_SSID, WIFI_PASSWORD); Serial.print("connecting"); while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.println(); Serial.print("connected: "); Serial.println(WiFi.localIP()); Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); Firebase.setInt("LEDStatus",0); } void loop() { if(Firebase.getInt("field1")) { digitalWrite(LED1,LOW); } else { digitalWrite(LED1,HIGH); } if(Firebase.getInt("field2")) { digitalWrite(LED2,LOW); } else { digitalWrite(LED2,HIGH); } if(Firebase.getInt("field3")) { digitalWrite(LED3,LOW); } else { digitalWrite(LED3,HIGH); } if(Firebase.getInt("field4")) { digitalWrite(LED4,LOW); } else { digitalWrite(LED4,HIGH); } if(Firebase.getInt("field5")) { digitalWrite(LED5,LOW); } else { digitalWrite(LED5,HIGH); } if(Firebase.getInt("field6")) { digitalWrite(LED6,LOW); } else { digitalWrite(LED6,HIGH); } if(Firebase.getInt("field7")) { digitalWrite(LED7,LOW); } else { digitalWrite(LED7,HIGH); } if(Firebase.getInt("field8")) { digitalWrite(LED8,LOW); } else { digitalWrite(LED8,HIGH); } Serial.println("..............."); if (Firebase.failed()) // Check for errors { Serial.print("setting /number failed:"); Serial.println(Firebase.error()); return; }

  • @ijazahmad7525

    @ijazahmad7525

    6 жыл бұрын

    i am using firebase

  • @TheHookUp

    @TheHookUp

    6 жыл бұрын

    Looks like you could probably add in a reboot with the firebase error: if (Firebase.failed()) { ESP.restart(); } I'm not familiar with firebase, so I don't know how often it fails to make server calls.

  • @myusernameislongerth
    @myusernameislongerth5 жыл бұрын

    You're using Arduino on the ESP8266, not NodeMCU. NodeMCU is firmware (www.nodemcu.com/index_en.html, github.com/nodemcu/nodemcu-firmware) that allows you to write Lua scripts for ESP. It's not just you, a lot of people don't seem to know the difference. This is so annoying - when trying to actually find documentation about NodeMCU, you find mostly Arduino stuff instead, grr.

  • @TheHookUp

    @TheHookUp

    5 жыл бұрын

    I'm aware of he difference. The problem comes from the fact that this particular board is sold under the name "esp8266 nodeMCU".

  • @surenbono6063
    @surenbono60634 жыл бұрын

    ..I hate esp32...esp8266 runs even on xp while esp32 still struggled on w7 and had to watchdog reset every upload like a dog...

  • @Alacritous
    @Alacritous6 жыл бұрын

    Stop calling them nodemcu unless you're running Lua on it.

  • @TheHookUp

    @TheHookUp

    6 жыл бұрын

    What would you call them?

  • @Alacritous

    @Alacritous

    6 жыл бұрын

    The Hook Up What they are. ESP8266 dev boards and ESP32 dev boards.

  • @zachburke8906

    @zachburke8906

    6 жыл бұрын

    The nodemcu part is hardware isn’t it? Not the fact it’s lua.

  • @Alacritous

    @Alacritous

    6 жыл бұрын

    zach burke the nodemcu was originally released with lua installed on it. Anyone could buy it and do what they liked with it, like flash it with something else, but it was created for use with lua by lua enthusiasts.

  • @Alacritous

    @Alacritous

    6 жыл бұрын

    zach burke nodemcu refers to the firmware. Not the hardware. en.m.wikipedia.org/wiki/NodeMCU