From 307044eda9a6b7c27d1859ec6149f88cf6692813 Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Wed, 26 Aug 2015 20:59:19 +0100 Subject: [PATCH] misc code updates. --- misc/currentcost/cc128_log_mysql.pl | 4 ++-- misc/currentcost/cc128_parse.pl | 8 ++++---- misc/currentcost/cc128_read.pl | 2 +- misc/currentcost/cc128_read.py | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/misc/currentcost/cc128_log_mysql.pl b/misc/currentcost/cc128_log_mysql.pl index 11204798..568f6114 100755 --- a/misc/currentcost/cc128_log_mysql.pl +++ b/misc/currentcost/cc128_log_mysql.pl @@ -30,10 +30,10 @@ local $| = 1; my $dbname = "powermeter"; my $dbhost = "localhost"; my $dbusername = "powermeter"; -my $dbpassword = "password"; +my $dbpassword = ""; my $dbtable = "powermeter"; -my $subclient = "/usr/bin/mosquitto_sub -t sensors/cc128"; +my $subclient = "mosquitto_sub -t sensors/cc128"; open(SUB, "$subclient|"); SUB->autoflush(1); diff --git a/misc/currentcost/cc128_parse.pl b/misc/currentcost/cc128_parse.pl index 0236344d..af38ece0 100755 --- a/misc/currentcost/cc128_parse.pl +++ b/misc/currentcost/cc128_parse.pl @@ -9,9 +9,9 @@ use FileHandle; local $| = 1; -my $subclient = "/usr/bin/mosquitto_sub -t sensors/cc128/raw -q 2"; -my $pubclient = "/usr/bin/mosquitto_pub -t sensors/cc128 -q 2 -l"; -my $pubclient_ch1 = "/usr/bin/mosquitto_pub -t sensors/cc128/ch1 -q 2 -l"; +my $subclient = "mosquitto_sub -t sensors/cc128/raw -q 1"; +my $pubclient = "mosquitto_pub -t sensors/cc128 -q 1 -l"; +my $pubclient_ch1 = "mosquitto_pub -t sensors/cc128/ch1 -q 1 -l"; open(SUB, "$subclient|"); open(PUB, "|$pubclient"); @@ -23,7 +23,7 @@ PUB_CH1->autoflush(1); while (my $line = ) { #CC128-v0.120000215.7003112100108 - if ($line =~ m# *([\-\d.]+)0[0-9]*10*(\d+)(.*) *([\-\d.]+)0[0-9]*10*(\d+)