 Hello JS for 2013. Welcome everyone. How are you? Are you having fun? Okay, the interaction part has already been done and I think yeah, five minutes is not bad for India. It's okay You can reach me on Twitter, that's Rikarun. I am on GitHub. All these code that I have used here on GitHub and some Repositories that have no code at all. So All are up there. So everyone was talking about NodeJS and and then I couldn't stay away from it. So One day I realized that no, I should use NodeJS, but still wasn't clear like what to do with NodeJS and One of the biggest factor or an inspiration was last years JS who were you know, I Wanted to emulate Rakesh Bhai, but I wasn't comfortable with a three fourth to that level So I'll manage with it full trouser, but Yep, so So I did buy a Raspberry Pi. So, you know couple of guys out there from my office my friends He did buy too. No, we were all inspired. We got it, but Big disappointment like, you know fight well and be machine. What can we do on that one? And to be honest, right? What is Raspberry Pi? It is a downgraded mission. You have not done anything significant with a big capacity laptop. What the hell are you going to do with a Raspberry Pi? So there is nothing special about Raspberry Pi in that sense However, when you try to do things Like you have to figure out where it fits in the domain, right? So it's not that you can do magic with Raspberry Pi, but you cannot put the whole laptop on this one So that's where it fits in. You need to figure out where the things go Where the the things are rightly fit into and then do that So, yeah So, I don't know how many people I've heard about R2, you know And why again one more term like, you know, why not Raspberry Pi and use the stuff? So some some technical stuff out there Raspberry Pi cannot do anything that is analog. It's it's More on to the you have a GPIO pin So this is how a Raspberry Pi look like and you have this GPIO port and then GPIO pins are basically digital pins and Then if you want to do a little bit more on to analog stuff, you can use Arduino So so you can program Arduino With an interface, there's an idea for Arduino and the language is wiring So you can have a setup phase you can have loop and then you can do stuff out there in Arduino. However That's not how I have done and the reason being This is a different language set all together and I've and still struggling with JavaScript How am I going to do and learn wiring? So no So you can't repair Arduino to Listen to JavaScript. So you do that by using a library called Johnny five. So Johnny five is a node library which can connect to Arduino board using a firm attack protocol. So are doing a board here This are doing a board. I think I'll come to the No, I will do that, you know, I think too much too many switching will be a problem, right? So let us show the revised and closely How did you see that? All right. So this device has this Raspberry Pi This is the Arduino and the Raspberry Pi and Arduino are connected with the USB cable and there is this speaker So Raspberry Pi has an audio output. So that's where the speaker is hooked in It doesn't have wireless capability natively. So you have a wireless card so the Arduino has output Which are both digital and which are PWM capable. So if you want to control the speed, you'll use analog PWM one If you want just to switch on and off kind of scenario, you can use the Normal digital pins So So that's about No Getting it connected to Arduino. Yep. So I did put things on cloud, but slightly different cloud So there's something on firebase if you have heard of firebase is an online online cloud Sorry, and this again has to do with, you know, everyone is talking about No SQL databases and stuff like that, you know, I heard this joke Someone was talking about Recruiter called up a guy. He said and asked do you know SQL? He said I No, I don't know SQL and the recruiter said he knows no SQL. So so to keep up with the trend I have used no No, not an RDB. I'm not non schema based stuff. So the firebase Allow it's a cloud storage. It's a key value pair store. You can push anything and on top of it It allows you to bind on events. So whenever there is something changes and that entry point can or the connection point can be anywhere so we'll get to see that but It allows you to Listen to Paul, you know certain events and then what happens on disconnect. So there are there are quite a few good APIs coming with Firebase. So that was my choice of cloud storage here So I knew I would get nervous So he's my son three years old. So I'm a little calm now. Just wanted to see my he's my guru by the way So just wanted to keep things calm Right, so What are these stuff everything is on github you have three different part to this thing one is the robo stuff and That's the main code running on node.js on Raspberry Pi You don't have a robo phase Which is what you are seeing like, you know It's a surprise phase. I don't know how many of you can see it right now But we'll focus on it to one sphere on the demo and there's a robo control which is a controlling application for that So all these, you know code bases up there on GitHub and and with a disclaimer. I've used semicolons everywhere. So it can move it can video stream slide disclaimer my wireless, sorry the Hub didn't work. So I do have only two ports. I can show you streaming But I like to connect the motion part out and then show you streaming and Then it can talk you heard him talk can show emotions will come to that So, how does this work basically the the robo that we you see here has the node.js code on Raspberry Pi there's a phone gap app that you are seeing and then the Cloud which is a Firebase Stuff and then the Firebase name is the app name is or the storage name is next.fibers.com There's a control app It's web mobile web doesn't matter whatever, but we do have a mobile web right now We have seen it I think most of the people know and Not spending much time on that. How do we know? I don't know. There are different versions and I don't know, you know, it's probably on the middle range one You have are doing a lily part which are very small 600 rupees stuff and you can wire probably very small No sense, you know, you can you know put it or use it for Engaging a new connecting multiple senses. So depending on your use case you can decide which one do you really want? From the direction part DC motors You need to reverse the polarity to drive it forward or backward So to do that you have certain bridge controllers like LM293D Which enables you to control the direction of the you know the motor. So that Direction control is given by Arduino and then based on the direction control you can decide whether it's going front or back. Excuse me, I need to tweet for a while. Sorry for keeping on hold Just hang on. I'll be around. So the the main purpose, you know Okay, the The essence is that you know, it's fun. You know seeing a robot movies. It's really fun, but I like to move it. So Can I have the camera, please See, it's very difficult to focus when you move. So this please show the face, please Guys, I do not have any profanity filters. It's fun. So I actually wanted to get into more details like you know, there are And I now seriously need to switch off the speakers. I guess Yeah, we'll do it. It is kind of things and then who who actually contributed to the mess and then You have the NFC details, right? We do we do so Right So Can you come back to the control interface? so so It's not limited where you do it You have multiple interfaces that you can do the thing from So he's very forward-looking. So he doesn't like moving backward that fast, but it still moves So I want to show you the other fun part of it the Stuff that you see the face is a phone gap app and Then it's not just that face. That's the incoming stuff for that Your phone your mobile phone pretty much is a very very serious You know device it's quite a lot of sensors and and it's pretty easy to hook into that with This one phone gap or anything if you really don't want to get into the native thing And by the way, it's Android. It's not iOS and and You know Android works too. Yeah, just that and we don't pay pay enough just for the whatever so So what this does is you don't have the accelerometer you do have compass you have geolocation So somebody if you want to do the reverse mapping you can figure out that and it is pretty much And I'll choose every three seconds This is pushing the data back to the cloud and Go to the interface that's that's the beauty of you know having something on the cloud The same data is pretty much being captured out here in a different interface Where you can you can do anything you can get the data plotted on a plotter on a map Whatever you want to do on that one. So the fun part apart You could really wire something that You know With with just plain cloud storage on and a JavaScript you can get the hardware control and and that is really really You know fun. You could help people those who are out, you know, and then there is some kind of you know, I Did a quick Google search for a knows wheelchair which was costing around 8,000 rupees a Motorized one cost Minimum of 80,000 plus I correct me if I'm wrong. I just did it So so it cannot be that high it cannot be that insane and how many features do you really get? so for me These all could you know help in reaching out such single creating products in in that way that could help As a society so we should we should be getting into hardware software integration Not just you know fun part, but this this can you know take us to a next level as well Yep, I think the timings are fine, right? I'm open for questions Yeah, you can probably tweet the question and it will read out Like what would be the tips you would give to people who are getting started with that right now Raspberry Pi like What was your journey so far like what was the challenges you face and what was the the movement of enlightenment? Okay, so No, basically, it's about No, I believe in Doing things without any proper goal and then getting it started it the getting started is the key point and then No, it all started with a very basic idea. I'm not still saying it's something good, but I I'll show you what I started with and then that could add to some perspective When I got the Raspberry Pi initially as I told you right in a couple of days I didn't have any clue like what to do and then This was the first thing that I did send that, you know it's like when one when someone talks about JavaScript a LED blinks and and that was like kind of you know extreme happiness for me like you know and and That was a starting point So you don't get to hardware control from the day one, but at least you start from very Minor basic stuff and that's that reduces complexity if you if you start working, you know You know working on an LED and stuff like that that reduces complexity. So For those who start up it's always good to read on Johnny five great library and you should Start, you know exploring things about Node.js and stuff like that, but from the hardware perspective You are going to get your hands burned for sure. I have burned the motor drivers at least couple of times. So So there is no easy way to do it with the I know you don't have a Bug fixing phase out here. You'll have to buy the new one. So But having said that not too tough so So what part of your logic is on your computer what part is on Raspberry Pi and Can you repeat that this so yeah, so what part of your logic is on the computer? What part of it is on the Raspberry Pi and what part of the logic is on the Arduino? Okay, just to clarify things I would call Raspberry Pi as a computer and then it runs a basic version of Linux and then the Node.js is the Node.js and our application.js file on top of it. So everything that Is on board that means controlling the hardware through Arduino Pushing information back to Cloud and then taking information from cloud all those things are done from Raspberry Pi now, this is a model where my controlling app doesn't directly contact this guy everything Works on messaging directly on cloud. So you go change a field out there and what is the you know interested party? We'll respond to that change Okay, so the processing also happens in this so the tweet that you get I get the tweet I process the tweet and then I so I'll show you the tweet part of it So I do have a Twitter handler So They do have a helper and there are no this Cowboy is an image recognition thing. I do have plans for so many other stuff, but not implemented So let's go to the Twitter So don't get excited by this private key stuff. It's it's Robo second. So you are not going to get anywhere So what it does is it now report returns a stream search thing The module returns a stream search. I'm not implemented the general search. So you can see here that Whatever your topic that you are Passing in is No, give an out there and there is a next level of abstraction that's happening here Which is like oh, sorry So you do have a receiver module here and then you extend the that that's kind of an events receiver and then you instantiate it with a string that that's why it responds in order of oh and then on Upon getting the Robo stuff or you know the event Because it is extended from the nodes event emitter class you do have Emit stuff here. So you do a emitter custom event that stream dot tweet and Then going back to your Robo JS Which is like on that event, which is a custom event then Just do whatever you want to do with the Weed so that's how the model works. So when it comes there is a you know tweet related to that It's an online stream tweet that it's being and It's it's online like in the sense the moment you start speaking something So Strange no one is talking to this food right now and someone speak about this book No, can someone have the term JS who in the tweet someone tweeted? Yeah, it's me. I committed so So it's the same thing right you know This is the same exact same logic where you hang on to a stream and then the moment you get this thing You start processing it Yeah from basic question like if I am if I care if you are able to do that using Arduino Then you should be able to use it with any subject like this any PCB we can connect you under Absolutely, so that's that's what my main point is it's it's not it's like what he's shown yesterday You don't need to have raspberry pies and stuff like that to do it It's one way to do it but not mandatory way to do you have a number of ways to do it I just that I chose this way doesn't mean that that's a way to on that's the way or that's the only way to do it This device control Becomes more exciting with Johnny five around and that was an exciting part forming That you get to control the hardware with JavaScript directly So that was the only thing you can basically do the same thing with any hardware How much did it cost you to build the robot the wheels are 80 rupees them 200 rpm motors are 200 rupees. Sorry 120 rupees Raspberry Pi 2400 are doing a thousand five hundred speakers 80 rupees The motor control board hundred rupees the chassis 120 rupees The Nokia mobile charger for powering Raspberry Pi 1400 LDR cheap Okay, there's a webcam in here I Just a webcam in here. I'll pick it out after sometimes so I don't count it in here. Yeah, so so overall Yeah But the part is like, you know Except for the tires and I can pretty much reuse everything and and I'll probably fit in tires to build a stack or something like that Yeah, but everything is not waste. It's still reusable Yes, so I do have a Small Wi-Fi dongle the which is configured to connect to my Wireless LAN router and this is connected to internet the phone also is connected to the same router. Yes Yes, so I do not have any communication happening between Raspberry Pi and the the phone gap app Everything is through the cloud. So the fire bad Raspberry Pi talks to the cloud Firebase talk to the sorry the phone gap app talks to the cloud the controlling app talks to the cloud So everything is up there Where do you get all this components in Bangalowic? Okay, so I think I think I should say this right You know They are they are very good and they do have a lot of things like there is one shop called home technologies in SP road Okay, so so The you you pretty much get everything out there and See these sensors out here It's a PIR sensor what you see in the Shopping malls to automatically open the doors The ultrasound sensor these those things I got from eBay. So you need not limit your search to any specific thing There are quite a lot of sensors that you can really attach to this Okay, we have time for one last question anyone ask question. Yes for 2013. I saw about 10 tweets They're saying it not a day. It's somewhere. They're all there. What is that? It not a day. How long Okay Okay, awesome on that note guys big round of applause for Shri Jayesh There are people on the live stream clapping as well for you