Project Overview: https://sanitation.pratt.duke.edu/onsite-treatment
The active MCU software is in software/ADPL_electron
using the v6.2.0
Electron firmware.
Live data streaming is avaialble to view at https://adpl.suyash.io .
The web application is responsible for listening to real-time streaming data from different ADPL stations, saving that data to a database, and making those data available for inspection and analysis via a RESTful API and dashboard-like front end. The web server performs several additional functions like integrating with Twilio to allow for text-based alerts and interaction (with many features yet to be implemented).
To install this web application on a vanilla debian-flavored linux server:
- Install git:
sudo apt-get install git
- Clone & run Suyash's provision script (a subtree is also available in
provision/
):
git clone https://github.com/suyashkumar/provision.git
cd provision
./provision.sh
After provisioning a server as noted above:
- Clone this repository:
git clone https://github.com/mlp6/ADPL.git
- Travel to the logging folder:
cd ADPL/software/logging
- Install dependencies:
npm install
- Set the port to run on:
export PORT=80
- Run using authbind if running on a privliged port:
authbind node server.js
Once the kinks in the server setup are sorted out, the server can be automatically started on boot by adding the
following line to /etc/rc.local
:
sudo -iu bitnami /usr/bin/screen -dmS server /bin/bash /home/bitnami/ADPL/software/logging/start_adpl_server.sh
We also have a working Docker image that can be used to start a server
container. Right now the image is hosted on Docker Hub at mlp6/adpl
. The
image can be built in the software/cloud-dashboard/node-server
directory using:
docker build -t mlp6/adpl .
This will read the Dockerfile
in that directory to set everything up. The
supervisord.conf
file is used to concurrently run the MongoDB and Node JS
services.
Once the image is built, you can push this to Docker Hub using:
docker push mlp6/adpl
On the server VM, you can pull the image:
docker pull mlp6/adpl
Finally, you can run the container as follows:
docker run -p 80:9000 -d mlp6/adpl
- Aaron Forbis Stokes ([email protected])
- Daniel Hull
- Suyash Kumar ([email protected])
- Graham Miller
- Cal Nightingale
- Jawad Hoballah
- Mark Palmeri ([email protected])