GPS Tracker for ESP32
The SIM7600 module used in this project can be at rhydoLABZ. The PCB and 3D designed enclosure are specific to this module.
Parts and sourceBefore you start
Confirm board compatibility and supported firmware targets in the upstream documentation.
Upstream README
GPS Tracker Project
A GPS Tracker Prototype used for locating tracking vehicles.
Hardware:
- ESP32
- SIM7600EI
The SIM7600 module used in this project can be at rhydoLABZ. The PCB and 3D designed enclosure are specific to this module.
This tracker gets the current location coordinates using the SIM7600 module, and then sends them to AWS. A web site is hosted on AWS to display the coordinates from the tracker.
AWS IoT Core, DynamoDB and EC2 services from AWS are used for this project.
Instructions:
-
The file
secrets_template.hhas the variables that has to be edited. After editing, rename the file tosecrets.hand place it in the same folder that has themain.cppfile.The folder structure has to be some thing like this: -- Project | -- | -- | -- src | -- secrets.h | -- main.cpp | -- SIM7600.cpp | -- SIM7600.h | -- -
Follow the steps in Documentation for AWS and Documentation for SIM7600.
For deeper understanding of the AT Commands, the document "SIM7500_SIM7600 Series_ AT Command Manual" can be referred.
-
This project was developed in PlatformIO. There are many tutorials which help in installing and uploading the program to the ESP32.
Understanding the code:
-
The code creates few tasks to control various peripherals.
- LED control
- Battery monitoring system
- Active time management
- Fetch GPS co-ordinates and Publish to AWS
- Monitoring the Serial input. (Work in progress)
-
A semaphore is used to control the number of the times the status LED blinks. Few FreeRTOS functions to handle tasks are used to suspend and resume the LED control task.
-
To prevent the battery from discharging through the voltage divider used for voltage level detection, a MOSFET is used to enable the voltage divider. This task also switched OFF the SIM7600 module if the voltage is low.
Troubleshooting:
- To disable MQTT functions, the line
#define MQTT_CONNECTcan be commented. By commenting it, the AT commands corresponding to MQTT connection, publishing are not sent to SIM7600 module.