This repo contains the tools and scripts used to generate carrier specific binary files from the OpenCellid Database and publish them in a web server. You can also repurpose it to create the files locally and push them as needed.
- Script to trigger the download of the database file from OpenCellid (API key required!)
- Small C tool to extract the contents of the csv and create the files for each carrier
- Sample NGINX configuration file
- Build
ocidconv
withmake
- Edit
sync_ocid
and set the API key you obtained from OpenCellid, and change the paths to the ones you want to use. For this example we will use/opt/opencellid
as the place wheresync_ocid
andocidconv
are located, and/var/www/opencellid
as the web server root path - Create the web server path
- Use the nginx example configuration file included or create your own, pointing at the web server path you specified in the script, so you can expose the files.
- Do a test run of the
sync_ocid
script. It should downloadcell_towers.csv.gz
in/opt/opencellid/tmp
, extract it, and create the output files in/opt/opencellid/tmp
. After it finished, it should move all the files to the web server path. - If everything was correctly set up, navigating to your web server should show you the directory with all the files. You can now run a script from your phone to retrieve the files. You can find an example here
- Use crontab to run the script every once in a while (OpenCellid allows you to download the same file twice per day on the free tier)
OpenCelliD Project is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License
- OpenCellid, for all the data that makes this possible
- @marcin, for the code to repack the cell towers database file
- @codephase, for the example script to retrieve the cell data and push it to the modem