It stores the geopositions, battery level, state and some other information of every TIER scooter inside Paderborn (the zone can be configured) into a local SQLite database. It currently provides a basic nodejs RESTful API and two HTML pages to visualize the stored data.
Here are some screenshots so you can see how it looks right now.
Maps are done with Leaflet and the heatmap is generated with heatmap.js.
The node RESTful API currenctly provides three endpoints to request the stored data:
GET http://localhost:3000/vehicles
GET http://localhost:3000/vehicles?vehicle_id=34
GET http://localhost:3000/vehicles?id=9cd68586-a1e9-48f6-8eb5-a39a25f59769
GET http://localhost:3000/current
GET http://localhost:3000/current?vehicle_id=34
GET http://localhost:3000/current?id=9cd68586-a1e9-48f6-8eb5-a39a25f59769
GET http://localhost:3000/log
GET http://localhost:3000/log?vehicle_id=34
- Clone this repository
- Run the following command from the root directory of the repo in your favourite terminal.
npm install
- Start API with
node api.js
-
Copy config.example.ini to config.ini and adapt settings if you want
-
Run the data aggregator with
python3 log.py
- Boom! Open index_current_positions.html or index_heatmap.html in your browser.
You can run the logger on your server by crontab:
The following example will log vehicle information every minute:
*/1 * * * * /usr/bin/python3 ~/TierScooterAnalysis/log.py
By default the script will log every position that is different from the last one logged for this vehicle or if the last logged position is atleast 30 minutes old.
- Python3 for backend data aggregator
- Node for the RESTful API
- jQuery, CSS, HTML for the frontend
- SQLite for the database
Any participation and help from others on this is very welcome.
I don't work for TIER Mobility GmbH or have any relationship with it.
If this project violates the general terms and conditions of TIER Mobility GmbH in any way, please let me know and the project will be stopped.
I am not responsible for any damage or costs incurred in connection with this project.
This project is considered just for fun.
Based on the great work of /ubahnverleih/WoBike.