# GPS Sports Tracker IoT UniTN
<p align="center">
<img src="readmeImages/Logo.jpg" width="200" >
</p>
## Table of Contents
- [About the project](#about-the-project)
- [Project layout](#project-layout)
- [Basic](#basic)
- [Basic Requirements](#basic-requirements)
- [Basic Hardware](#basic-hardware)
- [Basic Software](#basic-software)
- [Linker options](#linker-options)
- [Compiler options](#compiler-options)
- [Basic Project wiring](#basic-project-wiring)
- [Basic Get started](#basic-get-started)
- [IoT Integration](#iot-integration)
- [IoT Requirements](#iot-requirements)
- [IoT Hardware](#iot-hardware)
- [IoT Software](#iot-software)
- [IoT Get started](#iot-get-started)
- [FrontEnd ](#frontend)
- [Installation](#installation)
- [Running the Application](#running-the-application)
- [Dependencies](#dependencies)
- [Using Visual Studio Code](#using-visual-studio-code)
- [JSON Format](#json-format)
- [Instructions for use](#instruction-for-use)
- [Autors](#autors)
- [Links](#links)
## About the project
Welcome to the GPS Sport Tracker!
This system has been designed to keep track of your sporting activities and routes. It utilizes a combination of microcontrollers and a GPS device to gather the data, which is then sent to the server for storage and later displayed on the website.
The system include the following components:
- **MSP432** :This device samples the data received from the GPS, processes it, and sends it via UART to the ESP32 board.
- **ESP32** : This microcontroller receives data via serial communication and enables the system to connect to the internet in order to send data to the web server.
- **GPS Module**: This module connects to satellites, receives, and transmits the received data via serial communication.
The entire process starts by initiating the run from the MSP432 through the interaction menu. Subsequently, the board will start sampling data received from the GPS sensor every 10 seconds. Once the button to end the run is pressed, the collected data will be processed, extracting some useful statistics, and then sent to the ESP32 board, which was waiting until then. Upon receiving the data, it will format them into JSON format to make them suitable for insertion into the database. Once formatted, the program will check if it is connected to a Wi-Fi network, and if affirmative, it will send them to the server, which will insert them into the MongoDB database. On the backend side, the web server will handle various requests that can come from both ESP32 and the website. Finally, the website, through a GET request to the server, will obtain the run data and plot them on the map and display statistics in the dashboard.
## Project layout
<p align="center">
<img src="readmeImages/ESITprojectGraph.jpg" width="900">
</p>
## Basic
The Basic idea of the project is to develop a tracking system that enables you to see some statistics about your workout. The tracker can be used offline and the statistics are displayed on the LCD screen.
### Basic Requirements
#### Basic Hardware
- `MSP432p401r` of the Texas Instrument company with its own expansion: the `BOOSTXL-EDUMKII`.
- `ESP32-WROOM-32` module 2.4 GHz Dual Core WLAN WiFi Bluetooth
- `GPS Mini NEO-6M` GPS module.
#### Basic Software
In order to flash the program into the Texas Instrument components, you first need to install [Code Composer Studio](https://www.ti.com/tool/download/CCSTUDIO/12.2.0).
The next step is to create a new CCS project, choosing the right target system (MSP432P401R), and paste all the files in `MSP_Code/GPS_Sport_Tracker` folder into your project.
Finally, to run the project you will need to add the driverlib library, both to the linker and to the compiler option. You can find the library at the following [link](https://drive.google.com/file/d/1krZfBNAFiE6yAChQfHZVE-b0wfuDitgV/view?usp=sharing).
#### Linker options
<p align="center">
<img src="readmeImages/CCSLinker.png" width="500">
</p>
#### Compiler options
<p align="center">
<img src="readmeImages/CCScompiler.png" width="500">
</p>
#### Basic Project wiring
<p align="center">
<img src="readmeImages/wiring_schema.jpg" width="500">
</p>
#### Basic Get started
If all the software requirements are satisfied, you need to connect the gps module and the microcontroller as you can see in the electric schema above. Now, you are able to flash the program on the MSP, using the command flash on CCS, and start using the whole offline system.
Before you can start the run you have to wait for the data sent from the gps to be valid and the "FIXING" screen will be displayed, once the data is valid, the "IDLE" screen will appear and you can start the run.
## IoT Integration
This extension allows you to connect the basic system to the internet. In this way you can visualize all your data on a website with additional infomation that can't be displayed on the lcd screen.
### IoT Requirements
#### IoT Hardware
You will only need an ESP32 (ESP-WROOM-32)
#### IoT Software
1. NodeJS
2. npm
3. Arduino IDE (version 1.8.19 is recommended)
5. MongoDB, MongoDBCompass
#### **NodeJS, npm**
How can I install all of this? Just follow next instructions.
To install `NodeJS` and `npm` you can easily follow the instruction on this [guide]( https://docs.npmjs.com/downloading-and-installing-node-js-and-npm).
Now that `NodeJS` and `npm` are installed, opne the `node_server` folder in your terminal and type this command
```
npm install
```
This command will install for you all the NodeJS packages needed.
#### **Arduino IDE**
Simply download the version for you on their [official web site](https://www.arduino.cc/en/software) and follow the installation procedure.
Once you have installed it you have to download some libraries to be able to operate on the ESP32 and manage http communication between NodeJS server and ESP32.
First of all open Arduino IDE and go to `Tools > Board > Boards Manager`, search for ESP32 by Espressif Systems and press install.
<p align="center">
<img src="readmeImages/boardManagerW.png" width="500">
</p>
#### **MongoDB, MongoDBCompass**
Now you have two solution:
1. running the database on your local machine
2. running the database on the cloud
You can create your local cluster with `MongoDB` and `MongoDBCompass` following this [guide](https://zellwk.com/blog/local-mongodb/) (how to create the database and how to connect it, don't look at how to connect from server NodeJS). This method is good if you have a home server but it is not the best if you haven't because your machine should run 24/7.
Otherwhise you can create your MongoDB account and create your cluster online. Follow this [guide](https://www.mongodb.com/basics/clusters/mongodb-cluster-setup) for that.
Once you have your cluster you have to create one database, witch will be composed of one collection:
- positions
At the end you should have something like this in your Database.
<p align="center">
<img src="readmeImages/MongoDBCollection.png" width="500">
</p>
You have to use the exact name of the collection.
Now the configuration of the software is done, later we will have to modify some code!
#### IoT get started
Now we have to install the Esp32 windows drivers in order to let to the OS to see the board. You can follow this [**guide**](https://www.lelezapp.it/installare-driver-cp2102-per-programmare-esp32-in-windows/).
##### .env file for database URL
Now we have to create a `.env` file in the `webServer` folder.
Once you have created it, open it and in the first line write:
```
DATABASE_URL=mongodb+srv://<username>:<password>@<clusterName>.[randomCharacter].mongodb.net
```
automatically MongoDB will provide you the right URL, in case you have created your cluster online it will look like the example above.
##### Set NodeJS server IP address in ESP32 code
We need to tell the ESP32 which address to send
YG亲测源码屋
- 粉丝: 454
- 资源: 1730
最新资源
- Git 分布式版本控制系统常见操作指南
- 电力市场出清程序 IEEE14节点考虑输电阻塞,求解机组边际电价和节点边际电价 采用拉格朗日乘子进行分析计算,目标函数为发电成本最小 运用matlab中的linprog()函数实现此程序,均为m
- 电力电子、电机驱动、数字滤波器matlab simulink仿真模型实现及相关算法的C代码实现 配置C2000 DSP ADC DAC PWM定时器 中断等模块,提供simulink与DSP的联合仿
- 双层优化 大型电动汽车 时空调度 测试环境:MATLAB 关键词:双层优化,电动汽车,时空调度,配电网 考虑电动汽车有序充放电的机组组合和最优趋势,机组组合采用相同的线性化方法,采用二阶锥松弛的
- 基于MATLAB的四旋翼无人机PID控制
- 堆垛机-西门子PLC程序+输送线程序+触摸屏程序 物流仓储 涵盖通信,算法,运动控制,屏幕程序 实际项目程序 西门子S7-1200+G120+ET200S+劳易测激光测距 博途编程 采用用
- 分析储能接入对新能源消纳能力影响 目标函数:系统经济性最优包括燃料成本和弃风惩罚成本 约束:功率平衡,储能约束,机组出力上下限,机组爬坡约束,风电出力约束
- (matlab)三相并网逆变器svpwm控制+PI电流环控制(有参考文献) (1)符合入网电流谐波标准 (2)并网电流和电压同相 (3)采用锁相环PLL
- 三菱PlC程序大型项目QCPU+QD77MS16 项目说明如下: 1.包含一套完整的电气开发系统资料(包含plc程序,触摸屏程序,伺服模块设置程序,程序开发地址规划表) 2.这套开发程序是用一套完
- 基于遗传算法的配电网优化配置 软件:Matlab 介绍:分布式电源、无功补偿装置接入配电网,考虑配电网经济性、环境成本和电能质量为目标函数,使用遗传算法进行优化配置,在IEEE33节点系统进行了仿真验
- 遗传算法求解微电网日前调度 测试环境:MATLAB 用遗传算法求解电力系统简单日前调度问题,考虑微网发电成本的经济性,以微型燃气轮机发电成本、 储能运行维护成本和微网与主网之间买、卖电的交互成本为系统
- 直驱永磁风力发电机,基于Simulink建立了包括风力机、传 动系统、永磁同步发电机、整流逆变、电网等模块的永磁直驱风力发电机控制系统模型 附带文件说明
- 西门子modbus通讯 读取或写入仪表
- 三菱Q程序程序(某集团设备程序) 用三菱Q系列和威纶触摸屏编写 此程序已经实际设备上批量应用,程序成熟可靠,借鉴价值高,程序有注释 由于程序代码可复制发后不可 此款为宏指令未加密
- 考虑降解成本的具有混合储能的微电网两层能源管理系统,采用了模型预测控制的方法
- 综合能源系统仿真,冷热电三联供仿真,simulink仿真
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈