Skip to content

Scheduler to Halt Internet Temporarily (~10 min) Around Muslim Prayer Times

License

Notifications You must be signed in to change notification settings

othmanalikhan-islamic/project_aroundtheclock

Repository files navigation

Project AroundTheClock: Praying on Time!



Build Status Code Coverage Maintainability Last Commit Issues Known Vulnerabilities License

Overview

AroundTheClock is a self-improvement project that is aimed to help muslims regulate praying on time by temporarily disabling internet connectivity at each prayer (e.g. disabling internet for 10 minutes by default during the start of Asr).

Above is a demo that illustrates it in action: The scenario is that it is approaching Asr prayer time and the internet needs to be 'paused' temporarily. The VM on the left is running the AroundTheClock script and on the VM on the right is a regular user on the same network. Once the time hits Asr (15:05:00), the internet is 'paused'. For the purposes of the demo, the the script and clock are manually controlled, however, in a real-world scenario is is fully automated.

This is achieved by calculating the prayer times for the geolocation specified in config/config.json then scheduling tasks in Python to disable the home internet.

The idea is to download this repository on an Raspberry Pi device (or any other machine), connect it to your home network, and leave it running.

How to Use

  1. Clone the repository, git clone https://github.com/OthmanEmpire/project_aroundtheclock
  2. Navigate to the root project directory, cd project_aroundtheclock
  3. Modify ./config/config.json to your geolocation, vi ./config/config.json
  4. Change permissions of the installation script, chmod u+x ./bin/install.sh
  5. Run the installation script from the root directory, sudo ./bin/install.sh.
  6. Verify "running" status of project, systemctl status aroundtheclock.service
  7. If you face any issue, please check the troubleshooting section.

Troubleshooting

  • Issue: How do check if aroundtheclock is running?
  • Solution: Check its daemon, systemctl status aroundtheclock.service.

  • Issue: I get the error 'Unit aroundtheclock.service could not be found'!
  • Solution: The installation process failed. Repeat steps 4-5.

  • Issue: I can see aroundtheclock service but its state isn't 'active'!
  • Solution A: Restart the service manually, systemctl restart aroundtheclock.service.
  • Solution B: Check the logs of the service, journalctl -u aroundtheclock.service.
  • Solution C: Check the logs of the application, output/log.txt.

Key Features

  • Calculates individual prayer times up to an accuracy of 1 minute.
  • Schedules jobs to block the internet temporarily for all prayers.
  • Configurable internet blocking duration via config.json.
  • Logs computed prayer times as well as scheduled jobs to blocking internet.
  • Source code is structured via a functional approach (thus can verify formulae).

Limitations

  • Works only on a single subnet. If your home network spans multiple subnets (most home setups don't), then only the subnet of the device running the script will have its internet connectivity disabled.
  • Some advanced configuration applied on a network device may prevent arp poisoning (e.g. static arp entries for default gateway). Most home setups don't fall under this category.
  • For now, the user needs to manually specify their geolocation coordinates in config.json. The longitude and latitude need to be accurate to 0.1 degree in otherwise it can cause prayer times to be shifted in some cases by up to 3 minutes. Note that clocks on mosques follow pre-defined coordinates, and this sometimes varies between clocks too unfortunately (not fully standardized). For now, config.json is configured for coordinates of AlKhobar, Saudi Arabia.

Authors

Name Email
Othman Alikhan [email protected]

Acknowledgements

Individals
  • AbdulAziz Almass: For inspiring me to take on this project.
Derivation of Astronomical and Prayer Formulae
Reference Code