osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/27442 )
Change subject: net/templates: support running osmo-bts-virtual
......................................................................
net/templates: support running osmo-bts-virtual
New config variables:
* BTS0_RUN_IN_OSMO_DEV
* BTS0_IP
* BTS1_RUN_IN_OSMO_DEV
* BTS1_IP
Change-Id: Ibc8efe75abffcefc0a719b6323a9ceca39f14ea1
---
M net/README
M net/config_2g3g
R net/templates/osmo-bts-0.cfg
A net/templates/osmo-bts-1.cfg
M net/templates/run.sh
5 files changed, 39 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/42/27442/1
diff --git a/net/README b/net/README
index 696a803..3ca15fe 100644
--- a/net/README
+++ b/net/README
@@ -149,11 +149,14 @@
=== 2G BTS
-At the time of writing, there are no osmo-bts.cfg files, since this is intended
-for the core network and BSC components only. Feel free to add!
+You can either let osmo-dev run osmo-bts-virtual, or connect a real BTS to the
+BSC + CN started by osmo-dev.
-Typically you'd need to edit only the /etc/osmocom/osmo-bts.cfg to match your
-IP address and ipa unit-id:
+To start osmo-bts-virtual, set BTS0_RUN_IN_OSMO_DEV=1 and/or
+BTS1_RUN_IN_OSMO_DEV=1 in your copy of config_2g3g.
+
+To connect your real BTS, typically you'd need to edit only the
+/etc/osmocom/osmo-bts.cfg to match your IP address and ipa unit-id:
bts 0
oml remote-ip 192.168.0.23
diff --git a/net/config_2g3g b/net/config_2g3g
index eb43e03..bc0ced3 100644
--- a/net/config_2g3g
+++ b/net/config_2g3g
@@ -39,6 +39,9 @@
BTS0_MAX_POWER_RED=${BTS_MAX_POWER_RED}
BTS0_NOMINAL_POWER=${BTS_200mW}
BTS0_CODEC_SUPPORT=${BTS_CODEC_SUPPORT}
+# set to 1 to have osmo-dev run osmo-bts-virtual
+BTS0_RUN_IN_OSMO_DEV=0
+BTS0_IP="127.0.0.12"
BTS1_DESCRIPTION="my test BTS 1"
BTS1_IPA_UNIT="1 0"
@@ -56,6 +59,9 @@
BTS1_MAX_POWER_RED=${BTS_MAX_POWER_RED}
BTS1_NOMINAL_POWER=${BTS_200mW}
BTS1_CODEC_SUPPORT=${BTS_CODEC_SUPPORT}
+# set to 1 to have osmo-dev run osmo-bts-virtual
+BTS1_RUN_IN_OSMO_DEV=0
+BTS1_IP="127.0.0.13"
HLR_IP=127.0.0.5
diff --git a/net/templates/osmo-bts.cfg b/net/templates/osmo-bts-0.cfg
similarity index 71%
rename from net/templates/osmo-bts.cfg
rename to net/templates/osmo-bts-0.cfg
index 1d3e6a9..f6fd3ac 100644
--- a/net/templates/osmo-bts.cfg
+++ b/net/templates/osmo-bts-0.cfg
@@ -4,3 +4,9 @@
bts 0
ipa unit-id ${BTS0_IPA_UNIT}
oml remote-ip ${BSC0_IP}
+
+ctrl
+ bind ${BTS0_IP}
+
+line vty
+ bind ${BTS0_IP}
diff --git a/net/templates/osmo-bts-1.cfg b/net/templates/osmo-bts-1.cfg
new file mode 100644
index 0000000..e4e3c64
--- /dev/null
+++ b/net/templates/osmo-bts-1.cfg
@@ -0,0 +1,12 @@
+${include(common_template_warning)}
+${include(common_osmo_bts)}
+
+bts 0
+ ipa unit-id ${BTS1_IPA_UNIT}
+ oml remote-ip ${BSC1_IP}
+
+ctrl
+ bind ${BTS1_IP}
+
+line vty
+ bind ${BTS1_IP}
diff --git a/net/templates/run.sh b/net/templates/run.sh
index 3430966..42b1eb4 100755
--- a/net/templates/run.sh
+++ b/net/templates/run.sh
@@ -181,6 +181,7 @@
stp4ran="osmo-stp -c osmo-stp-ran.cfg"
bsc="LD_LIBRARY_PATH=/usr/local/lib gdb -ex run --args osmo-bsc"
bscnat="osmo-bsc-nat"
+bts="osmo-bts-virtual"
if [ "x${MSC_MNCC}" != "xinternal" ]; then
sipcon="osmo-sip-connector -c osmo-sip-connector.cfg"
@@ -272,6 +273,13 @@
term "$bsc -c osmo-bsc-1.cfg" BSC1
fi
+${foreach(BTS)}
+if [ "${BTSn_RUN_IN_OSMO_DEV}" = 1 ]; then
+ term "$bts -c osmo-bts-${BTSn}.cfg" BTS${BTSn}
+fi
+${foreach_end}
+
+
if [ "x${MSC_MNCC}" != "xinternal" ]; then
sleep .2
term "$sipcon" SIPCON
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/27442
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: Ibc8efe75abffcefc0a719b6323a9ceca39f14ea1
Gerrit-Change-Number: 27442
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/27441 )
Change subject: net/templates/common_osmo_bts: drop osmotrx ip
......................................................................
net/templates/common_osmo_bts: drop osmotrx ip
Don't attempt to configure phy0 / osmotrx ip. This only works with
osmo-bts-trx, not with osmo-bts-virtual which we'll run in osmo-dev.
Besides that, 127.0.0.1 seems to be the default anyway.
Change-Id: I20984d00623f31ce9c58a1dc91bcf53d4aec78b2
---
M net/templates/common_osmo_bts
1 file changed, 0 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/41/27441/1
diff --git a/net/templates/common_osmo_bts b/net/templates/common_osmo_bts
index cfd28fb..4244e34 100644
--- a/net/templates/common_osmo_bts
+++ b/net/templates/common_osmo_bts
@@ -3,8 +3,6 @@
phy 0
instance 0
- osmotrx ip local 127.0.0.1
- osmotrx ip remote 127.0.0.1
bts 0
band ${BTS_BAND}
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/27441
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: I20984d00623f31ce9c58a1dc91bcf53d4aec78b2
Gerrit-Change-Number: 27441
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-dev/+/27433 )
Change subject: net/fill_config.py: refactor print 'using config...'
......................................................................
net/fill_config.py: refactor print 'using config...'
Put each line in a separate, aligned print statement and use f-strings
(Python 3.6 feature, even debian oldstable has > 3.6 by now).
This is in preparation to add a new line about the original config in
the next patch.
Change-Id: Iad39a7889c107ceb8c16325bb545cb426eb9b6e2
---
M net/fill_config.py
1 file changed, 3 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-dev refs/changes/33/27433/1
diff --git a/net/fill_config.py b/net/fill_config.py
index d68f50c..f68f572 100755
--- a/net/fill_config.py
+++ b/net/fill_config.py
@@ -52,7 +52,9 @@
tmpl_dir = os.path.realpath(tmpl_dir)
net_dir = os.path.realpath(".")
-print('using config file %r\non templates %r\nwith NET_DIR %r' % (local_config_file, tmpl_dir, net_dir))
+print(f'using config file: {local_config_file}')
+print(f'on templates: {tmpl_dir}')
+print(f'with NET_DIR: {net_dir}')
with open(LAST_LOCAL_CONFIG_FILE, 'w') as last_file:
last_file.write(local_config_file)
--
To view, visit https://gerrit.osmocom.org/c/osmo-dev/+/27433
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-dev
Gerrit-Branch: master
Gerrit-Change-Id: Iad39a7889c107ceb8c16325bb545cb426eb9b6e2
Gerrit-Change-Number: 27433
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: newchange