Skip to content

Monitor the busyness of public locations through Wi-Fi packets!

License

Notifications You must be signed in to change notification settings

harrynull/crowdedness-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

94 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Crowdedness Monitor

SE 101 Project

For a demo, see https://cm.harrynull.tech.

Structure

.
├── backend
│   ├── app/:           source code of the app
│   ├── config/:        configurations
│   ├── migrations/
│   ├── requirements.txt:`pip install -r requirements.txt`
│   ├── var/            database for testing/developing purpose. you need to create one for yourself.
│   │   └── test.db
│   └── venv            `venv/Scripts/activate`
├── embedded/
│   ├── .env:           put your environment variables here
│   ├── bootstrap.sh:   this will be put in crontab to run after system boots
│   ├── log:            log generated by the program
│   ├── read_packet.py: module that reads packet generated by tshark
│   ├── report.py:      report data to the backend server
│   ├── run.sh:         this will be put in crontab to run every five minutes
│   ├── setup.sh:       this should be run once only
├── frontend/
└── README.md

Install

Embedded

sudo apt update && sudo apt install vim tshark # select allow non-superuser to use wireshark
sudo usermod -a -G wireshark pi

Add the following line to sudo visudo:

pi ALL= NOPASSWD: /home/pi/crowdedness-monitor/embedded/bootstrap.sh

Add the following line to crontab -e:

*/5 * * * * cd /home/pi/crowdedness-monitor/embedded/ && ./run.sh
@reboot sleep 30 && cd /home/pi/crowdedness-monitor/embedded/ && sudo ./bootstrap.sh

Lastly, edit embedded/.env.

  • bootstrap.sh will be run every time the system boots.
  • run.sh will be run every 5 minutes (a fixed interval).
  • .env stores relevant variables.
  • log stores logs.

Backend

apt update && apt install libmysqlclient-dev
cd backend
python3 -m venv venv
venv/Scripts/activate
pip3 install -r requirements.txt
touch var/test.db
flask db upgrade
flask run

Recommended IDE: PyCharm Professional

Frontend

Frontend

License

The MIT License.

About

Monitor the busyness of public locations through Wi-Fi packets!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published