Commit 05c8dce8 authored by Jonathon Duerig's avatar Jonathon Duerig

Merge branch 'sim-startup' into 'master'

Sim startup

See merge request !1
parents 616113a3 1ef98cbd
......@@ -37,8 +37,35 @@ system("apt-get install multitail");
#
# Setup ssh commands
#
#
# Display help and exit.
#
sub help() {
logprint("Usage: start_oai [-r sim]\n");
exit 1;
}
my %opts = ();
if (!getopts("r:",\%opts)) {
help();
}
my $enbStart = "/usr/bin/ssh -p 22 -o ServerAliveInterval=300 -o ServerAliveCountMax=3 -o BatchMode=yes -o StrictHostKeyChecking=no enb1 ";
my $role = $opts{'r'};
my $simPresent = "0";
if ($role eq "sim") {
$simPresent = "1";
}
my $enbStart;
if ($simPresent == "1")
{
$enbStart = "/usr/bin/ssh -p 22 -o ServerAliveInterval=300 -o ServerAliveCountMax=3 -o BatchMode=yes -o StrictHostKeyChecking=no sim-enb ";
}
else
{
$enbStart = "/usr/bin/ssh -p 22 -o ServerAliveInterval=300 -o ServerAliveCountMax=3 -o BatchMode=yes -o StrictHostKeyChecking=no enb1 ";
}
my $epcStart = "/usr/bin/ssh -p 22 -o ServerAliveInterval=300 -o ServerAliveCountMax=3 -o StrictHostKeyChecking=no epc ";
my $nickname = `$CAT $BOOTDIR/nickname`;
......@@ -60,7 +87,14 @@ print "Killing off any old services...\n";
system($epcStart . "/local/repository/bin/hss.kill.sh");
system($epcStart . "/local/repository/bin/mme.kill.sh");
system($epcStart . "/local/repository/bin/spgw.kill.sh");
if ($simPresent == "1")
{
system($enbStart . "/local/repository/bin/sim_enb.kill.sh");
}
else
{
system($enbStart . "/local/repository/bin/enb.kill.sh");
}
print "Starting HSS...\n";
system($epcStart . "/local/repository/bin/hss.start.sh");
......@@ -74,18 +108,25 @@ print "Starting SPGW...\n";
system($epcStart . "/local/repository/bin/spgw.start.sh");
sleep(30);
print "Starting ENB...\n";
my $devices = `${enbStart}lsusb`;
if ($devices =~ /2500:0020/)
if ($simPresent == "1")
{
system($enbStart . "/local/repository/bin/enb.start.sh");
print "Starting SIM ENB...\n";
system($enbStart . "/local/repository/bin/sim_enb.start.sh");
}
else
{
print "Starting ENB...\n";
my $devices = `${enbStart}lsusb`;
if ($devices =~ /2500:0020/)
{
system($enbStart . "/local/repository/bin/enb.start.sh");
}
else
{
print "ERROR: Could not detect USRP B210 radio on the enb1 node. This is usually a transient error. Reboot the enb1 node and try again.\n";
exit(1);
}
}
#
# Display Output of services
#
......
......@@ -30,14 +30,23 @@ For more detailed information:
""";
tourInstructions = """
After booting is complete, log onto either the `enb1` or `epc` nodes. From there, you will be able to start all OAI services across the network by running:
After booting is complete,
For Simulated UE, log onto `epc` node and run:
sudo /local/repository/bin/start_oai.pl -r sim
Else, log onto either the `enb1` or `epc` nodes. From there, you will be able to start all OAI services across the network by running:
sudo /local/repository/bin/start_oai.pl
This will stop any currently running OAI services, start all services (both epc and enodeb) again, and then interactively show a tail of the logs of the mme and enodeb services. Once you see the logs, you can exit at any time with Ctrl-C, but the services stay running in the background and save logs to `/var/log/oai/*` on the `enb1` and `epc` nodes.
Above command will stop any currently running OAI services, start all services (both epc and enodeb) again, and then interactively show a tail of the logs of the mme and enodeb services. Once you see the logs, you can exit at any time with Ctrl-C, but the services stay running in the background and save logs to `/var/log/oai/*` on the `enb1` and `epc` nodes.
Once all the services are running, the UE device will typically connect on its own, but if it doesn't you can reboot the phone. You can manage the UE by logging into the `adb-tgt` node, running `pnadb -a` to connect, and then managing it via any `adb` command such as `adb shell` or `adb reboot`.
For Simulated UE experiment, check the connectivity by logging into the `sim-enb` node and run:
ping -I oip1 8.8.8.8
While OAI is still a system in development and may be unstable, you can usually recover from any issue by running `start_oai.pl` to restart all the services.
* [Full Documentation](https://gitlab.flux.utah.edu/powder-profiles/OAI-Real-Hardware/blob/master/README.md)
......
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