This project includes four sub projects.
- API - Vessel API to get info about vessels
- Pi-Node - Node server that takes picture of vessel and stores the data to database
- Pi-C - Manages communication with arduino via XBee
- Arduino - Handles sensor logic and communicates with PI via XBee
- Web - Interface to check out dock activity. Also has an api to get the dock activity.
$ git clone git://github.com/aaronsmooth/ShipSensing.git
======
###Vessel API To lookup a vessel you must create a search field that passes a fully-qualified URL content request to the Vessel API.
#####Query Parameters
- key - Search Key. [mmsi, imo, id, name]
- val - Value of the key.
- format - Format of the result. [json, xml]
Examples of fully-qualified URLs:
- http://vesselapi.parseapp.com/lookup?key=name&val=TUGELA&format=json
- http://vesselapi.parseapp.com/lookup?key=name&val=WORLD%20SPIRIT&format=xml
- http://vesselapi.parseapp.com/lookup?key=mmsi&val=636015819&format=json
- http://vesselapi.parseapp.com/lookup?key=imo&val=9191319&format=xml
$ curl --request GET "http://vesselapi.parseapp.com/lookup?key=name&val=TUGELA&format=json"
###Activity API To search for activites you must create a search field that passes a fully-qualified URL content request to the web API.
#####Query Parameters
- limit - Limit of the search results. Default is 10. Set limit to "none" to get all results. [1 to whatever number you want]
- format - Format of the result. [json, xml]
- mmsi, imo, name and id can be used to filter results.
Examples of fully-qualified URLs:
- http://dockmonitor.parseapp.com/activity?limit=2&format=json
- http://dockmonitor.parseapp.com/activity?limit=none&format=json
- http://dockmonitor.parseapp.com/activity?mmsi=248264000&limit=2&format=xml
$ curl --request GET "http://dockmonitor.parseapp.com/activity?limit=none&format=xml"
======
###Pi-Node
#####Install and setup Node
// Update package manager
$ sudo apt-get upgrade && sudo apt-get update
// Install Node
$ wget http://nodejs.org/dist/v0.10.2/node-v0.10.2-linux-arm-pi.tar.gz
$ tar -xvzf node-v0.10.2-linux-arm-pi.tar.gz
// Set NODE_JS_HOME variable to the directory where you un-tarred Node, and add the bin dir to your PATH
$ NODE_JS_HOME=/home/pi/node-v0.10.2-linux-arm-pi
$ PATH=$PATH:$NODE_JS_HOME/bin
#####Running Node server
// Go to "pi-node" directory of the project
$ npm install
// Wait for all dependencies to be installed and then run the server
$ node server.js
###Pi-Py Setup
// Go to "pi-py" directory of the project
$ bash setup.sh
// Wait for setup to complete
$ ./server.py