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
...
@@ -4,7 +4,8 @@ After = syslog.target
[Service]
[Service]
Type = simple
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
StandardOutput = journal
StandardError = journal
StandardError = journal
Restart = always
Restart = always
...
...
modules/nginx/manifests/install/pi.pp
View file @
2d5c9454
...
@@ -61,7 +61,7 @@ class nginx::install::pi{
...
@@ -61,7 +61,7 @@ class nginx::install::pi{
source
=>
'puppet:///modules/nginx/pi/nginx.service'
source
=>
'puppet:///modules/nginx/pi/nginx.service'
}
}
package
{
'passenger'
:
package
{
'passenger'
:
ensure
=>
"6.0.
4
"
,
ensure
=>
"6.0.
12
"
,
provider
=>
gem
,
provider
=>
gem
,
}
}
package
{
'libcurl4-openssl-dev'
:
package
{
'libcurl4-openssl-dev'
:
...
@@ -69,7 +69,7 @@ class nginx::install::pi{
...
@@ -69,7 +69,7 @@ class nginx::install::pi{
}
}
exec
{
'install-agent'
:
exec
{
'install-agent'
:
command
=>
'/usr/local/bin/passenger-config install-agent --auto'
,
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
,
timeout
=>
0
,
require
=>
Package
[
'passenger'
,
'libcurl4-openssl-dev'
],
require
=>
Package
[
'passenger'
,
'libcurl4-openssl-dev'
],
}
}
...
...
modules/nginx/manifests/sites.pp
View file @
2d5c9454
...
@@ -30,11 +30,11 @@ class nginx::sites {
...
@@ -30,11 +30,11 @@ class nginx::sites {
group
=>
root
,
group
=>
root
,
mode
=>
'0644'
,
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/* &&
\
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 &&
\
mv /var/www/docs/standalone_index.html /var/www/docs/index.html &&
\
rm docs.tar"
rm docs.tar
.gz
"
exec
{
'InstallDocs'
:
exec
{
'InstallDocs'
:
command
=>
$docs_cmd
,
command
=>
$docs_cmd
,
...
...
modules/nilm/manifests/config.pp
View file @
2d5c9454
class
nilm::config
{
class
nilm::config
{
$nilm_bin
=
[
'nilm'
,
'nilm-reader-capture'
,
#
$nilm_bin = ['nilm','nilm-reader-capture',
'nilm-filter-prep'
,
'nilm-filter-sinefit'
,
#
'nilm-filter-prep','nilm-filter-sinefit',
'nilm-filter-reconstructor'
,
'nilm-filter-rawtoprep'
,
#
'nilm-filter-reconstructor','nilm-filter-rawtoprep',
'nilm-plug'
,
'jim-term'
]
#
'nilm-plug','jim-term']
$nilm_bin
.
each
|
String
$name
|
{
#
$nilm_bin.each |String $name| {
file
{
"/usr/local/bin/
$name
"
:
#
file{"/usr/local/bin/$name":
ensure
=>
link
,
#
ensure => link,
target
=>
"/var/venvs/joule/bin/
$name
"
#
target => "/var/venvs/joule/bin/$name"
}
#
}
}
#
}
exec
{
'initialize_nilm'
:
exec
{
'initialize_nilm'
:
command
=>
'nilm initialize'
,
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'
,
creates
=>
'/opt/configs/meters.example.yml'
,
require
=>
File
[
'/usr/local/bin/nilm'
]
}
}
exec
{
'initialize_nilmplug'
:
exec
{
'initialize_nilmplug'
:
command
=>
'nilm-plug --initialize'
,
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'
,
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:
...
@@ -208,47 +208,49 @@ meter2:
EOF
EOF
#meter1.yml (calibration)
#meter1.yml (calibration)
cat
>
/opt/configs/meters/meter2.yml
<<
EOF
cat
>
/opt/configs/meters/meter2.yml
<<
EOF
current_matrix:
current_matrix:
- - 0.0
13698286257034089
- - 0.0
037746992345301924
-
-0.008372095473047129
-
0.0003925424615672237
-
-7.195016997648725e-05
-
0.0002892541810926171
-
6.943971771534212e-05
-
1.785967957824139e-08
- -
0.0004511352302640425
6
- -
-6.757891246352776e-0
6
-
0.0010320134824391492
-
-0.0006451522156305825
-
-0.025266006217889984
-
0.06172431827668136
-
0.04766767945698939
-
-9.657855127109635e-06
duration: 9
duration: 9
has_neutral: true
has_neutral: true
off_duration: 2
on_duration: 1
pq_coeffs:
pq_coeffs:
- - -
30791.144718303465
- - -
0.5613834689688728
-
-1218.828836681789
-
0.8275557991872661
- -
-18821.142653407267
- -
0.05835518464523408
-
755.897624263009
-
0.0870284477204723
- -
-112.74221300378883
- -
0.0006778629398427929
-
-72.39838665487767
-
0.0009958592530492554
- -
57.49251728329302
- -
0.0001247745558515221
- -
13.32555761361901
5
- -
6.466454130673776e-0
5
- - -
60.406866609359994
- - -
0.026831347565645126
-
-31.015634339553483
-
0.07225784891776485
- -
221.7698659131578
- -
-0.0028736810340140454
-
-29.075136106286408
-
0.02416421698412425
- - -
5026.504793830757
- - -
0.5671686103408003
-
214.02621852139075
-
-0.8236017043717707
- -
9484.224738585859
- -
-0.0021136771017480414
-
-380.9201452842851
-
0.001647066333949648
sensor_matrix:
sensor_matrix:
- -
53.14555615658608
- -
262.0422499341873
-
0.10624348113745874
-
-1.210458139743937
- -
-32.48605950376758
- -
27.456926510182655
-
0.3841797932263452
-
-0.29596422201695566
- -
-0.1893501464831944
- -
0.3156744761911736
-
-8.676794632867567
-
16.197843591044396
- - 0.0
9998591835992797
- - 0.0
04332307004927795
-
16.370162190401707
-
-0.002554648333854752
sinefit_rotations:
sinefit_rotations:
- -0.039563090697980044
- 0.9747397197790278
- -0.040141975928641264
- -2.1738602819131203
voltage_scale: 1.0
watts: 200
watts: 200
EOF
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