The following packages have to be installed.
- Create a new database. eg:
fyp
- OPTIONAL - Setup replica set for the new database
- Navigate to the MongoDB installation path
- Open a new terminal and start a mongo shell
mongo
- Type
rs.initiate()
(Make sure other there are no other running mongoDB services)
- Install all packages with
npm install
- If any changes were made to the hardware/ database setup, change the
config
variable in the server.js file. Point the server to database and specify the ports for the gui and hardware.
const config = {
DB: 'mongodb://127.0.0.1:27017/', // database URL
PORT: 9090, // GUI port see it at localhost:9090
WS_PORT: 8011, // hardware connection port
};
Run the below commands in seperate terminals
-
Start database. Application can also work without a database. However, this means collected data will not be saved.
mongod --dbpath "path-to-database"
-
Start node server.
node server.js #or nodemon server.js
-
Go to http://localhost:90/plots?id=defaultCollection to directly view the plots page.
Once hardware is connected, then data collected from the hardware will the plotted on the plots_page.html
- Click and drag to zoom
- Click and drag to create a negative area to switch to horizontal / vertical zoom
- Mousewheel doesn't work
You can also use the buttons above the graph to navigate the graph.
Check Hardware for instructions on setting up the hardware