Placeholder Image

Subtitles section Play video

  • please go to the line the computer guy dot com, in order to view schematics, code and Maur for the projects that you are learning about.

  • Welcome back.

  • There's something that experience I T technicians know is that it's important to know that there are problems with your servers or your networks before the users know that there is a problem with the servers or the networks.

  • Many times, if you have some kind of monitoring system, some type of alert system and you find out that there is a problem, you can actually fix the problem before the end.

  • Users even know there was a problem, which means you don't have to talk to the end users, right?

  • As an I T technician, the less time you spend 1/2 in a talk with end users about who the hell knows what the better, right?

  • So if you have monitoring systems alert systems to tell you when there are problems with your servers and your networks, that could be very valuable, because you will know that there are problems before the end users d'oh!

  • And then you can try to fix those problems or at least be solving the problem when the end users come to start bothering you.

  • So the project that we're going to be creating today is a little network server up time monitoring system so that we're going to use an Arduino you know, with WiFi.

  • And what this is going to do is this is going to ping your default gateway.

  • It's going to paying a local server.

  • It's going to ping salesforce dot com, and it's going to ping google dot com.

  • And what we're going to get back is we're going to get back, the millisecond replies.

  • So how long it takes for these different servers to reply to ping requests so we can see again if the connection is good or if the connection isn't so good?

  • And if one of the servers is not reachable, then what we're going to do is we're going have a red led a light turnout, so we're gonna have our nice little oh led screen.

  • And so this led screen will show us what the current status of these different servers are.

  • And then, while everything is good, at least while the millisecond in reply is in the positive side, we'll have a green led.

  • You could just have this green led in the corner.

  • You know, if they led is green, everything is probably fine.

  • Then what will happen is if one of the servers is no longer reachable, the red led will turn on, and that will be able to alert you to come over and take a look at that little oh led screen and see what server is having an issue.

  • Are you having an issue getting to google dot com?

  • Are you having an issue simply getting to the Gateway?

  • This is one of those things where you can use it as a troubleshooting routine.

  • So you can say, OK, I can't get to google dot com, but I can get to my gateway.

  • What does that mean?

  • Or I can't get to the gateway and I can't get to google dot com, but I can't get to the local server.

  • What does that mean?

  • So this is a little tool that you can use, so you get a quick idea of what the network conditions are, and then you can start trying to solve the problem again before the end.

  • Users even know what's going on.

  • So with that.

  • Let's go over the work bench so I can show you how this little thing is built.

  • Then I'll show you the code, and then we'll bring it all together and show you how it works in the real world.

  • So here is our assemble project.

  • So the board that we're gonna be using today is the Arduino, you know, with WiFi.

  • So this has the full T c p i p for a wife I stack built on the board so we don't need an additional shield.

  • We don't need additional module or anything like that.

  • Then we're going to be using our 1 28 by 64 0 led screen that we've used for many projects.

  • This is an eye to see or i square see Display to see is a communication protocol that allows us to simply use to data wires to be able to communicate with this display and actually use simply to data wires to communicate with.

  • I think up to 112 different devices if you wanted to, But anyway, so we're just gonna be using this led screen as our display for the project.

  • And then we have a bread board and we have our standard red, red and green led lights here.

  • So we have the 220 ohm resistors on the positive side.

  • So these things are going to be powered by the digital pens.

  • So green is going to be powered by digital pen eight.

  • Red is going to be powered by digital pen and nine and so that will go to the 220 ohm resistors.

  • And then in our code, if everything is good, green light will show up.

  • If everything if something is wrong, the red light will show up.

  • Now, one thing with this Theo led screen and the are we know, you know, with WiFi an important thing is many times when we're using normal, aren't we know boards the S C l and the S D A.

  • Pens.

  • So those S S C L S d A.

  • Pens are in the back of the oil in the screen.

  • Those will many times we plugged into pens a four and a five on standard Arduino uno boards.

  • I will say with the Arduino, you know, with WiFi, there is actually a dedicated S c l S D A pen on this particular board and you will need to use that for this project to work.

  • If you try to plug into a four and a five simply funds is out for whatever reason.

  • So just plug in the S C.

  • L S d A into the appropriate ports on the Arduino board and so that that's really all that's required to build this project.

  • So let's go over and take a look at the code.

  • So here is the code for this project.

  • It may look a little complicated, but really, all we're doing is we're creating a whole bunch of different variables, and then we're simply printing out those variables.

  • If you take a look at the code itself, it is not complicated.

  • There's just a lot of it.

  • So let's go up here and take a look at the library's.

  • We're going to include So for this, in order to make the O led screen work, we're going to need these to libraries the out of fruit underscore SSD 1306 library.

  • You can get that by going to tools, manage libraries and install it from there.

  • Do make sure you get the ad of fruit s SD one a 306 library.

  • There are other SST one through six libraries out there, but they don't give you the functionality you need, so you'll need the ad of fruit one.

  • And then you also need the out of fruit key FX A library.

  • There's a core library for displays using Add a fruit libraries.

  • So you'll need those two.

  • And you will need to install both of these two.

  • Then we're also going to need the WiFi nine a library.

  • And that was where the library is wanted for this project work.

  • Now, the next thing that we're going to do is we're going to be simply defined our led pen.

  • So Green led is going to be pin digital pen number eight Red led is going to be digital pin number nine.

  • This is for turning on the ladies.

  • Then we're going to come down here, and we're going to define the information required for the oh led screen.

  • So to find oh, led with.

  • So the width is gonna be 100 and 28.

  • Define.

  • Oh, led height is going to be 64.

  • So depending on what oh led screen you're using.

  • You may have a different height and width, so just keep that in mind.

  • So for here I'm plugging in 1 28 64 If you have a different screen, you may need to plug in different numbers there.

  • Then the important one is the ol lady address again.

  • Remember I to see her.

  • I square see, electron ICS.

  • Protocol is an addressable protocol, much less like an I p address or a Mac address.

  • In order for the art we know to be a bit communicate with the device, you have to tell it what addressed that devices acts of this device is that zero x three.

  • See if you don't know what the address of your devices, there's an eye to see scanner project video that we did in the past s o just Google search I to see scanner or look for the video that we did on and basically scan to find out what your eye to see addresses.

  • Then we're gonna come down here, and they were going to use the Adam through underscore SST 1306 in order to create the display.

  • So this is how we're going to reference the led screen going to the future.

  • We're simply calling it display.

  • And then we're going to say it's a display of ol lady with comma led height.

  • So we're creating this display of this with height.

  • Then we're gonna come down for the information that's required for the WiFi.

  • So again, my s s idea My my WiFi network that I use for these projects, I created a test guest network with no password.

  • And so there's charm as s I d brackets equals and test.

  • So that's literally what the SS idea of my network is.

  • And then sharp ass for password equals, and I have it as blank again.

  • I've done that just for lab purposes in your situation to make sure you have passwords and said they were gonna come down.

  • We're going to create a variable for the WiFi status, so it's just gonna be in status equals W l idol status.

  • So this is going to be used for the wild loop in order to try to connect to the WiFi network.

  • Then we're going to come down, and we're going to create the variables that are required to help put the information that we need in order to actually do the network testing.

  • So the first thing that we're going to do is we're going to create a string, so make sure it's it's uppercase s string.

  • The first string is going to be Google, and Google is going to equal www dot google dot com.

  • So we will go to Ping Google.

  • It's going ping www dot google dot com.

  • We're gonna create a string sales force equals www dot salesforce dot com.

  • So these air to obviously, you know, public WiFi service is, and our service is that you may be using so again if you're using female.

  • If you're using other service is you can plug those domain names in there and then use those for testing.

  • I'm just using these as just General General wants to dio on, then the next thing that we're going to do is we're going to create a variable and I p address variable.

  • So I p a all upper case and then dress on.

  • We're going to call this the local server.

  • So what?

  • The local server actually is the local server is actually, um, my own little laptop here, right So my little laptop, it has an I p.

  • Address of 1 72 not 16 not 42 5 So doing this whole troubleshooting thing, we're going to use this as something to test against.

  • So basically, can we paying a local server.

  • So for that, we're going to call local server and then there is no equal.

  • There is no equal.

  • We just simply going to parentheses and then 1 72 comma comma, not period, because that would be way too damn easy.

  • 1 72 comma, 16 comma, 42 comma, five close parentheses.

  • Semi colon again.

  • This is one of those things that that will screw you up in the tech world.

  • I don't know why it's not periods, but for whatever reason, they decided No, we're not gonna make it periods.

  • We're gonna make it commas here.

  • If you don't put in Kamas, it's not gonna work, right.

  • So anyway, so that's that's if you for if you want to peeing and i p address versus domain.

  • So this is how you they're variable.

  • You would use your opinion, a domain name, and this is how you would do it if you're gonna be trying to ping it.

  • I p address.

  • We're gonna come down here or we're going to create int results.

  • So Google results, Salesforce results, server result and gateway result.

  • So these are going to be the millisecond response times that we will be getting back from the pinging on.

  • Then we will test against those They were going to go down, and we're going to actually set up the environment so avoid set up.

  • The first thing that we're going to do is we have to set the pin modes for the green and red led pens to output a green led output Red led output pretty standard.

  • Then we're going to do a serial adopt begin at 9600 just to just to make sure again for troubleshooting purposes, make sure that the system is actually working.

  • Then we're going to display at the beginning.

  • So the display, That's what we created up here.

  • This is the O led screen, so display not begin.

  • And with that, we feed it this information.

  • So it's the begin function and says Dave, SST 1306 underscore switch Pat vcc And then this is where we feed the O led address.

  • So that address up here is that I too see, I squared C address.

  • So you plug that in there, so that starts both of those, Then the wild loop here.

  • This is what we use to connect to WiFi network.

  • So while status is not equal to W el under store connected serial print So this is printing to the serial monitor.

  • So that's one thing you have to start paying attention to is whether it's display print or serial print.

  • So this is pointing to the serial monitor attempting to connect to a network the network name S S I D.

  • And then the status equals uses function.

  • Wifi dot Begin feeds E S s i.

  • D.

  • It's the password and tries to connect to the WiFi.

  • It will delay, and then it will continuously loop until it is connected.

  • Once it has become connected, then we're going to create a few variables down here so we can actually print these out.

  • It's kind of like a splash screen.