google-code-export / measureit

Automatically exported from code.google.com/p/measureit
1 stars 0 forks source link

Setup tab not working #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In an attempt to use a 3 way transmitter and a second single transmitter i used 
all the sensors, Now when I click setup to remove some sensors  it ignores me. 
What steps will reproduce the problem?
1. I have rebooted my Raspi
2. I tried stopping thr grabber 
3. I tried using a different USB port

What is the expected output? What do you see instead?

see attached
What version of the product are you using? On what operating system?
115 raspberry Pi with measureit image

Please provide any additional information below.

Original issue reported on code.google.com by DaveRan...@gmail.com on 8 Aug 2013 at 4:39

GoogleCodeExporter commented 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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
Solved in version 116 that is available to download

Original comment by lalelu...@gmail.com on 19 Apr 2014 at 9:07