This is a simple project which will help you to develop an Android app for your NodeMCU IoT projects using MIT App Inventor.
In this project we are controlling a GPIO pin of NodeMCU, let's use an LED to denote the GPIO pin, for that connect the led to NodeMCU. Connect D4 pin of NodeMCU to anode of LED and cathode to ground.
Let's go to the Arduino code.....
Edit ssid, replace it with your mobilehotspotname, provide hotspot password.
Compile the code
Burn your code into NodeMCU.
Beginners can check the following link to compuile and burn.
https://www.hackster.io/WolfxPac/getting-started-with-nodemcu-esp8266-bd5e18
After successful uploading turn on your mobile hotspot.
Open Arduino serial monitor, press rst button.
Here 'ablespot' was my ssid, you will see yourown and a 4 number ip following it,ip will be different for you .Copy the ip.
Take your mobilebrowser, search http://'ip copied earlier'/gpio/1
This will turn on your led, similarly http://'ip copied earlier'/gpio/0 will turn off
Now it is time to build the app, go to https://appinventor.mit.edu/
Click create apps on the left side.
Login with a gmailaccount.
Under project>New project, save with a name.
Now click on ‘Button’ and drag and drop two buttons on the main screen.
And drag 'web ' from connectivity.
Now click on the ‘Blocks’ to add blocks in your app.
Now click on button one, you can see number of blocks for
button one, similarly for button 2 and web.
Now build a flow shown below using the blocks shown earlier.
project>save, and generate apk file using Build.
Install app in your mobile, turn on mobile hotspot, press rst button of NodeMCU, you can see one button turn on your LED, while other turn off.
For buying components visit utsource
Comments