There's somethingthatexperience I T techniciansknowisthatit's importanttoknowthatthereareproblemswithyourserversoryournetworksbeforetheusersknowthatthereis a problemwiththeserversorthenetworks.
Manytimes, ifyouhavesomekindofmonitoringsystem, sometypeofalertsystemandyoufindoutthatthereis a problem, youcanactuallyfixtheproblembeforetheend.
Usersevenknowtherewas a problem, whichmeansyoudon't havetotalktotheendusers, right?
Asan I T technician, thelesstimeyouspend 1/2 in a talkwithendusersaboutwhothehellknowswhatthebetter, right?
Thenwhatwillhappenisifoneoftheserversisnolongerreachable, theredledwillturnon, andthatwillbeabletoalertyoutocomeoverandtake a lookatthatlittleohledscreenandseewhatserverishavinganissue.
Areyouhavinganissuegettingtogoogledotcom?
AreyouhavinganissuesimplygettingtotheGateway?
Thisisoneofthosethingswhereyoucanuseitas a troubleshootingroutine.
Soyoucansay, OK, I can't gettogoogledotcom, but I cangettomygateway.
Whatdoesthatmean?
Or I can't gettothegatewayand I can't gettogoogledotcom, but I can't gettothelocalserver.
Whatdoesthatmean?
Sothisis a littletoolthatyoucanuse, soyouget a quickideaofwhatthenetworkconditionsare, andthenyoucanstarttryingtosolvetheproblemagainbeforetheend.
Usersevenknowwhat's goingon.
Sowiththat.
Let's goovertheworkbenchso I canshowyouhowthislittlethingisbuilt.
Then I'llshowyouthecode, andthenwe'llbringitalltogetherandshowyouhowitworksintherealworld.
Sothishasthefull T c p i p for a wife I stackbuiltontheboardsowedon't needanadditionalshield.
Wedon't needadditionalmoduleoranythinglikethat.
Thenwe'regoingtobeusingour 1 28 by 64 0 ledscreenthatwe'veusedformanyprojects.
Thisisaneyetoseeor i squareseeDisplaytoseeis a communicationprotocolthatallowsustosimplyusetodatawirestobeabletocommunicatewiththisdisplayandactuallyusesimplytodatawirestocommunicatewith.
I thinkupto 112 differentdevicesifyouwantedto, Butanyway, sowe'rejustgonnabeusingthisledscreenasourdisplayfortheproject.
Andthenwehave a breadboardandwehaveourstandardred, redandgreenledlightshere.
Now, onethingwiththisTheoledscreenandtheareweknow, youknow, withWiFianimportantthingismanytimeswhenwe'reusingnormal, aren't weknowboardsthe S C l andthe S D A.
Pens.
Sothose S S C L S d A.
Pensareinthebackoftheoilinthescreen.
Thosewillmanytimeswepluggedintopens a fourand a fiveonstandardArduinounoboards.
I willsaywiththeArduino, youknow, withWiFi, thereisactually a dedicated S c l S D A penonthisparticularboardandyouwillneedtousethatforthisprojecttowork.
Ifyoutrytopluginto a fourand a fivesimplyfundsisoutforwhateverreason.
Sojustpluginthe S C.
L S d A intotheappropriateportsontheArduinoboardandsothatthat's reallyallthat's requiredtobuildthisproject.
Solet's gooverandtake a lookatthecode.
Sohereisthecodeforthisproject.
Itmaylook a littlecomplicated, butreally, allwe'redoingiswe'recreating a wholebunchofdifferentvariables, andthenwe'resimplyprintingoutthosevariables.
Ifyoutake a lookatthecodeitself, itisnotcomplicated.
There's just a lotofit.
Solet's gouphereandtake a lookatthelibrary's.
We'regoingtoincludeSoforthis, inordertomakethe O ledscreenwork, we'regoingtoneedthesetolibrariestheoutoffruitunderscoreSSD 1306 library.
Youmayhave a differentheightandwidth, sojustkeepthatinmind.
Soforhere I'm pluggingin 1 28 64 Ifyouhave a differentscreen, youmayneedtoplugindifferentnumbersthere.
Thentheimportantoneistheolladyaddressagain.
Remember I toseeher.
I squaresee, electronICS.
Protocolisanaddressableprotocol, muchlesslikean I p addressor a Macaddress.
Inorderfortheartweknowtobe a bitcommunicatewiththedevice, youhavetotellitwhataddressedthatdevicesactsofthisdeviceisthatzero x three.
Seeifyoudon't knowwhattheaddressofyourdevices, there's aneyetoseescannerprojectvideothatwedidinthepast s o justGooglesearch I toseescannerorlookforthevideothatwedidonandbasicallyscantofindoutwhatyoureyetoseeaddresses.
Onceithasbecomeconnected, thenwe'regoingtocreate a fewvariablesdownheresowecanactuallyprinttheseout.
It's kindoflike a splashscreen.
SowhentheArduino, youknow, withWiFibootsup, it's abletogetthegettheinformation, thenoneofthethingsthat I wanttodois I wanttoprintoutsomeofitsinformationso I canverifythatit's gettingtheinformationthatitneeds.
Likewhathappens?
WhathappensifwecanconnecttotheWiFi, butitdoesn't graban I P addressoringrabs, Likelikesomebodyscrewedupthe A c p anagrams, thewrongsubjectmaskorsomethinglikethat.
So I wanttoprintoutthatinformation.
Andsowhat I'm goingtobedoinghereiswecreate a stringfor S s i d.
Sowe'regoingtohave a variablecalled s s I d.
Andthatisgoingtoequalthisfunction.
Sothisgetswhatthewife I s s I d currentlyis.
Thenwe'regoingtocreate a variablefor I p address, andthatisgoingtogetwhatthelocal I P addresses.
Theyweregoingtocreate a variableforgatewayandusingthisfunction, theWiFigateway i p.
Sowedodisplay, notprint, andsosimplygonnasay, S s I d e colonandthenprintline.
Sothenit's gottosay, S s I D E Colon.
AndthenitwillsaywhattheSSideastestthat'lldodisplaydotprintonthenextline I p printline, Whateverthe I P addressis, thenonthenextlineofsubnetprintlinewithsomethatmaskisGatewaywiththegateway.
Sothisway, basically, we'rehavingessentially, like, a diagnosticsplashscreen.
It's gonnatelluswhatthe s s i d isthatit's connectedtoisgonnatelluswhatthe I P addressesisgonnatelluswhatit's somethatmaskisandwhatit's gatewayisitisborn, understandiswhatitactuallyislikewhatitactuallyreceivedfromthe D a.
Sothatlittlethatlittleheaderthat I hadbeforeatNetTesterthing, we'rejustgonnaleaveitthesamewaySettextsizetotosettextcolortowhitecursorto 00 weresimplyjustgoingtocallit a tester.
So, basically, ifit's lessthanzeronow, I haveseensomepeoplewhentheydothecodewheretheysaylessthanorequaltozero.
When I found, though, isthatmanytimeswhenyouget a zeromillisecondresponsetime, thenetworkdeviceisactuallystillworking, andsoisreallywhenit's negativeone, right?
Uh, letmetellyou, backwhen I usedtosupportbusinesses, ifthat's littledevice, I couldgetsuctioncupofthewall, andyoucouldjustturnonledlightswhenevertherewas a problemconnectingdifferentservers, thatwouldhaveactuallybeen a veryuseful, veryvaluabletoMay.
Plugallthatinformationinto a projectlikethis, havedifferentoutputsfor, youknow, ifififyou'renotabletopingtothosethingsandthatcouldbe a greatresourceforyouagaintostarttorealizethatthereis a problembeforebeforetheuserstartcomingtoyoutheotherthingtooagainwiththoseif l statements, somethingyouthenyoumaywanttodioisifthemilletmillisecondresponsetimesaretoohigh.
Onethingtobethinkingaboutis, ifyou'redealingwithservers a lotoftimes, theserverdoesn't goallthewaydown.
Isjustperformancereallygetsprettycrappy.
Andsoyoucouldhavesometypeofthresholdinhere.
Notonlyisitbelowzero, youget a redlightgoesoff, butmaybeifitgoesabove 1000 a yellowlightturnsonyoucango.
Okay, I knowwecanstillconnecttotheserver, butobviouslythere's somekindofnetworkproblems, andthat's oneoftheissuesyourunintointherealworld, withuserswhereuserscangetto a website.
Andthenalsosomebodythinkaboutisifyouhave a teeny, tinyscreenagainifyouhave a teenytinyoil, anyscreenandlovetheseoilladyscreensbecausetheycouldgiveyou a lotofinformation.