Skip to content

Installing Openchirp

Khushboo Bhatia edited this page May 7, 2018 · 11 revisions

Install Databases

  1. Mongo DB - https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
  2. InfluxDB - https://docs.influxdata.com/influxdb/v1.5/introduction/installation/
  3. Redis - sudo apt-get -y install redis-server

Install and setup mosquitto(for MQTT)

  1. https://mosquitto.org/download/
  2. Mosquito Auth Plugin https://github.com/jpmens/mosquitto-auth-plug
  • 2.1 Download and Install Mongo C Driver
  • 2.2 Download Mosquitto Source code
  • 2.3 Update config.mk ( Set yes for files and mongo backend and update SSL and mosquitto source code path)
  • 2.4 Compile plugin
  • 2.5 Update mosquitto configuration as follows:
#Path to auth plugin compiled above
auth_plugin /etc/mosquitto/auth-plug.so
auth_opt_backends files,mongo
# Mosquitto and Node.js share the same mongo database, so use the host and port of mongodb configured for rest
auth_opt_mongo_uri mongodb://localhost:27017` 
#Database should be set to "openchirp" as it is shared by rest server and mosquitto
auth_opt_mongo_database openchirp` 
 #Table name should be set to "thingcredentials" as it is shared by rest server and mosquitto
auth_opt_mongo_user_coll thingcredentials
auth_opt_password_file /etc/mosquitto/passwords
auth_opt_acl_file /etc/mosquitto/acls

Clone Openchirp repos

  1. Website : https://github.com/OpenChirp/website
  2. REST : https://github.com/OpenChirp/openchirp_rest
  3. Storage Service: https://github.com/OpenChirp/mqtt_influx_storage_service
  4. Mapper Service : https://github.com/OpenChirp/gpsmapper-service
  5. Grafana Dashboard : https://github.com/OpenChirp/grafana_dashboards

Config and Startup

REST

$ npm install // This will download all the javascript dependencies in package.json

$ npm start // Starts node.js with default settings in config/development.json and default port is 10010

Website

MQTT Influx Storage Service

Grafana

Configuring Google Oauth

  1. Create a google oauth client ID for your website here. Click on the Configure Project button. This will generate an oauth client id.
  2. Update REST config and website config with the generated oauth client ID.
  3. https://console.developers.google.com