Skip to content

Commit

Permalink
dying on gpio errors or sensors not found
Browse files Browse the repository at this point in the history
  • Loading branch information
ronanguilloux committed Dec 3, 2012
1 parent c4464ee commit 5955333
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion thermometer
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ require __DIR__.'/vendor/autoload.php';

use TemperaturePi\Logger;

//TODO: Lauch as sudo & check+run modprobe w1-gpio & w1-therm
/*
if('root' !== $_SERVER['USER'] || empty($SERVER['SUDO_USER'])){
die("[ABORT] Please run this script as root\n");
}
*/

if(!file_exists('/sys/bus/w1/devices/28-000003ced8f4/w1_slave')) {
die("[ABORT] Please run: sudo modprobe w1-gpio; sudo modprobe w1-therm\n");
}

$log = new Logger;
$log->persist();
Expand Down

0 comments on commit 5955333

Please sign in to comment.