Closed GoogleCodeExporter closed 9 years ago
I found 2 errors in that function. Maybe one of them is your problem.
The demo mode is off or? :D
I can not commit the current measureit_functions.php because of there are two
much changes and it need some database tables that are not available in the
current online version so you had to change the function with a text editor.
Change measureit_functions.php in line 800 ( can be some other line in your
version ). Replace the function sensor_delete with this one:
{{{
function sensor_delete( $params = array() ){
if( !isset( $params['sensor_id'] ) || !is_numeric( $params['sensor_id'] ) ){
error('sensor is wrong');
}
$db = new mydb;
$db->query("DELETE FROM measure_sensors WHERE sensor_id = $params[sensor_id] LIMIT 1");
$db->query("DELETE FROM measure_positions WHERE position_sensor = $params[sensor_id]");
$db->query("DELETE FROM measure_settings WHERE measure_sensor = $params[sensor_id]");
$db->query("DELETE FROM measure_watt WHERE sensor = $params[sensor_id]");
$db->query("DELETE FROM measure_data_now WHERE sensor_id = $params[sensor_id]");
$db->query("DELETE FROM measure_watt_daily WHERE sensor = $params[sensor_id]");
$db->query("DELETE FROM measure_watt_hourly WHERE sensor = $params[sensor_id]");
$db->query("DELETE FROM measure_watt_monthly WHERE sensor = $params[sensor_id]");
return true;
}
}}}
Original comment by lalelu...@gmail.com
on 10 Aug 2013 at 2:51
OK code is not supported in the comments. Here is the code again without
comments
function sensor_delete( $params = array() ){
if( !isset( $params['sensor_id'] ) || !is_numeric( $params['sensor_id'] ) ){
error('sensor is wrong');
}
$db = new mydb;
$db->query("DELETE FROM measure_sensors WHERE sensor_id = $params[sensor_id] LIMIT 1");
$db->query("DELETE FROM measure_positions WHERE position_sensor = $params[sensor_id]");
$db->query("DELETE FROM measure_settings WHERE measure_sensor = $params[sensor_id]");
$db->query("DELETE FROM measure_watt WHERE sensor = $params[sensor_id]");
$db->query("DELETE FROM measure_data_now WHERE sensor_id = $params[sensor_id]");
$db->query("DELETE FROM measure_watt_daily WHERE sensor = $params[sensor_id]");
$db->query("DELETE FROM measure_watt_hourly WHERE sensor = $params[sensor_id]");
$db->query("DELETE FROM measure_watt_monthly WHERE sensor = $params[sensor_id]");
return true;
}
Original comment by lalelu...@gmail.com
on 10 Aug 2013 at 2:53
Ok I have it working now.
Although i cannot get the clamp data to work.
Can you display the date and time on the screen. I have a PPPOE internet with
login and password and need to SSH in to change the date and time.
Original comment by DaveRan...@gmail.com
on 14 Aug 2013 at 10:25
[deleted comment]
sensor+id sensor_title sensor_clamp
0 Sensor 0 0
9 Laundry 0
20 Sensor0 clamp2 0
10 sensor0 clamp1 0
Is this data right for measure_sensors table;
Original comment by DaveRan...@gmail.com
on 14 Aug 2013 at 11:51
The data looks good. Please try to run the grabber manual with the "debug v"
parameter.
To do this you had to use the latest grabber version from the repository. You
will find it here:
https://measureit.googlecode.com/svn/trunk/measureit_system_files/python/data-in
put.py
Here you will find informations about debugging:
https://code.google.com/p/measureit/wiki/FAQ
Original comment by lalelu...@gmail.com
on 19 Aug 2013 at 8:46
op i uploaded the new data-input.py from issue 33 and as suggested here and
rebooted, and great stuff all is sorted.
Thank you very much
Original comment by DaveRan...@gmail.com
on 19 Aug 2013 at 10:02
Solved in version 116 that is available to download
Original comment by lalelu...@gmail.com
on 19 Apr 2014 at 9:07
Original issue reported on code.google.com by
DaveRan...@gmail.com
on 8 Aug 2013 at 4:39