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"
@KevinSidwar4 жыл бұрын
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-id3zf3 жыл бұрын
even in 2021 I found this totally relevant, really interesting and usefull!! Thanks
@KevinSidwar3 жыл бұрын
Thanks RJ, glad it could be of help.
@kensugai50088 жыл бұрын
You just made my week knowing I can communicate with my raspberry using socket.io and heroku! Awesome video!!
@KevinSidwar8 жыл бұрын
Thanks Ken, I really appreciate that. Glad it was helpful to you. Let me know if you have any questions.
@marklowe74318 жыл бұрын
Thanks a lot for making this video. Concise with no fluff. Cheers.
@KevinSidwar8 жыл бұрын
+Mark Lowe Thanks so much Mark. Means a lot. Have a good one.
@aminafoxdye4 жыл бұрын
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?
@KevinSidwar4 жыл бұрын
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.
@rajkopodinic5 жыл бұрын
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?
@KevinSidwar5 жыл бұрын
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.
@rajkopodinic5 жыл бұрын
@@KevinSidwar Thanks a lot for your help, it really cleared things up!
@partisan-bobryk7 жыл бұрын
you can use npm install socket.io --save It will automatically add it to your package.json
@KevinSidwar7 жыл бұрын
Thanks for the tip Tushonka and thanks for watching.
@GabeFromUtah10 жыл бұрын
Love socket.io and heroku on some days. Great video. Keep them coming.
@moherna33237 жыл бұрын
I love this work this mix between software and hardware. Thank you, man!
@KevinSidwar7 жыл бұрын
Thanks for watching Moissane.
@crashbash20207 жыл бұрын
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?
@KevinSidwar7 жыл бұрын
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.
@crashbash20207 жыл бұрын
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 :)
@KevinSidwar7 жыл бұрын
Great to hear. Really glad you were able to get it working.
@DimitrovDime6 жыл бұрын
Thank you, this was exactly my problem ;)
@abdulwasey18144 жыл бұрын
@@crashbash2020 thanks worked for me too
@kimo74u3 жыл бұрын
thank you. but what about hardware??
@KevinSidwar3 жыл бұрын
Not sure what your question is. Maybe give a little more detail. Thanks for watching.
@tdragon877 жыл бұрын
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. :)
@KevinSidwar7 жыл бұрын
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-cg8rv4 жыл бұрын
Thank you for sharing this, very useful. Didnt know this channel before, good content.
@KevinSidwar4 жыл бұрын
Thanks so much. Glad you enjoyed it.
@drewpeer6 жыл бұрын
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?
@KevinSidwar6 жыл бұрын
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.
@rhidlor85776 жыл бұрын
Great video, thanks for sharing.
@KevinSidwar6 жыл бұрын
Thanks Rhidlor.
@samsont818 жыл бұрын
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?
@KevinSidwar8 жыл бұрын
+Samson Taye Thanks for watching Samson. I'm not sure I understand your question. Was something not clear?
@samsont818 жыл бұрын
+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)
@KevinSidwar8 жыл бұрын
+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.
@samsont818 жыл бұрын
thank you
@akshaykonde68717 жыл бұрын
Hi thanks well explained but I am trying to do same thing with gsm SIM808 board how to do that ? Thanks in advance
@KevinSidwar7 жыл бұрын
Thanks for watching akshay. Unfortunately I don't have a SIM808 board to mess around with.
@akshaykonde68717 жыл бұрын
OK thank you for your immediate reply
@ashkanradnia14563 жыл бұрын
This amazing! Can you do 2021 updated version? maybe with node server and python client! Thanks again.
@KevinSidwar3 жыл бұрын
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. 🤣
@ashkanradnia14563 жыл бұрын
@@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.
@KevinSidwar3 жыл бұрын
@@ashkanradnia1456 That would be great Ashkan. Glad you got it working.
@Mars-lx5wn6 жыл бұрын
Amazing, really it is!!!
@KevinSidwar6 жыл бұрын
Thanks. Glad you enjoyed it.
@valdasmusvicas16056 жыл бұрын
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 ;)
@gilbojohn24897 жыл бұрын
thanks man ,this is great . you are the best
@KevinSidwar7 жыл бұрын
Thanks for watching!
@franciscoroca94447 жыл бұрын
I love you man!
@KevinSidwar7 жыл бұрын
Hey, thanks Francisco. Hope you're having an awesome 2018 so far.
@abdulwasey18144 жыл бұрын
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
@KevinSidwar4 жыл бұрын
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.
@sameers26998 жыл бұрын
AWESOME video , THANKS A TON.
@KevinSidwar8 жыл бұрын
Glad you liked it. Thanks for watching.
@sameers26998 жыл бұрын
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
@KevinSidwar8 жыл бұрын
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.
@sameers26998 жыл бұрын
I see, Thanks for the information if possible can you please send the github link of your project? Thanks
@jeromeullmann21579 жыл бұрын
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 :).
@KevinSidwar9 жыл бұрын
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.
@jeromeullmann21579 жыл бұрын
MicroCasts , thanks for your answer, it was a mistake in the name of event..., now its ok ! ready for to go further !
@isaacmattingley58914 жыл бұрын
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
@KevinSidwar4 жыл бұрын
Hey Issac, so glad the video helped you. Also, thanks for sharing your project also.