Skip to content
Olmo Mezger edited this page Apr 7, 2016 · 2 revisions

Welcome to the gateway_watchdog wiki!

  • boot

  • change password de root a:

  • sudo apt-get update

  • sudo apt-get upgrade

  • sudo apt-get install vim

  • sudo apt-get install screen rsync

  • sudo apt-get install python python-setuptools

  • install git in the setup

  • Locales

    • dpkg-reconfigure locales
    • choose uk and us, both UTF-8
  • create user energy

    • useradd energy
    • passwd energy
    • —> energyGatewayG&E
    • mkdir /home/energy
    • chown -R energy:energy /home/energy
  • Install Node

  • Install Mongo

    • sudo apt-get install mongodb
    • cambiar los permisos de var/log/mongo
    • añadir esta linea a bajo [Unit]

/lib/systemd/system/mongodb.service

- After=dietpi-service.service
  • Install additional node packages

    • sudo npm install forever -g
    • sudo npm install forever-service -g
    • sudo npm install gulp -g
  • install python packages

  • sudo dpkg-reconfigure tzdata

  • put services in place

    • api

      • change to api directory
      • ln -s /usr/local/bin/gulp ./
      • sudo forever-service install EnergyAPI /home/energy/productive/api/gulp
    • parseSync

      • sudo forever-service install ParseSync /home/energy/productive/ mongo2parsesync/app.js
    • ipLogger

      • add to crontab:
      • 0 * * * * python /home/energy/productive/ipLogger/ipLogger.py > /dev/null
  • static IP:

  • Repositories

    • General

      • ssh-keygen
      • update key in bitbucket
      • in HOME: mkdir sandbox
      • cd sandbox
    • EnergyMonitor in general

    • API

      • cd energymonitor/API
      • npm install
      • sudo npm install forever -g
      • sudo npm install -g forever-service
    • Powermeter

  • SET UP

    • mongo

      • it just should work
    • API

    • TEST api

      • restart the rpi
      • curl -X POST --data '{"value":100,"sensorID":"123"}' http://localhost:3000/api/datapoint --header "Content-Type:application/json"
      • should get an OK in the console
      • mongo sensors
      • db.datapoints.find()
      • db.datapoints.remove()

——————> made backup image of the disk.

  • Set up

    • incluhir en ~/.bashrc:

      • export LC_ALL=C
      • export NODE_ENV="production"
Clone this wiki locally