µCast #17: Control Hardware Remotely With Socket.IO

  Рет қаралды 19,281

Kevin

Kevin

Күн бұрын

Пікірлер: 67
@GeorgeLenoHolmesJr
@GeorgeLenoHolmesJr 4 жыл бұрын
1:22 Where did your initial command prompt window come from? It looks like it's something additional from Node? There's very little information on Google regarding "node-gyp command prompt"
@KevinSidwar
@KevinSidwar 4 жыл бұрын
Hey George, sorry for the confusion. When I originally filmed this the regular windows shell really sucked for nodejs development because it lacked almost all the basic tooling support. This is a Cygwin prompt. Can't remember why it says node-gyp in the title bar. In any case, Windows has come a long way so you should be able to do all of this in a normal terminal. I exclusively use Linux nowadays so I can't test that for sure. At the very least you could use the new WSL (Windows Subsystem for Linux) and get everything you need but I believe all the basic Node stuff should work natively on Windows now. Hope that helps.
@Rob-id3zf
@Rob-id3zf 3 жыл бұрын
even in 2021 I found this totally relevant, really interesting and usefull!! Thanks
@KevinSidwar
@KevinSidwar 3 жыл бұрын
Thanks RJ, glad it could be of help.
@kensugai5008
@kensugai5008 8 жыл бұрын
You just made my week knowing I can communicate with my raspberry using socket.io and heroku! Awesome video!!
@KevinSidwar
@KevinSidwar 8 жыл бұрын
Thanks Ken, I really appreciate that. Glad it was helpful to you. Let me know if you have any questions.
@marklowe7431
@marklowe7431 8 жыл бұрын
Thanks a lot for making this video. Concise with no fluff. Cheers.
@KevinSidwar
@KevinSidwar 8 жыл бұрын
+Mark Lowe Thanks so much Mark. Means a lot. Have a good one.
@aminafoxdye
@aminafoxdye 4 жыл бұрын
Hello- thanks so much for the tutorial! I am very new to most things Raspberry Pi, Node.js and websockets- I'm am having issues with creating the folder directory for express... The express server command @ 1:32 seems to come back as an invalid command for me... Am I missing something else that has to be installed first? Express is another npm package, right?
@KevinSidwar
@KevinSidwar 4 жыл бұрын
Hey Amina, thanks for watching. Yes, you will need the express generator package installed for the command to work. Sorry I didn't clarify that in the video. If you run npm install -g express-generator and try the command again it should work for you. Let me know if you have any issues.
@rajkopodinic
@rajkopodinic 5 жыл бұрын
How would I go about doing the exact same thing but instead of turning on an LED I want to input a number in a text field and click submit for it then to send that input to a single 7 segment display attached to the RPi?
@KevinSidwar
@KevinSidwar 5 жыл бұрын
You should be able to use the same flow to get the number to the client (pi). Around the 6 minute mark I show how to grab the state of the toggle in the web-side javascript code. You can use jquery similarly to grab the value from a text box when a button is pressed and then do something like socket.emit("stateChanged", [pass the number here]). Then on the Pi side instead of getting a true or false value when the event fires you'll get the number from the web page and you can use that to update your 7 segment display. You'll have to write the code to talk with the display but that will depend on what display you are using. Hopefully that helps.
@rajkopodinic
@rajkopodinic 5 жыл бұрын
@@KevinSidwar Thanks a lot for your help, it really cleared things up!
@partisan-bobryk
@partisan-bobryk 7 жыл бұрын
you can use npm install socket.io --save It will automatically add it to your package.json
@KevinSidwar
@KevinSidwar 7 жыл бұрын
Thanks for the tip Tushonka and thanks for watching.
@GabeFromUtah
@GabeFromUtah 10 жыл бұрын
Love socket.io and heroku on some days. Great video. Keep them coming.
@moherna3323
@moherna3323 7 жыл бұрын
I love this work this mix between software and hardware. Thank you, man!
@KevinSidwar
@KevinSidwar 7 жыл бұрын
Thanks for watching Moissane.
@crashbash2020
@crashbash2020 7 жыл бұрын
Hi im trying to follow along with this and am running in to trouble, @6:50 you show an example that doesn't work for me, your example shows "client connected" once, whereas mine constantly is spamming. even if i remove this console.log message, the IO state change does not register. is this video outdated now and not valid?
@KevinSidwar
@KevinSidwar 7 жыл бұрын
Hmmm, I honestly haven't tried it in a really long time. I will find some time today to follow through the instructions to see if something has changed and will get back to you.
@crashbash2020
@crashbash2020 7 жыл бұрын
Hi i actually managed to fix this myself, i had to change the script source for the socket.io js to be the local one (src="socket.io/socket.io.js") instead of the one available online. i assume at some point the one available online has had a change and the functions are slightly different? although its the same version so i don't see why... oh-well sorted now thanks for replying :)
@KevinSidwar
@KevinSidwar 7 жыл бұрын
Great to hear. Really glad you were able to get it working.
@DimitrovDime
@DimitrovDime 6 жыл бұрын
Thank you, this was exactly my problem ;)
@abdulwasey1814
@abdulwasey1814 4 жыл бұрын
@@crashbash2020 thanks worked for me too
@kimo74u
@kimo74u 3 жыл бұрын
thank you. but what about hardware??
@KevinSidwar
@KevinSidwar 3 жыл бұрын
Not sure what your question is. Maybe give a little more detail. Thanks for watching.
@tdragon87
@tdragon87 7 жыл бұрын
Hi! Great vid! Question though. Was the delay because of Heroku, using the free version and god knows where the server is located? Or was it something else. I'm looking for ways to dim and change color of a RGB LED strip. It needs to be snappy. :)
@KevinSidwar
@KevinSidwar 7 жыл бұрын
The delay is purely network latency so that can definitely vary on where the actual server is located. On the free version of Heroku they will spin down your instance when it's not being used but after a request that spins it up it will remain up for a while. Of course that probably doesn't prevent them from de-prioritizing incoming requests to free dynos. There are probably some things to do to speed it up but at the end of the day the request is running through a non-deterministic network of networking devices that could bounce you around who knows how many times. Hopefully that helps some. Thanks for watching.
@xx-cg8rv
@xx-cg8rv 4 жыл бұрын
Thank you for sharing this, very useful. Didnt know this channel before, good content.
@KevinSidwar
@KevinSidwar 4 жыл бұрын
Thanks so much. Glad you enjoyed it.
@drewpeer
@drewpeer 6 жыл бұрын
Hey, I think this was great! I'm going to do something like this with a motion sensor gpio, but I've only had experience in using python to work with gpio pins on my pi. I havent used node.js before. Does the node r-pi gpio mudule work exactly like the python version? - Thanks so much for the tutorial, Any chance you'll make another like this with pi and socket.io examples?
@KevinSidwar
@KevinSidwar 6 жыл бұрын
Thanks Andrew. The python gpio version is actually a little easier in my opinion as it doesn't have the callback complexities like NodeJS. The web portion would be exactly the same and you'd just change the Pi portion to be Python instead of NodeJS. You'd use RPi.GPIO and there is also a socket.io module for python as well. Here are some examples for the gpio piece. sourceforge.net/p/raspberry-gpio-python/wiki/Outputs/ Good luck on your project.
@rhidlor8577
@rhidlor8577 6 жыл бұрын
Great video, thanks for sharing.
@KevinSidwar
@KevinSidwar 6 жыл бұрын
Thanks Rhidlor.
@samsont81
@samsont81 8 жыл бұрын
grate video thank you for making it. i wanted to as how you would set up the socket io and express after installing them on the pi for the website?
@KevinSidwar
@KevinSidwar 8 жыл бұрын
+Samson Taye Thanks for watching Samson. I'm not sure I understand your question. Was something not clear?
@samsont81
@samsont81 8 жыл бұрын
+MicroCasts thank you for the replay I ment when you transferred it to the raspberry Pi what will the directories look like will it be same everything under magic dir (I'm not familiar with sublime text)
@KevinSidwar
@KevinSidwar 8 жыл бұрын
+Samson Taye Yeah, sorry that wasn't very clear. You just need to copy the client folder over the Pi and then run the npm install commands for the socket io client as well as the rp-gpio modules and you should be good to go.
@samsont81
@samsont81 8 жыл бұрын
thank you
@akshaykonde6871
@akshaykonde6871 7 жыл бұрын
Hi thanks well explained but I am trying to do same thing with gsm SIM808 board how to do that ? Thanks in advance
@KevinSidwar
@KevinSidwar 7 жыл бұрын
Thanks for watching akshay. Unfortunately I don't have a SIM808 board to mess around with.
@akshaykonde6871
@akshaykonde6871 7 жыл бұрын
OK thank you for your immediate reply
@ashkanradnia1456
@ashkanradnia1456 3 жыл бұрын
This amazing! Can you do 2021 updated version? maybe with node server and python client! Thanks again.
@KevinSidwar
@KevinSidwar 3 жыл бұрын
Thanks Ashkan. Super swamped right now to try to do an update. Most of the stuff should still be relevant and work though. Except for the flip phone. 🤣
@ashkanradnia1456
@ashkanradnia1456 3 жыл бұрын
@@KevinSidwar Thanks for your reply! I somehow managed to get it to work I will post the code here once finished for future references. Thanks again for the video it was really helpful.
@KevinSidwar
@KevinSidwar 3 жыл бұрын
@@ashkanradnia1456 That would be great Ashkan. Glad you got it working.
@Mars-lx5wn
@Mars-lx5wn 6 жыл бұрын
Amazing, really it is!!!
@KevinSidwar
@KevinSidwar 6 жыл бұрын
Thanks. Glad you enjoyed it.
@valdasmusvicas1605
@valdasmusvicas1605 6 жыл бұрын
Well done mate, been looking for some hint as this one for a whileeeee. It looks a little complicated but let's see, and lets try to make it happen ;)
@gilbojohn2489
@gilbojohn2489 7 жыл бұрын
thanks man ,this is great . you are the best
@KevinSidwar
@KevinSidwar 7 жыл бұрын
Thanks for watching!
@franciscoroca9444
@franciscoroca9444 7 жыл бұрын
I love you man!
@KevinSidwar
@KevinSidwar 7 жыл бұрын
Hey, thanks Francisco. Hope you're having an awesome 2018 so far.
@abdulwasey1814
@abdulwasey1814 4 жыл бұрын
Great work... for noobs like me it is hard to grab the start of this tutorial as few things are changed a bit. but overall everything is to the point. I want to send videos from the server to Rpi client and display them on startup. My Rpi end is sorted now I want to drop a video on a server then access this video on Rpi. I think socket.io will be a good approach for this work if anyone has done work related to this kindly guide me as I am new to Rpi and server-client thing. thanks again
@KevinSidwar
@KevinSidwar 4 жыл бұрын
Thanks for watching Abdul. Are you looking to steam video over socket io? I've never used it for that so maybe somebody else can chime in with some help on how to do that and if it's possible.
@sameers2699
@sameers2699 8 жыл бұрын
AWESOME video , THANKS A TON.
@KevinSidwar
@KevinSidwar 8 жыл бұрын
Glad you liked it. Thanks for watching.
@sameers2699
@sameers2699 8 жыл бұрын
In the same way can we add a temperature sensor and in the web app both the controller of led and the real time temperature readings should be displayed.is it possible to do like that ? Thank you
@KevinSidwar
@KevinSidwar 8 жыл бұрын
Absolutely. You could hook up a temperature sensor to the Pi (or other platform) and get those readings and send them along through the socket.io connection as well. Simple extension once you have the sensor hooked up and the readings coming into your Node.js app.
@sameers2699
@sameers2699 8 жыл бұрын
I see, Thanks for the information if possible can you please send the github link of your project? Thanks
@jeromeullmann2157
@jeromeullmann2157 9 жыл бұрын
Great experience !!! i spent a lot of (good) time on this tuto. Only one problem for me at 10'33 : the app.js don't receive the message updateState from www. I search a solution :).
@KevinSidwar
@KevinSidwar 9 жыл бұрын
jerome ullmann Do you get a client connected event on the server when you start app.js? You should see two "Client Connected" events. One from the browser and one from app.js when it runs.
@jeromeullmann2157
@jeromeullmann2157 9 жыл бұрын
MicroCasts , thanks for your answer, it was a mistake in the name of event..., now its ok ! ready for to go further !
@isaacmattingley5891
@isaacmattingley5891 4 жыл бұрын
This was my first attempt at working with JavaScript (was thinking I was going to use Python and web sockets). Your instructions and examples helped me to write a program that passed temperature information back and forth between a Pi and browser window and control the temperature setting with a slider. I'll link to my code/edits below, but I just wanted to say thanks for the great video! github.com/goldensun21/AirCon-Control-RaspberryPiZeroW
@KevinSidwar
@KevinSidwar 4 жыл бұрын
Hey Issac, so glad the video helped you. Also, thanks for sharing your project also.
@HumbertoPereira1994
@HumbertoPereira1994 7 жыл бұрын
Awesome video! I've just saved my life hahah 👊🏼👊🏼
@KevinSidwar
@KevinSidwar 7 жыл бұрын
Thanks Humberto. Have a great weekend.
Socket IO Rooms Tutorial (Backend part 1)
17:35
Coding With Chaim
Рет қаралды 43 М.
GIANT Gummy Worm #shorts
0:42
Mr DegrEE
Рет қаралды 152 МЛН
Counter-Strike 2 - Новый кс. Cтарый я
13:10
Marmok
Рет қаралды 2,8 МЛН
Wednesday VS Enid: Who is The Best Mommy? #shorts
0:14
Troom Oki Toki
Рет қаралды 50 МЛН
WebSockets Beginners Tutorial with Socket.IO
1:20:07
freeCodeCamp.org
Рет қаралды 105 М.
Raspberry Pi Tutorial 27 - Socket Communication 1
17:56
Alexander Baran-Harper
Рет қаралды 76 М.
My ESP32 Journey: Playing with TLS Certs
1:18:34
Kevin
Рет қаралды 489
Want to make a video chat app? Watch this video for WebRTC!
1:22:35
Good Morning Developers
Рет қаралды 47 М.
STM32 Guide #2: Registers + HAL (Blink example)
30:02
Mitch Davis
Рет қаралды 214 М.
Is this the best OSINT tool out there?!
17:10
stuffy24
Рет қаралды 369 М.
µCast #21: Installing Ubilinux on the Edison (Windows)
11:19
WebSockets in 100 Seconds & Beyond with Socket.io
8:31
Fireship
Рет қаралды 1 МЛН
GIANT Gummy Worm #shorts
0:42
Mr DegrEE
Рет қаралды 152 МЛН