This is an old revision of the document!
Student: Andrei Ursulean (ACES)
The project aims to offer pet owners a way to track their small pet (about the size of a cat or a dog) in real time from anywhere. Using this product, they are aware of the current location of the pet, they can see a history and they can receive SMS alerts when the pet leaves a designated area. The system uses mobile data via LTE and GPRS so it is not dependent on WiFi which is useful for owners that own a house and leave their pet to roam free, but it is also useful for owners that keep their pets only indoor for the cases when the pet can escape. The application requires a mobile data plan which can be bought for ~2 Euro or a data + SMS (~6 Euro) if users want SMS alerts.
The hardware is based on a LilyGO-T-SIM7000G module which is composed of an ESP32-WROVER low power SoC with WiFi and Bluetooth, a SIM7000G chip which adds LTE, GPRS and GPS and a MicroSD card. The module also comes with a 18650 battery holder. The MCU communicates to the SIM/GPS module via asynchronous serial interface and with the SD card via SPI. With this board we can send SMS, get location and time using GPS, and connect it to the internet using a SIM card data plan. This board doesn’t support phone calls.
Fig. 1 LilyGO-T-SIM7000G pinout
Fig. 2 System Architecture
When the user first starts the application, the module creates a WiFi access point and the user must access the address of the tracker where it is presented with a web page. This is a configuration page where the user must input username and password, pet name, geofence definition and phone number for sms alerts. After that, the application runs as normal.
Fig. 3 Configuration page
Once the main application loop begins, the microcontroller calculates the GPS position, gets the current time, connects to the firebase database in order to publish data and logs to SD card. In case the user is not authenticated, it retrieves the authentication token from the server and then it writes the position and the timestamp information in the database.
Fig. 4 Software flowgraph
When a position update is received, it is displayed live on a map in the web application interface. In order to access the web application, a user account is required and each user can only see information from his pets.
Fig. 4 Web Application Map
The main challenge in this project was that the Firebase ESP 32 library was made to work only on WiFi while in this project we are using mobile data (WiFi is not feasible for pet tracking purposes). In order to overcome this problem, we have used the REST API exposed by Firebase in order to retrieve the authentication token and then to publish data to the database using the token. The requests must be performed over HTTPS since unsecured HTTP is not accepted by Firebase.
This project presents a
https://github.com/Xinyuan-LilyGO/LilyGO-T-SIM7000G https://randomnerdtutorials.com/lilygo-t-sim7000g-esp32-lte-gprs-gps/ https://firebase.google.com/docs/database/rest/auth#generate_an_id_token https://firebase.google.com/docs/reference/rest/auth#section-sign-in-email-password https://randomnerdtutorials.com/esp32-esp8266-firebase-gauges-charts/