Sitdown is a web of things utility that provides live information to help users to know how many available seats are there in the buses. It runs in a Raspberry Pi and uses some ultrasonic sensors to know how many seats are being used through a MQTT broker connection.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
In order for clone the repository it is necessary to have installed [git] (https://git-scm.com/) on your machine.
Installing on Linux (Ubuntu):
$ sudo apt-get install git
In order for iniatilize the code it is necessary to have installed [Node.js] (https://nodejs.org/en/) on your machine.
Installing on Linux (Ubuntu):
$ sudo apt install curl
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo bash -
$ sudo apt install nodejs
In order for be abble to remote controlling the Raspberry it is necessary to have installed [ssh] (https://www.ssh.com/) on your machine.
Installing on Linux (Ubuntu):
$ sudo apt install ssh
In order for be abble to remote controlling the Raspberry without passing every time the password it is necessary to have installed [ssh] (https://www.ssh.com/) on your machine.
Installing on Linux (Ubuntu):
$ sudo apt install sshpass
For run this project is necessary use at least one raspberry and one ultrasonic sensor connected. Following the schema picture below:
Once you have all the prerequisites installed, let's go to the first step of all Github repository: Clone and extract the repository.
$ git clone https://github.com/sugarbrain/sitdown/
In this step, we will install all the necessary needs for the initiation of the project.
$ cd sitdown
$ sudo npm install
PS: Don't try install pigpio module in your computer!
After connected your Raspberry into a network, get your IP, LOCAL USERNAME, LOCAL PASSWORD and REP LOCAL. Open init_seat.sh file, copy this script bellow and paste there. Just make sure that you change all variables needed.
#!/bin/bash
USERNAME=YOUR_USERNAME
HOSTS=YOUR_IP
SCRIPT="sudo killall node;cd YOUR_REP_LOCAL; sudo node src/seat.js;"
for HOSTNAME in ${HOSTS} ; do
sshpass -pYOUR_PASSWORD ssh -l ${USERNAME} ${HOSTNAME} "${SCRIPT}"
done
Open seat.js file, and make sure to change in the final lines the Seat objects to use your trigger and echo pins.
let seat = new Seat(YOUR_TRIGGER, YOUR_ECHO);
seat.init();
Finally, initialize the project:
npm start
P.S: To see the monitoring interface, just type in your navigator address https://localhost:3000.
- Antonio Neto - Initial work - aacgn
- Eduardo Santos - Initial work - eduardosm7
- Vinícius Giles - Initial work - gilesv
This project is licensed under the MIT License - see the LICENSE.md file for details