Hi again,
I was too fast and forgot to tell what was wrong ;)
In fact when I restart MH the first check is working but all others are wrong.
from the shell it works fine.
Thanks,
Emmanuel
Emmanuel Grout wrote:
Hello the list :)
I want to monitor my presence using my Bluetooth cell phone so I did this :
######################################
use Net::Bluetooth;
########################################################################
# Ping BT device
########################################################################
sub Check_BT() {
my $BT_obj = Net::Bluetooth->newsocket("RFCOMM");
die "socket error $!\n" unless(defined($BT_obj));
if($BT_obj->connect(@_, 1) != 0) { print_log "@_ is dead"; }
else { print_log "@_ is alive"; }
$BT_obj->close();
}
########################################################################
# Main
########################################################################
if (new_second 20) { &Check_BT('AC:A8:E5:18:5B:F1'); }
However this is working fine from the shell but not from MisterHouse ?!
I think I am doing something wrong with the socket inside MH but can't figure what.
Any ideas ?
Good day to all !
Emmanuel