Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
wattsworth
/
puppet
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2d5c9454
authored
Jan 13, 2022
by
source_reader
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
bug fixes and new test calibration matrix
parent
99d1575b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
56 additions
and
55 deletions
modules/joule/files/joule.service
modules/nginx/manifests/install/pi.pp
modules/nginx/manifests/sites.pp
modules/nilm/manifests/config.pp
tests/nilm_test_script.sh
modules/joule/files/joule.service
View file @
2d5c9454
...
...
@@ -4,7 +4,8 @@ After = syslog.target
[Service]
Type = simple
ExecStart = /var/venvs/joule/bin/jouled
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/var/venvs/joule/bin"
ExecStart = /usr/local/bin/jouled
StandardOutput = journal
StandardError = journal
Restart = always
...
...
modules/nginx/manifests/install/pi.pp
View file @
2d5c9454
...
...
@@ -61,7 +61,7 @@ class nginx::install::pi{
source
=>
'puppet:///modules/nginx/pi/nginx.service'
}
package
{
'passenger'
:
ensure
=>
"6.0.
4
"
,
ensure
=>
"6.0.
12
"
,
provider
=>
gem
,
}
package
{
'libcurl4-openssl-dev'
:
...
...
@@ -69,7 +69,7 @@ class nginx::install::pi{
}
exec
{
'install-agent'
:
command
=>
'/usr/local/bin/passenger-config install-agent --auto'
,
creates
=>
'/var/lib/gems/2.
5.0/gems/passenger-6.0.4
/buildout/support-binaries/PassengerAgent'
,
creates
=>
'/var/lib/gems/2.
7.0/gems/passenger-6.0.12
/buildout/support-binaries/PassengerAgent'
,
timeout
=>
0
,
require
=>
Package
[
'passenger'
,
'libcurl4-openssl-dev'
],
}
...
...
modules/nginx/manifests/sites.pp
View file @
2d5c9454
...
...
@@ -30,11 +30,11 @@ class nginx::sites {
group
=>
root
,
mode
=>
'0644'
,
}
$docs_cmd
=
"wget http://cloud.wattsworth.net/docs/docs.tar > /dev/null &&
\
$docs_cmd
=
"wget http://cloud.wattsworth.net/docs/docs.tar
.gz
> /dev/null &&
\
rm -rf /var/www/docs/* &&
\
tar -x
f docs.tar
-C /var/www/docs &&
\
tar -x
zf docs.tar.gz
-C /var/www/docs &&
\
mv /var/www/docs/standalone_index.html /var/www/docs/index.html &&
\
rm docs.tar"
rm docs.tar
.gz
"
exec
{
'InstallDocs'
:
command
=>
$docs_cmd
,
...
...
modules/nilm/manifests/config.pp
View file @
2d5c9454
class
nilm::config
{
$nilm_bin
=
[
'nilm'
,
'nilm-reader-capture'
,
'nilm-filter-prep'
,
'nilm-filter-sinefit'
,
'nilm-filter-reconstructor'
,
'nilm-filter-rawtoprep'
,
'nilm-plug'
,
'jim-term'
]
$nilm_bin
.
each
|
String
$name
|
{
file
{
"/usr/local/bin/
$name
"
:
ensure
=>
link
,
target
=>
"/var/venvs/joule/bin/
$name
"
}
}
#
$nilm_bin = ['nilm','nilm-reader-capture',
#
'nilm-filter-prep','nilm-filter-sinefit',
#
'nilm-filter-reconstructor','nilm-filter-rawtoprep',
#
'nilm-plug','jim-term']
#
$nilm_bin.each |String $name| {
#
file{"/usr/local/bin/$name":
#
ensure => link,
#
target => "/var/venvs/joule/bin/$name"
#
}
#
}
exec
{
'initialize_nilm'
:
command
=>
'nilm initialize'
,
path
=>
[
'/usr/local/bin'
,
'/usr/sbin'
,
'/bin'
],
path
=>
[
'/
var/venvs/joule/bin'
,
'/
usr/local/bin'
,
'/usr/sbin'
,
'/bin'
],
creates
=>
'/opt/configs/meters.example.yml'
,
require
=>
File
[
'/usr/local/bin/nilm'
]
}
exec
{
'initialize_nilmplug'
:
command
=>
'nilm-plug --initialize'
,
path
=>
[
'/usr/local/bin'
,
'/usr/sbin'
,
'/bin'
],
path
=>
[
'/
var/venvs/joule/bin'
,
'/
usr/local/bin'
,
'/usr/sbin'
,
'/bin'
],
creates
=>
'/etc/udev/rules.d/90-nilmplug.rules'
,
require
=>
File
[
'/usr/local/bin/nilm-plug'
]
}
}
tests/nilm_test_script.sh
View file @
2d5c9454
...
...
@@ -208,47 +208,49 @@ meter2:
EOF
#meter1.yml (calibration)
cat
>
/opt/configs/meters/meter2.yml
<<
EOF
current_matrix:
- - 0.0
13698286257034089
-
-0.008372095473047129
-
-7.195016997648725e-05
-
6.943971771534212e-05
- -
0.0004511352302640425
6
-
0.0010320134824391492
-
-0.025266006217889984
-
0.04766767945698939
- - 0.0
037746992345301924
-
0.0003925424615672237
-
0.0002892541810926171
-
1.785967957824139e-08
- -
-6.757891246352776e-0
6
-
-0.0006451522156305825
-
0.06172431827668136
-
-9.657855127109635e-06
duration: 9
has_neutral: true
off_duration: 2
on_duration: 1
pq_coeffs:
- - -
30791.144718303465
-
-1218.828836681789
- -
-18821.142653407267
-
755.897624263009
- -
-112.74221300378883
-
-72.39838665487767
- -
57.49251728329302
- -
13.32555761361901
5
- - -
60.406866609359994
-
-31.015634339553483
- -
221.7698659131578
-
-29.075136106286408
- - -
5026.504793830757
-
214.02621852139075
- -
9484.224738585859
-
-380.9201452842851
- - -
0.5613834689688728
-
0.8275557991872661
- -
0.05835518464523408
-
0.0870284477204723
- -
0.0006778629398427929
-
0.0009958592530492554
- -
0.0001247745558515221
- -
6.466454130673776e-0
5
- - -
0.026831347565645126
-
0.07225784891776485
- -
-0.0028736810340140454
-
0.02416421698412425
- - -
0.5671686103408003
-
-0.8236017043717707
- -
-0.0021136771017480414
-
0.001647066333949648
sensor_matrix:
- -
53.14555615658608
-
0.10624348113745874
- -
-32.48605950376758
-
0.3841797932263452
- -
-0.1893501464831944
-
-8.676794632867567
- - 0.0
9998591835992797
-
16.370162190401707
- -
262.0422499341873
-
-1.210458139743937
- -
27.456926510182655
-
-0.29596422201695566
- -
0.3156744761911736
-
16.197843591044396
- - 0.0
04332307004927795
-
-0.002554648333854752
sinefit_rotations:
- -0.039563090697980044
- -0.040141975928641264
- 0.9747397197790278
- -2.1738602819131203
voltage_scale: 1.0
watts: 200
EOF
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment