Tracks and synchronizes IoT device locations in real time, leveraging Hologram’s REST API with MongoDB as a location cache for persistent storage and fast retrieval.
This program is designed to run in a Linux environment.
Clone the repository anywhere in your filesystem. Be sure to note the location, as you will need it later when setting up the scheduler.
Add the config file inside:
Loom_Map/src
If you already have a working config file, you can transfer it using SCP:
scp path/to/my/config.py user@machine_ip:path/to/Loom_Map/srcCreate a file named:
config.pywith the following variables defined:
org_id = ""
hologram_api_key = ""
credentials = f"apikey:{hologram_api_key}"
loom_mongo_uri = ""
hologram_url_location = f"https://dashboard.hologram.io/api/1/devices/locations?orgid={org_id}"Run:
chmod +x install.sh./install.shThis script will:
create the Python virtual environment
install dependencies
prepare the runtime environment
Open the cron scheduler:
crontab -eAdd the following line at the bottom:
0 0,12 * * * /path/to/Loom_Map/script.sh >> /path/to/Loom_Map/cron.log 2>&1This schedules the script to run twice per day:
00:00 (midnight)
12:00 (noon)
https://docs.google.com/document/d/1iaowcdVThSG-IY-LXu3ZF7BfUnMEFDJIBt4f9tBCXrU/edit?usp=sharing