Realtime GPS Tracker Using Raspberry Pi (Realtime testing) : Part 2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone Miyagi it is the singing and also the final part of our project real-time GPS tracker which lets very pipe and in this video we will write the Python code for our Elsberry pi so that it can send the data to our webpage which we have built in a previous video and also we will see in real time how much efficiently our tracker is working so let's get started [Music] so before you was this video made sure that you have watched my previous video where I have shown you how to make this GPS tracking web page from scratch and in this video we are going to just write the code to send a GPS data to this web page from our as very PI and also if you don't know how to use a GPS module it has very PI then you can watch this video how to use new 6cm gps module des berry pie as here i have shown you how to use gps module with test berry pie and also how to write a Python code to access the GPS data here in this video we are going to use the same Python code with very few modifications so make sure that you have watched these two videos before proceeding further as always the links of the videos are in a description so in this video at first we have to write a Python code to send the GPS data to the web page from the raspberry pi so now let's write the code first so I have written this Python code in one of my previous videos so in this video I have written this Python code and I have explained how it works so you can watch this video for detail in explanation of this code so here I am NOT going to explain you the code again now just let's run the code in raspberry pi and see first output so first we have to connect to the raspberry pi so here I am using putti and I will connect to SSH but you can use beans your diet HDMI connection whatever you want if you are using SSH you can write less Barry PI dot local in IP and the port will be 22 the default username is PI and a password is raspberry now I have logged into my dad's very PI now let me change the folder here so here I am in my desktop and let's create a file here new fight on file so let's say the name is G ps3 so nano GPS 3.5 now just copy the code and paste it here now save it using control X and then press Y now we have to run the score so before you run this code you need to set a few things now I have already talked about all those things in my dad's verify with new six and GPS module video so you watch that video and do all those setups because without those this code is not going to work so make sure that you have did all those and now let's run this code so right Python and the name of the file which is GPS T dot PI and now as you can see it is printing the GPS data the latitude and longitude okay so here it is printing it and now we have to send this data to our web page so we have to modify the code now you can get this modified code in our web page so let me modify the code now here I am copying the code from my website to save the time now the link of those sets in a description so here we need to input few more libraries now this side like this libraries are for PubNub because we need to use pop enough to send the data from our Asbury pie to web page and we are using pugna because you know our web page also abused PubNub now here we need few more variables for PubNub so here the most important one is the channel name which is rest by tracker the same channel name you have to use in the web page so if you remember in our last video we have used the same rest by track a channel name and as you can see we have used s by tracker so the same channel name we have to use in the Python code also and now then you have here the publish key and subscribe key so in the last video I have shown you how to get this is from the website so here I am copying the keys from my account so don't copy from here because I will delete this keys after the tutorial so make your own keys and then copy and paste them in the code and it is totally free so definitely you can do that and that's it now finally here the thing will be same almost so we need to create a public object and and then we have to subscribe the channel using this partner object so basically what will happen is that we our object have to subscribe to the same channel and then publish the data on that channel so that our webpage n get those data from this channel that's how you have to subscribe to this channel from our Python code and now finally here instead of printing out the data we have to send the data now to do so let me indent the code a because indentation is important in Python so sorry yeah so if you if you can see here here we are sending the publishing those GPS data so basically in this loop we are getting the lat and long latitude and longitude then I we are putting this data in this lat and long variable and then we are sending this variable through the messages and we are publishing them on the same channel and finally here we are printing for the confirmation and here we have a exception handling so let's copy the code and now create a new file in celesta GPS 4.5 and paste the code now control x and y to save this code and let's finally run this code so if you run this code as you can see and now let me refresh my webpage a so make sure you verify is connected to the internet except it will not work so now you run the code and in few seconds you will see as you can see it is printing so that means it is sending the data ok it is finding a time token so that means it is sending the data now here if we press start tracking as you can see our webpage I received the data and it is showing me in the map so this is currently my location here and if i zoom it so as you can see so actually I am inside of my home and inside home GPS doesn't work pretty well that's why it is little bit fluctuating but so let me take a small work and we will see how much accurately it is working so as you can see here I am taking a smaller home with the GPS tracker and in the last screen you can see that I am going through the rows with it and I have connected this with my power bank for the power and also I have connected this with my phone's watts hotspot so that it can get the internet access but anyways you can connect this with your dongle a GPS module GPS GPRS module or maybe a portable or spot anything but just make sure that your does verify is connected to internet except that it will not work and also I have first worded this video and as you can see that our tracker is working perfectly in real-time situations so in the last video many people asked me why I am using a Raspberry Pi to make a simple GPS tracker easily one can make this using Arduino but the actual thing is that definitely using our do you know we can make a GPS tracker but if you are making a big project like maybe a robotics car or maybe a drone or something like that and maybe in that project you want to add a GPS feature like this in that case you can use this whole project as a small part of your big project and in that case it will be very much useful anyways thank you for watching my video hit the like button if you have enjoyed this project and make sure you have subscribed to my channel for more this kind of videos and projects
Info
Channel: SPARKLERS : We Are The Makers
Views: 30,512
Rating: undefined out of 5
Keywords: robotics, raspberry pi, neo 6m gps module, sparklers the makers, gps tracking, gps tracking with raspberry pi, pubnub, google map api, javascript, python, geolocation api
Id: EFBNMPnWpfU
Channel Id: undefined
Length: 8min 49sec (529 seconds)
Published: Sat Aug 10 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.