IoT Tutorial #24 [ NodeMCU Tutorials #9 ]
NodeMCU ESP8266 comes with Lua firmware by default.
In order to run the python code on nodeMCU ESP8266, you need to change the firmware of NodeMCU ESP8266 from Lua (Default) to MicroPython firmware, steps are given in the previous post.
Here, I will demonstrate how to run Python / MicroPython program on NodeMCU ESP8266 for first time.
NodeMCU ESP8266 comes with Lua firmware by default.
In order to run the python code on nodeMCU ESP8266, you need to change the firmware of NodeMCU ESP8266 from Lua (Default) to MicroPython firmware, steps are given in the previous post.
Here, I will demonstrate how to run Python / MicroPython program on NodeMCU ESP8266 for first time.
Recommended Internet of Things (IOT) Courses:
- Udemy: Complete Guide to Build IOT Things from Scratch to Market
- LinkedIn: IoT Foundations: Fundamentals
- edX: Introduction to the Internet of Things (IoT)
- edureka: IoT Certification Training on Azure
- Coursera: An Introduction to Programming the Internet of Things (IOT) Specialization
- Eduonix: Internet Of Things (IOT) Bundle
Problem Statement:
Blink LED connected to the NodeMCU using Python programming.
Requirement:
1. NodeMCU ESP8266 Board
2. micro USB cable
3. LED
4. Resistor - 1k
5. Female to male relimate - 2 Nos.
6. Internet connection
NOTE: LED+ is Connected to D5 of NodeMCU ESP8266
Steps:
- Flash Fresh MicroPython firmware using NodeMCU Flasher (Click here to Check how) > Close Flasher
- Make below mentioned connections:
- Keep NodeMCU connected > Open ESPlorer > A new ESPlorer window will open.
"Port" must be automatically detected there. Set Baud_rate = 115200
Go to settings > Select "Firmware" > Tick radio button of "MicroPython" and again click on "Script".
NOTE: If PORT is not getting detected then you need to install drivers:
https://www.silabs.com/products/development-tools/software/usb-to-uart-bridge-vcp-drivers
Click on "Open" to Check the firmware version of nodemcu.
then click "RST" button on NodeMCU.
It will show the Firmware version...
- Copy following code and Place it in the left black window of ESPlorer and save it with .py extension:
- Then Click on "Send to ESP"
- LED Connected to D5 pin of NodeMCU should Blink with 1 sec delay....as
- You must have observed, for blinking LED connected to pin D5 on NodeMCU, We have use no. "14" in the programming, that is because Actual pin numbers and and Pin no. written on the board (for the ease of work) are different.
Follow below mentioned pin mapping while working on Python program using NodeMCU ESP8266:
For Better understanding you can watch demonstration video given below:
For Better understanding you can watch demonstration video given below:
Downloads:
Download link is given in the Description of the YouTube video shown below.
Download link is given in the Description of the YouTube video shown below.
Demonstration:
--------------------------------------------------------------------------------
Click here to see more codes for Raspberry Pi 3 and similar Family.
&
Click here to see more codes for NodeMCU ESP8266 and similar Family.
&
Click here to see more codes for Arduino Mega (ATMega 2560) and similar Family.
Click here to see more codes for NodeMCU ESP8266 and similar Family.
&
Click here to see more codes for Arduino Mega (ATMega 2560) and similar Family.
Feel free to ask doubts in the comment section. I will try my best to solve it.
If you find this helpful by any mean like, comment and share the post.
This is the simplest way to encourage me to keep doing such work.
Thanks and Regards,
-Akshay P. Daga