Commit 27219a5e authored by Timothy Stack's avatar Timothy Stack
Browse files

Make sure the garcia is powered on and up before trying to ssh in and

load the mote.
parent 3cb0dde5
......@@ -36,6 +36,7 @@ use strict;
my $UISP = "$TB/bin/uisp";
my $SGUISP = "/usr/local/bin/uisp";
my $SSHTB = "$TB/bin/sshtb";
my $POWER = "$TB/bin/power";
my $DEBUG = 1;
#
......@@ -226,6 +227,30 @@ MOTE: foreach my $mote (@motes) {
# uisp
$upload_method = "ssh";
my $nodestate;
if (! TBGetNodeEventState($host, \$nodestate) ||
$nodestate eq TBDB_NODESTATE_POWEROFF) {
warn "$host: power cycling";
system("$POWER cycle $host");
if ($?) {
$errors++;
warn "Mote host ($host) failed to power up.";
next MOTE;
}
}
my $actual_state;
if (TBNodeStateWait($host,
time,
(60*6),
\$actual_state,
(TBDB_NODESTATE_ISUP,))) {
$errors++;
warn "Mote host ($host) is not up.";
next MOTE;
}
last TSWITCH;
};
# Default
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment