top of page
Search
  • Writer's pictureSenthil Pitchappan V

Device Tracker using Flask

This was made to use it with Raspberry Pi for a project I am working on. I guess this is the best API Maps you will ever find on the internet. Easy to use, Free, Opensource.


Used Application:

  1. Flask Web Framework ( pip install flask )

  2. Mapbox

  3. SQLite3 Database ( pip install db-sqlite3 )

  4. Termux ( if wanted )


Download the Files from my Github link


To Find a Location for your Phone

python3 mobile-location.py
  • The output will show you the latitude and longitude of your current location.

  • Further, the same logic which is applied in raspberry can be done to track your phone also.



To Make in Work with Raspberry Pi


A GPS Module is connected to raspberry pi, which constantly updates the database with the current location

python3 main.py

syntax: INSERT INTO map VALUES (datetime('now','localtime'), LATITUDE, LONGITUDE)

INSERT INTO map VALUES (datetime('now','localtime'), 21.56463, 77.464734)
  • See that the rocket image in the map changes the location according to the location you give


For using it all over the World

 ./ngrok authtoken YOUR_AUTH_TOKEN 
  • Run

./ngrok http 5000
  • Copy the link and paste it in templates/track.html line 65 with an extension '/locationdata'

eg: var url = 'https://cfa635282g00.ngrok.io/locationdata';


Now the site in port 5000 is globally available all over the world


Output:


17 views0 comments

Recent Posts

See All

コメント


bottom of page