Commit 8256d078 by source_reader

reduce image size for nilm install, bug fixes

parent fb14bedd
...@@ -6,6 +6,7 @@ if [[ $# == 0 ]]; then ...@@ -6,6 +6,7 @@ if [[ $# == 0 ]]; then
IMAGE_TYPE='default' IMAGE_TYPE='default'
elif [[ $1 = "--nilm" ]]; then elif [[ $1 = "--nilm" ]]; then
echo "BUILDING NILM IMAGE" echo "BUILDING NILM IMAGE"
apt remove --purge libreoffice-* -y
IMAGE_TYPE='nilm' IMAGE_TYPE='nilm'
else else
echo "Error, unknown type $1" echo "Error, unknown type $1"
......
...@@ -3,7 +3,14 @@ set -e ...@@ -3,7 +3,14 @@ set -e
# start a container with the following command: # start a container with the following command:
# sudo systemd-nspawn -D squashfs-root/ -b --network-interface=enxd8eb97bdd8ed --bind-ro=/home/jdonnal/puppet:/home/ubuntu/puppet -M wattsworth # sudo systemd-nspawn -D squashfs-root/ -b --network-interface=enxd8eb97bdd8ed --bind-ro=/home/jdonnal/puppet:/home/ubuntu/puppet -M wattsworth
#if [ ! -f "/etc/hosts" ]; then
cat > /etc/hosts <<EOF
127.0.0.1 localhost
127.0.1.1 ubuntu-ww-builder
EOF
#fi
#echo "nameserver 172.31.33.1" > /etc/resolv.conf #echo "nameserver 172.31.33.1" > /etc/resolv.conf
apt-get update apt-get update
apt-get upgrade -y apt-get upgrade -y
......
...@@ -25,4 +25,5 @@ rm -rf /root/.joule ...@@ -25,4 +25,5 @@ rm -rf /root/.joule
rm -rf ~/.joule rm -rf ~/.joule
echo "Remember to remove ubuntu user and /home/ubuntu!" echo "Remember to remove ubuntu user and /home/ubuntu!"
echo "Also check if any user with uid of 999 exists"
history -c history -c
...@@ -4,12 +4,13 @@ View NILM documentation locally: ...@@ -4,12 +4,13 @@ View NILM documentation locally:
=== Source Code === === Source Code ===
--- Data Acquisition --- --- Data Acquisition ---
nilm NILM data capture and analysis (sinefit, prep, etc)
nilmdb NilmDB timeseries database nilmdb NilmDB timeseries database
nilmtools Utilities for NilmDB (Python 2.7) nilmtools Utilities for NilmDB (Python 2.7)
ethstream Data acquistion from LabJack and NerdJack ethstream Data acquistion from LabJack and NerdJack
labjack Joule module for LabJack U3 labjack Joule module for LabJack U3
iv_sensor Firmware for noncontact sensors *iv_sensor Firmware for noncontact sensors
wemo Software and Firmware for Belkin Smart plugs *wemo Software and Firmware for Belkin Smart plugs
--- Wattsworth --- --- Wattsworth ---
joule Joule daemon and client joule Joule daemon and client
...@@ -25,4 +26,6 @@ metric_generator ...@@ -25,4 +26,6 @@ metric_generator
--- Misc --- --- Misc ---
puppet Scripts for building system images "sticks" puppet Scripts for building system images "sticks"
nilm_admin nilm_admin
\ No newline at end of file
*To build these projects first extract /opt/asf.tar.gz to src/asf
\ No newline at end of file
...@@ -46,6 +46,12 @@ class docs::nilm(String $docs_path, String $owner){ ...@@ -46,6 +46,12 @@ class docs::nilm(String $docs_path, String $owner){
source => "${git_cmd}/jim/nilmdb.git", source => "${git_cmd}/jim/nilmdb.git",
user => $owner, user => $owner,
} }
vcsrepo{"${src_path}/nilm":
ensure => latest,
provider => git,
source => "${git_cmd}/wattsworth/nilm.git",
user => $owner,
}
vcsrepo{"${src_path}/ethstream": vcsrepo{"${src_path}/ethstream":
ensure => latest, ensure => latest,
provider => git, provider => git,
...@@ -76,17 +82,15 @@ class docs::nilm(String $docs_path, String $owner){ ...@@ -76,17 +82,15 @@ class docs::nilm(String $docs_path, String $owner){
source => "${git_cmd}/nilm/iv-sensor.git", source => "${git_cmd}/nilm/iv-sensor.git",
user => $owner, user => $owner,
} }
$asf_cmd = "wget http://bucket.mit.edu/asf.tar.gz > /dev/null &&\ # $asf_cmd = "wget http://bucket.mit.edu/asf.tar.gz > /dev/null &&\
tar -xf asf.tar.gz -C ${src_path}/iv_sensor &&\ # tar -xf asf.tar.gz -C ${src_path}/iv_sensor &&\
rm asf.tar.gz" # rm asf.tar.gz"
exec{"Atmel Software Framework": exec{"Atmel Software Framework":
command => $asf_cmd, command => "curl http://bucket.mit.edu/asf.tar.gz > /opt/asf.tar.gz",
timeout => 0, timeout => 0,
path => ['/bin', '/usr/sbin', '/usr/bin'], path => ['/bin', '/usr/sbin', '/usr/bin'],
require => Vcsrepo["${src_path}/iv_sensor"], creates => "/opt/asf.tar.gz"
creates => "$src_path/iv_sensor/asf"
} }
package{['gcc-arm-none-eabi','gdb-multiarch']: package{['gcc-arm-none-eabi','gdb-multiarch']:
ensure => present, ensure => present,
......
location /nilmdb { location /nilmdb {
include uwsgi_params; include uwsgi_params;
uwsgi_pass unix:/tmp/nilmdb.sock; uwsgi_pass unix:/tmp/nilmdb.sock;
client_max_body_size 0;
} }
\ No newline at end of file
...@@ -4,10 +4,13 @@ class nilmdb::install{ ...@@ -4,10 +4,13 @@ class nilmdb::install{
package { $apt_pkgs: package { $apt_pkgs:
ensure => present ensure => present
} }
package { 'python3-psutil': # this should be installed by pip
ensure => absent
}
package { $pip_pkgs: package { $pip_pkgs:
provider => pip3, provider => pip3,
ensure => present, ensure => present,
require => Package[$apt_pkgs] require => Package[$apt_pkgs, 'python3-psutil']
} }
$pip_url='https://pypi.wattsworth.net/' $pip_url='https://pypi.wattsworth.net/'
......
#!/bin/bash #!/bin/bash
export LC_ALL=C.UTF-8
export LANG=C.UTF-8
joule admin authorize
joule master add lumen 127.0.0.1
#----Module Configs---- #----Module Configs----
#Demo Reader #Demo Reader
...@@ -135,6 +142,7 @@ meter1: ...@@ -135,6 +142,7 @@ meter1:
type: contact type: contact
path: /meters/contact path: /meters/contact
enabled: true # set to false to disable this meter enabled: true # set to false to disable this meter
daq_type: labjack
ip_address: 172.31.33.6 ip_address: 172.31.33.6
phases: 2 # 1 - 3 phases: 2 # 1 - 3
sensors: sensors:
...@@ -147,6 +155,8 @@ meter1: ...@@ -147,6 +155,8 @@ meter1:
sensor_indices: [2,1] # maps to phase A,B,C sensor_indices: [2,1] # maps to phase A,B,C
sensor_scales: [0.0010090,0.00050452] sensor_scales: [0.0010090,0.00050452]
sinefit_rotations: [0,0] # relative to sinefit_phase voltage sinefit_rotations: [0,0] # relative to sinefit_phase voltage
filter:
enable: false
streams: streams:
sinefit: sinefit:
decimate: true # if [false] only the base stream will be saved decimate: true # if [false] only the base stream will be saved
...@@ -157,6 +167,8 @@ meter1: ...@@ -157,6 +167,8 @@ meter1:
prep: prep:
decimate: true decimate: true
keep: 3w keep: 3w
nshift: 1
goertzel: false
sensor: sensor:
keep: false keep: false
...@@ -175,6 +187,8 @@ meter2: ...@@ -175,6 +187,8 @@ meter2:
sensor_indices: [1,3,5,7] # D-Board with 4 A-Boards sensor_indices: [1,3,5,7] # D-Board with 4 A-Boards
calibration: calibration:
duration: 9 # length of calibration in seconds duration: 9 # length of calibration in seconds
on_duration: 1
off_duration: 2
watts: 200 # power consumed by calibration load watts: 200 # power consumed by calibration load
has_neutral: true # [false] if the system has no neutral bus has_neutral: true # [false] if the system has no neutral bus
streams: streams:
...@@ -187,6 +201,8 @@ meter2: ...@@ -187,6 +201,8 @@ meter2:
prep: prep:
decimate: true decimate: true
keep: 3w keep: 3w
nshift: 1
goertzel: false
sensor: sensor:
keep: false keep: false
EOF EOF
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment