The project is to design a foundation for a platform-independent enviroCar app. It makes the application available to iOS users as well.
During the introductory period, I learned many new things like the BLE (Bluetooth Low Energy) devices and interaction with the OBD-II adapter to read the characteristics.
Now the app has the feature to detect and connect to nearby Bluetooth devices. And the reading characteristics work pretty well with both the Bluetooth packages – the flutter_blue and flutter_reactive_ble.
About the project
The project’s primary goal was to use an appropriate Bluetooth package for connecting and interacting with the BLE devices. The flutter_blue and flutter_reactive_ble packages provide the features to scan nearby BLE devices connected to a BLE device and interact with them.
Another important goal of the project is GPS tracking. We have used google_maps_flutter. We have to be able to read data consistently at certain intervals from the OBD-II adapter and use that data to calculate the CO2 emission, speed, rpm at that particular coordinates (latitude/longitude position). Then we analyze the data (uploaded as “open data”) and determine CO2 hotspots. The analysis of such data can help traffic flow management and CO2 hotspots analysis.
Detecting and connecting with nearby Bluetooth devices
We have used google maps for the maps services, and this article helped in implementing GPS tracking. The provider package gave us an efficient and appropriate plan for enabling the GPS tracking to continue even when the app is in the background.
The resources that helped me in implementing this are:
Reading the data regularly from the OBD-II adapter after specific intervals while the track is in progress
BLE is a low-power wireless technology for connecting devices over a short distance to communicate with each other. It operates in the 2.4 GHz ISM band. The devices communicate with each other by reading and writing the characteristics.
These articles helped me understand BLE devices:
The forthcoming tasks are:
- Improve the GPS tracking and customization,
- Create a database to store the tracks’ data locally,
- Upload the tracks data to the server.
Objective 1: The aim is to improve GPS tracking and allow the user to set a custom name for their track. It also involves giving the user access to pause the tracking. My mentor Benjamin Pross recommended these for enhancing the user experience. The implementation of the pause track feature can be obtained by ignoring the location class’ stream of location updates.
Objective 2: The aim is to create a database to store the track data efficiently. The data received from the OBD-II adapter is used to calculate the CO2 emission, speed, rpm, fuel level, and other parameters using the formulas. We need to map this data to the location coordinates. It needs to be well-defined as these play a crucial role in the analysis of open data.
Objective 3: The aim is to understand the track schema and encode the track data according to this schema. Users can have an option to upload the track recording as open data to the server.
The next task will be to add graphs to show the statistical data. Some of the significant goals will be to improve the UI of the app and test the app extensively.