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 project consists of a LilyGO-T-SIM7000G module which is composed of a ESP32-WROVER SOC connected to an SIM7000G with LTE and GPS and a MicroSD card. The MCU communicates to the SIM/GPS module via UART and with the SD card via SPI.
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. 2 Configuration page
Fig. 3 Software flowgraph
The software loop calculates GPS position, connects to the firebase database. In case the user is not authenticated, it must first get the authentication token and then it publishes the position and the timestamp to the database. When an update is received, it is displayed in the web page. The user must also authenticate with a valid account in the Web interface.
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, HTTP is not accepted by Firebase.
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/