From 9ed6f0719d90473dc324142599ecdfac9d376a04 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Sat, 14 Oct 2017 09:16:21 +0200 Subject: [PATCH] Debug motor count --- feature/motheure-simple/source/loop.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/feature/motheure-simple/source/loop.php b/feature/motheure-simple/source/loop.php index 69f7b0f..e188c63 100644 --- a/feature/motheure-simple/source/loop.php +++ b/feature/motheure-simple/source/loop.php @@ -71,7 +71,7 @@ if( !motheure_read() ) // if not active -> continue watching return false; - slog('Motor active detected', 'motheure-simple:loop', 'motheure'); + slog('Motor start', 'motheure-simple:loop', 'motheure'); /* [3] Wait for machine to stop =========================================================*/ @@ -87,7 +87,9 @@ /* (2) If stopped -> increment offset */ if( !motheure_read() ){ + $offset++; + slog("Motor offset: $offset/$THRESHOLD", 'motheure-simple:loop', 'motheure'); /* (3) If not stopped */ }else{ @@ -107,6 +109,7 @@ $f_data->fwrite( json_encode([ floor( $stop_ts - $start_ts ) ]).PHP_EOL ); + slog("Motor stop", 'motheure-simple:loop', 'motheure'); /* (2) Return status */ return true;