Making Raspberry Pi Web Controls

  Переглядів 188,622

Tinkernut

Tinkernut

День тому

This video will show you how to control your Raspberry Pi's GPIO pins from a web interface. This will allow you to control motors, lights and other electronics from the web! You can even make your own Raspberry Pi Web controlled robot like this one:
• Web Controlled Spybot
More Web Programming Tutorials:
HTML - • Tinkernut - Website Ba...
Javascript - • Tinkernut - Website Ba...
PHP - • Tinkernut - Website Ba...

КОМЕНТАРІ: 259
@MediocreChannel68
@MediocreChannel68 4 роки тому
Haven't tried this yet but thanks for making it so simple and outlining all steps.
@creativemindz8977
@creativemindz8977 9 років тому
Thanks for the inspiration dude keep up the creativity- loving your work
@alanderson78
@alanderson78 8 років тому
Very cool and concise. I hate watching 30 minutes of video to get as much information as you cover in 5. Can't wait to try it out.
@brendankelley
@brendankelley 11 місяців тому
Awesome man. I will consider donating when i revisit to use this tutorial!
@thomasdamerau4339
@thomasdamerau4339 8 років тому
Thanks! Works just fine. Looking forward for new cool stuff.
@tinujatinpatel
@tinujatinpatel 8 років тому
Awesome. Very well detailed view and a good explanation on how things are working.
@andyclapham4688
@andyclapham4688 4 роки тому
Excellent video, best way I've found on the web of doing this, many thanks :)
@xcruell
@xcruell 6 років тому
EXACTLY what i needed, that you sir
@alankaradas
@alankaradas 9 років тому
I've never used this pie technology but still love the way you explain it. Amazing!
@heathcarter4654
@heathcarter4654 3 роки тому
*pi
@raulrrojas
@raulrrojas 5 років тому
Thanks! You made the PHP call quite complicated. No need to, just simple HTML code can call a second page.
@kepler69c32
@kepler69c32 5 років тому
thanks a lot for this !
@nisonusMusic
@nisonusMusic 9 років тому
Nice tutorial!
@andrewdavis6917
@andrewdavis6917 5 років тому
I love it. Can't wait to try it out
@mgadbois124
@mgadbois124 8 років тому
Nice video, thanks for sharing!
@neostarfromearth107
@neostarfromearth107 Рік тому
love it, great work !!!
@redeyz1885
@redeyz1885 6 років тому
Thanks man liked subscribed
@quintenvanginderen8635
@quintenvanginderen8635 5 років тому
thanks man it really worked i've been looking for this for 2 days. just make shure you have installed php... my webserver just showed the code that was in the php files.
@shawnstarr1
@shawnstarr1 9 років тому
awesome stuff!
@captainahab4202
@captainahab4202 7 років тому
Many thanks, brother.
@brock1152
@brock1152 4 роки тому
Great Video helped me Greatly 👌
@kingsleyhart
@kingsleyhart 9 років тому
Nice video buddy, very informative. Thank you for sharing with us :-)
@thadeusronnthomas6522
@thadeusronnthomas6522 7 років тому
great work..., Thanks for the video
@MrAnsariu
@MrAnsariu 5 років тому
Great job bro... As i able i will support you with money And thanx for posting this usefull video
@PhG1961
@PhG1961 6 років тому
Great video ! Thnxs for sharing !
@ingjms
@ingjms 5 років тому
This is great. I'd like to know what's the best lightweight webserver for the RPI, i use apache on my daily basis but can't tell which one is better in terms of resourses and extensibility, just in case..
@rohitpaudel8025
@rohitpaudel8025 5 років тому
cool man.. keep it up.
@michaels8297
@michaels8297 4 роки тому
awesome! how can I control it from the wider internet without port forwarding or third party wormholes/tunneling like dataplicity? Would it be possible to view this exact webpage but have it control the pi via the cloud?
@oldciscodude
@oldciscodude 8 років тому
Outstanding!
@mariustancredi2192
@mariustancredi2192 8 років тому
Why not use $.ajax() or $.get()? Also, will Node.JS gives a smoother control? I never tried Raspberry Pi so I'm not sure if Node.JS will even work on that...
@kashminderful
@kashminderful 9 років тому
that was cool! Is there a way so that i could start or log off my computer remotely?
@muziekklas22
@muziekklas22 9 років тому
Note AJAX is not only a link between PHP and JS. It just makes a request to any provided url. This DOES NOT limit it to PHP files (works with ASP.net, Ruby,Python,.. Even other HTML files)
@shahnawaazsoogun9268
@shahnawaazsoogun9268 8 років тому
hi, thanks for this awesome video :) i did it with a relay module, using your code i am able to turn on on relay i created all the pin on and pin off php pages for each relay, i have 8 relay in all but when using the buttons with different IDs i am not able to switch on and off individual relays.. can you help me out please ?
@NodePoint
@NodePoint 9 років тому
If you give the buttons name attributes then you can trigger the LED state using one PHP file (like triggerled.php), making it more cleaner. Of course that would mean checking the value of that input. I assume it was intended for it to be set out in a basic way. Also, I've noticed that you've used the system() function in this video. Does it matter which three functions (system(), shell_exec() and exec()) should be used?
@emozley
@emozley 5 років тому
Great video! Is it possible to make the pi camera take a photo via a web interface?
@ahmedadeli9405
@ahmedadeli9405 7 років тому
hi my friend this is good tutorial but i have a quistion how to make this dashboard access for anyone in the web
@violet-fire5848
@violet-fire5848 4 роки тому
thank you
@jebe5247
@jebe5247 7 років тому
thank you for this video it works great:D I made a few changes I whould like to share little code i found to help it look right on a cellphone in the I added it shows up better on my phone so i dont have to zoom every time, I also renamed the controls.php to index.html so i can just use the pi's ip to bring up the buttions
@chadmasta5
@chadmasta5 9 років тому
Is there a way to make a momentary button press? For example having one button, clicking it, and have it load the on page. for one second and then automatically switch to the off page. Sorry if I sound dumb but I am a total noob when it comes to this and I'm still learning.
@ScottieD369
@ScottieD369 9 років тому
Really Nice
@unicodefox
@unicodefox 9 років тому
Is there a way so i can make a webserver to run commands (eg. Reboot system, startx, etc)
@rorycormack7577
@rorycormack7577 6 років тому
Hi. I am very interested in computing and programming involving the raspberry pi. I have watched your video and copied all the code from the first part (before the button website) but got some reason it will not work. I have a raspberry pi model b so I'm not sure if that will matter but I was wondering if you Could could go a bit more in depth or just give me a few tips or a bit of help. Thanks and I look forward to hearing from you.
@stuartg40
@stuartg40 5 років тому
What is a good way of implementing a listening service on multiple Pis to control the GPIO pins according to commands issued over ethernet? To be clear, I intend to have a bespoke program / web page on a windows or mac machine that takes commands through a GUI, such as button presses, to control multiple Pis on the same network. For example, 'click this button to turn on red LED on Pi 6', or 'type here and click send to display a message on Pi 2'. Thanks in advance.
@DarrenRainey
@DarrenRainey 9 років тому
you could also use php shell exec
@TheNikolaschoulakis
@TheNikolaschoulakis 6 років тому
Hi thanks for this is there a link to Git or something with all of the code pls?
@jancastro4772
@jancastro4772 9 років тому
Hello, I am kinda new with the raspberry pi. I was able to create the files. however, I cannot seem to understand how the process worked on how will the browser from a phone/computer be getting the php file to run. Is there something else that needs to be configured?
@someguy3032
@someguy3032 9 років тому
VERRY GOOD VIDEOS !
@joaofelipe2060
@joaofelipe2060 9 років тому
Great video,Tinkernut.keep this good work coming. I have a doubt:The process to interact the webpage with the device would be similar to make if I use an Arduino instead?if so,would be doable to implement using a smartphone app to control the Raspberry/Arduino?
@yapandasoftware
@yapandasoftware 5 років тому
Is it possible to create this using a HTA type interface so the user can't alter or change the page or close it rather use it as a UI overlay in the Pi's OS?
@imppaco
@imppaco 8 років тому
Is it possible to do an OnMouse event, so 1 button will light the LED when clicked, but turn off when released?
@bigaone22
@bigaone22 9 років тому
Hey Tinkernut, will you be so kind as to tell me how to use this code to control multiple led's thanks
@marcus4619
@marcus4619 8 років тому
do you have a video on how to make a pi server that is actually on the internet?
@zulfitrihazim1138
@zulfitrihazim1138 8 років тому
bro kalau tak pakai wifi adapter tu boleh tak ?
@shashankpatel4872
@shashankpatel4872 5 років тому
how can we play a audio file as well as "Turning on the LED" whenever ON button is clicked ?
@itzmeuday
@itzmeuday 9 років тому
+@Tinternut, can u please mention what are the prerequisites that needs to be installed before proceeding to code in php. if possible with commands. i am new to raspberry pi.
@louishache3672
@louishache3672 4 роки тому
You need Apache + PHP + WiringPI
@EastOnyx
@EastOnyx 9 років тому
Great video :)
@brownmunda7200
@brownmunda7200 5 років тому
do raspberry pi act as a server automatically? if no then how to setup it as a server?
@calvinjanson75
@calvinjanson75 7 років тому
is there a way that i can see if a port already is opened?
@kholikmawarjisaragih5818
@kholikmawarjisaragih5818 7 років тому
not foud in cd www.. can u help me, please. how to install webserver and php?
@pearinnovation1419
@pearinnovation1419 6 років тому
hii i want to control my robot and view video feed from pi cam on my web page but i dont want it should run on local but i can control from anywhere from internet. can you help me
@RuiSantosdotme
@RuiSantosdotme 9 років тому
Which software you use to record your RPi screen? Are you simply connected via SSH with PuTTY and recording with camtasia?
@Tinkernut
@Tinkernut 9 років тому
Rui Santos I'm using SSH and a screen recorder. It's on a mac, so I didn't need putty.
@attitudefever1
@attitudefever1 5 років тому
what is the advantage of using PHP on backend than Node.js ?
@dfmrrd
@dfmrrd 9 років тому
I need help for me it says URL not found
@skaoi39
@skaoi39 6 років тому
Hi, you can help me, how can use a public addres (public ip ) to access to web page thanks
@boukarradhmoez99
@boukarradhmoez99 5 років тому
Good evening, please, I have a Raspberry project which takes values from the sensors and it stores it on a web server then the access of it is given that it is done using a mobile application, but I have a small problem " how to store this data on web server ".
@markuskosters4301
@markuskosters4301 7 років тому
is there an easy way to activate the led as long as you click the button?
@qoxop168
@qoxop168 9 років тому
Is there an easy way to use this methode with UART?
@goodsayan
@goodsayan 9 років тому
Hi Can you share controls.php file please? I don't find my error Thanks!
@salaheldineghennai7743
@salaheldineghennai7743 4 роки тому
I can add a camera field in the same page ?
@robr7363
@robr7363 8 років тому
Here is a beer for helping me get my project going faster! *****
@Jangofett165
@Jangofett165 9 років тому
Can you do wireless web controls with an arduino?
@bigaone22
@bigaone22 9 років тому
tried this tutorial and all i could do was get the lights on by navigating to pinon.php in the browser, couldnt get it to work when i click on the button in the controls.php file, any help will be appreciated...
@Iggy8me
@Iggy8me 3 роки тому
Can you make this work with the freenove car I’m using an android to control my pi car wanna make it so I don’t have to have to phones
@deepakchawla35
@deepakchawla35 7 років тому
hey can anyone tell me which device he uses with led to attach with raspberry pi
@antoinebrossault5015
@antoinebrossault5015 8 років тому
nice !
@__-zu7tx
@__-zu7tx 3 роки тому
How do you use webcontrols to make a camera module take a picture?
@j69ds
@j69ds 3 роки тому
I typed out the script but must have an error, is the script available somewhere for easy copy or download?
@nabilelkassoumi2639
@nabilelkassoumi2639 8 років тому
salut, j'ai un pb c que j'ai pas le répertoire ""WWW" qu est ce que je vais faire SVP ??
@SkanderBibani
@SkanderBibani 9 років тому
Cool.
@thomasschmidt5546
@thomasschmidt5546 4 роки тому
I got pinon.php and pinoff.php run by changing ...system(... to echo exec('gpio -g mode ...'); perfect !!
@lokesh_jadhao4383
@lokesh_jadhao4383 5 років тому
Hi bro I am new in programme I am not learn any programing language but in my project required to program resberry pi pls give me some tips about programming how to progr. It pls tell
@mcandryan
@mcandryan 9 років тому
Which is better in your opinion: arduino or raspberry pi ?
@ms12349648
@ms12349648 9 років тому
So what about if im planning to control motors on the raspberry pi while watching a stream on the web page. So for controlling the motors do we use the same code for rotating and everything else or we make diffrent ? If you know how please explain. Thanks
@Tinkernut
@Tinkernut 9 років тому
UnknownDeveloper I actually just showed how to do that in my previous video.
@ms12349648
@ms12349648 9 років тому
Tinkernut In the last one it was with the ball but not with the DC motors. So how can we control those DC motors. I would do the stream and all but the DC motors ??
@ohhhleslie
@ohhhleslie 9 років тому
Thank you for this wonderful tutorial. I would like to ask what if we want the website to be available online? Like we'll be able to control the whole system anywhere as long as there is an internet connection? Also, what if we have several functions to control, or like for that video; if we have 5 LED to turn on/off, and the controls need to be in the same page as well.. will be doing this same thing? Thank you so much. I hope you can reply, it is for a project we're working on. Please & thank you.
@colinhoek
@colinhoek 9 років тому
Leslie Brillantes if you want to access it on every internet connection on the world.you have to portforward
@ohhhleslie
@ohhhleslie 9 років тому
Thank you for replying.. I'm sorry in advance, because im really an amateur in programming... But what do you mean by PortForward?
@Geolung2001
@Geolung2001 9 років тому
nice
@roystervi
@roystervi 6 років тому
Hi I am trying to use this http command in my automation but when I type "192.168.0.108/pin18on.php" the browser just show a blank page and the relay I have on pin 18 does not switch on or off. anything I can do or missing ? my files name pin2off.php and pin2on.php when I put gpio -g mode 18 out in the command_line gpio -g mode 18 out turn it ON and gpio -g mode 18 in turn it off
@robin_be
@robin_be 9 років тому
Script tags should be placed just before the closing body tag, because they block every other request (stylesheets, images etc). Ok, doesnt make difference here, but its good practise in general
@beauvsb5230
@beauvsb5230 3 роки тому
Ohh cool, Im assuming you can also use CSS on top of HTML to give that controller a nice and clean look.
@420oppa69
@420oppa69 3 роки тому
Ofc, Why not
@easyc4862
@easyc4862 6 років тому
This tutorial was very helpful to me, however, I failed to get the javascript working. to resolve the issue I had to a redirection into the pinon.php and pinoff.php file so that once clicked instead of loading the page redirect back to the controller page. If this is something you would like to try just add the following meta tage below in head section of your pinoff and pinon files
@4blue6
@4blue6 6 років тому
Does anyone know if he has a copy of the code he used in this video online somewhere?
@ftv5397
@ftv5397 6 років тому
great.......
@Bjorn_The_Bear
@Bjorn_The_Bear 8 років тому
Where can I find the source?
@danteflordeliza6525
@danteflordeliza6525 6 років тому
Can I use PWM here?
@nene7190
@nene7190 8 років тому
Is there any way we could do this off of an actual webpage, so we could access it from anywhere, not just when we're connected to our home router?
@tomhartogs1362
@tomhartogs1362 8 років тому
+Ne ke All you'd have to do is register your home ip-adress with a DNS server and allow port forwarding from your router to your pi. You will then be able to acces your webserver from anywhere.
@bde5692
@bde5692 3 роки тому
Do you have it on GitHub
@salmankhan-oz6sq
@salmankhan-oz6sq 7 років тому
how we can save the php file in terminal i didnt get your that point and cant even help myself
@ayomaggotz
@ayomaggotz 9 років тому
Interesting
@badcatalex
@badcatalex 9 років тому
I want some Raspberry PI!
@nathangek
@nathangek 9 років тому
if you want a lot of buttons but don't want to copy the ajax code for every button you could also just listen for button clicks with the class of ajax or something and put the name of the file you want to visit in the button as an attribute like: then get the script file by doing: var scriptFile = $(this).attr("script-file"); and then a.open("GET", scriptFile);
@marten3451
@marten3451 9 років тому
Can the same be applied for the raspberry pi b+?
@Tinkernut
@Tinkernut 9 років тому
marten3451 Yep. It just has different GPIO's, so adjust accordingly.
@andym3695
@andym3695 4 роки тому
good
I Can Save You Money! - Raspberry Pi Alternatives
15:04
Linus Tech Tips
Переглядів 3,2 млн
Raspberry Pi Solar Serial REST API Tutorial
16:44
rdagger68
Переглядів 88 тис.
Мама и дневник Зомби (часть 1)🧟 #shorts
00:47
BRAWLER MUTATIONS WILL BREAK THE GAME! - Brawl Talk
09:34
Brawl Stars
Переглядів 25 млн
McDonald’s MCNUGGET PURSE?! #shorts
00:11
Lauren Godwin
Переглядів 18 млн
1 класс vs 11 класс (рисунок)
00:37
БЕРТ
Переглядів 3,1 млн
the Raspberry Pi 5
17:57
NetworkChuck
Переглядів 1 млн
Creating a Website on Raspberry Pi
13:36
Chris Titus Tech
Переглядів 37 тис.
Raspberry Pi Devastator Robot #2
19:07
ExplainingComputers
Переглядів 284 тис.
Build a web control panel for your project - HTML and JavaScript coding
40:04
CHIP v Raspberry Pi Zero
17:04
ExplainingComputers
Переглядів 359 тис.
Smarter than a Smart TV! (Raspberry Pi Inside)
9:10
Jeff Geerling
Переглядів 1,9 млн
How to Cool Your Raspberry Pi - Practical Tips - Myths Debunked
9:08
Core Electronics
Переглядів 128 тис.
Raspberry Pi Robotics #2: Zumo Robot
15:55
ExplainingComputers
Переглядів 472 тис.
Raspberry Pi Robotics #4: SSH Network Control
17:41
ExplainingComputers
Переглядів 153 тис.
Cách sửa này được không các bạn?
1:00
Cơ Khí Toàn Nghĩa
Переглядів 830 тис.
How Neuralink Works 🧠
0:28
Zack D. Films
Переглядів 8 млн
GitHub Copilot just got promoted to Captain
4:01
Fireship
Переглядів 110 тис.
Как должен стоять ПК?
1:00
CompShop Shorts
Переглядів 583 тис.
СЛОМАЛСЯ ПК ЗА 2000$🤬
0:59
Корнеич
Переглядів 1,5 млн