Recording and reading vehicle route (without GPS)

Recording and reading the vehicle route (without GPS) Usually, when it comes to tracking the position of an object, it immediately comes to mind some microcontroller paired with a GPS receiver.
But there is a less common way of tracking, via Wi-Fi geolocation- Google.
In this article, the wizard will tell us how to track the trip of the car using the ESP8266 board and the Google service Geolocation and Maps API.
Tools and materials: -Wemos d1 mini (4M version); – WIFI + RTC expansion board; -USB cable; -SD card;
Step one: Wi-Fi geolocation
User can send list of wifi hotspots to location service in google API, and GPS coordinates for each point will be set. Using this basic concept, this project was made.
The picture below shows the route of travel by car. The device stands in the car of the master and records all his trips. Trip routes are saved and placed on the ESP8266 microcontroller.
This data is then placed on a web server running on the D1 mini. On the home page, you can view the list of trips. You can click on any ride to view it separately.
To explain how Wi-Fi geolocation works, the wizard created a sample code (esp8266_geolocation.ino + cert.h). When D1 mini is loaded, it runs the get_my_location () function. In this function, it scans the surrounding Wi-Fi networks and lists them. It then prepares the data for epIcall. It then connects to the Internet, establishes an SSL connection with Google, and makes an API call. When he receives a response, he prints it out. And if everything goes well, it gives out GPS coordinates linked to Wi-Fi points.
The user needs to get an API key from Google and enable the geolocation service on it. Here's how you can get a GPS location knowing the surrounding hotspots.
Recording and reading the route of the vehicle (without GPS) Recording and reading the route of the vehicle (without GPS) Recording and reading vehicle route ( without GPS) Step two: device
The scheme is not complicated. The device has a Wemos D1 mini connected to two modules – an SD card and a real time clock. The SD card is used to save the trip files and the real time clock is used to time the trips. As many people know, the ESP8266 does not have an internal clock, so an RTC is needed. Later, the wizard found an expansion board that has an RTC on one side and an SD card on the other. This makes the device even simpler and smaller. The master printed the case on a 3D printer, connected a USB cable.
Recording and reading the route of the vehicle (without GPS) Recording and reading vehicle route ( without GPS) Step three: device operation and code
The device is connected to one of USB sockets in the car and is powered only when the car is running.
When the device boots up, it starts looking for a home Wi-Fi network. If the module finds it, it connects to this network. This allows you to access your travel history.
If he does not find his home Wi-Fi, it is assumed that the car is on the way, and the route recording starts. A new .log file is created. The current time stamp is used as the file name. Then it starts saving a list of found APs every 5 seconds. These “files” are called “Trips”. To convert these rides – using a geolocation API call – all you have to do is click a button and it will generate a new file with the same timestamp but with a .gps extension. The file contains results containing GPS coordinates.
Then you need to use Google Maps to plot the GPS coordinates on an interactive map.
Unfortunately, dealing with large files on a web server was a bit tricky. The ESP8266 only has 40KB of memory. When the wizard tried to load large files from the sd card into memory, the device crashed. The solution was to use the clipboard to send chunks of the file until the entire file was transferred.
Recording and reading the route car (without GPS)  Recording and reading vehicle route (without GPS) The code for the firmware of the microcontroller can be downloaded here.
The setup wizard is built into the code and you just need to follow the instructions.
Recording and reading the route of the car (without GPS)


Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button