Raspberry Pi - Control an LED from a browser

preview_player
Показать описание
Welcome to another Raspberry Pi tutorial and another giveaway!

In today's tutorial, we take everything we've learned so far and put it together and control an LED from our browsers using a very simple Flask app.

The EasyProgramming and Github pages both have links to prerequisite tutorials that you should watch if you are not already familiar with these topics:

Raspberry Pi Giveaway Winners are announced in the video and on EasyProgramming.

#RaspberryPi #Flask #Apache

-----------
Рекомендации по теме
Комментарии
Автор

Many thanks for this great tutorial, its great to learn these things

_edgodd
Автор

this is cool, i know now how to control all my esp8266 from one page,
i can make a button that send request to the ip of any esp8266

need to try that when i receive my raspberry Pi (and found where i put my esp8266 lol)

thx for the video

Lunolux
Автор

Hi, thanks for your instructions. Thank to you, I can find myself interested about raspberry Pi, and I'm studying it for 3 months. As an enthusiast, I'm curious about how it works if I use in C language. It's really kind of you if you helped me figure it out. Thanks :).

HungNguyen-glxt
Автор

Hello! Not sure if you still reply to comments here, but I have a question. I am making similar app for my school project.
On one page I want to display some scraped data from another web page (works fine in virtualn environment outside apache --> random ip with port number), then in the second page I would like to control led light (I did everything like you showed in this and past tutorials, it works fine), but I have troubles when I try to combine those two ideas to work in a single web app.
At 8:53 you said you could also use templates and jinja (I used those two in my web scrapings so I know a little bit about it), but I don't know how to combine this with apache, sites-available, .wsg to activate main python file etc.
Could you please give me some guidance.
Thank you for your amazing videos!

saudergraba
Автор

Hi, @Nazmus Nasir is this concept something you could do for a business if paid. I was looking for someone to programme a web page so that when you click on a tab that lights on a model we have will turn on.

tompotter
Автор

Hi, thanks for the instructions, got it working nicely! Do you have anything i can look at in regards storing the button state in memory like you mentioned? Would be good for the website to remember if the light is on or off even if it is refreshed. Thanks

RootsGSM
Автор

At 6:29 when I try to add additional elif lines to control more different lights the whole thing stops working. How would I go about controlling additional leds while using the same url with just changing the ending part (ex. On, off) also whenever I edit the code and save it, I get an “internal server error” when I enter the url

ben
Автор

Hi! Not sure if you still reply to comments here, but I just had a question. I am trying to create a program that will take in an input through an input box into a raspberry pi hosted website. From there, it will read out what was put into the website. What steps would I need to take for this? Is there any good reference of yours for me to use to figure out how to do this? Thanks!

SpagZombies
Автор

Hi I am doing a project that requires my to make a website and use LED's, LCD's and servos with the raspberry pi. Can I use all of these items with the raspberry pi from a website?

rehansamaratunga
Автор

Hi, thanks for the tutorial. It works well. But can you help me how to make it control 3 leds? What needs to be changed or added? Thank you..

rajachairul
Автор

I reached the point in the video around 8:40 where I can toggle the LED by changing the url and I got it all working but now I am confused on how to setup the rest of the video. Btw I am new to this sort of thing.

ben
Автор

Can you open the web page from the internet?

شريفالفيفي-مو
Автор

Hi, got an issue when actually clicking the browser ‘buttons’ - it doesn’t do anything and an internal server error appears. Chrome dev console shows that it’s throwing up an error when the Ajax GET request is called. It seems to be a problem with code from the Ajax/libs/jquery 3.3.1 directory, specifically jquery.min.js:2 (and a large section of this code is underlined with an error message declaring it failed to load resource).

Any ideas? Or am I missing something obvious? Thanks

dastro_
Автор

Nazmus could you please explain how can I install pandas in my flask virtual environment?

esmeraldalopez
Автор

How can I show the state of a button on the web page ?

denizemiroglu
Автор

Can I control other things on the raspberry pi with this code?

dracoisalive
Автор

Hey, How do I access this webpage from any external network? Could you please let me know how ?

VikramBalaram
Автор

I could not process this step activate_this.py script, it shows internal server error..could you help me what have to do?

venkadeshvenkad
Автор

how did you create the .conf file starting from .html, .jss and .css?

masterpsychic
Автор

i can not install pip3 install RPi.GPIO. Can you help me solve this problem bro ?

khainguyen