Copy the example request-stand1.py and modify accordingly.
According to your physical setup, you can request multiple RUs and related cells.
Example request-stand1.py
#!/usr/bin/env -S slapos console
"""request mme/enb and configure radio units and cells"""
# XXX workaround for `slapos console` not setting up sys.path the same way as std python does
import sys
from os.path import dirname
sys.path.insert(0, dirname(__file__))
import kslap
kslap.init(slap)
import json, copy
kamari = "https://lab.nexedi.com/nexedi/slapos/raw/xy/lte-multiru/software/ors-amarisoft/software.cfg"
stand1 = "COMP-3909"
supply(kamari, computer_guid=stand1)
# eNB
ienb = kslap.request(kamari,
software_type="enb",
partition_reference="stand1-ENB",
filter_kw={"computer_guid": stand1},
partition_parameter_kw={"_": json.dumps({
"enb_id": "6217",
"gtp_addr": "11.131.225.38",
"mme_list": {"TOP CN": {"mme_addr": "10.224.212.241"}},
"plmn_list": {"TOP PLMN": {"plmn": "25001","reserved": True}},
"log_phy_debug": False,
"gps_sync": False,
"use_ipv4": True,
"enb_stats_fetch_period": 60
})})
# eref returns full reference for ienb's shared instance with given ref.
def eref(ref):
enb_ref = kslap.ref_of_instance(ienb)
return '%s.%s' % (enb_ref, ref)
# iENB is shorthand to request shared instance on ienb.
def iENB(ref, kw):
return kslap.iSHARED(ienb, ref, kw)
# Radio Units
RU1 = {
'ru_type': 'lopcomm',
'ru_link_type': 'cpri',
'cpri_link': {
'sdr_dev': 0,
'sfp_port': 1,
'mult': 4,
'mapping': 'hw',
'rx_delay': 25.11,
'tx_delay': 14.71,
'tx_dbm': 63
},
'mac_addr': '00:0A:45:00:00:00',
'n_antenna_dl': 1,
'n_antenna_ul': 1,
'tx_gain': -20,
'rx_gain': -20,
'txrx_active': 'INACTIVE',
}
RU2 = copy.deepcopy(RU1)
RU2['cpri_link']['sfp_port'] = 2
RU2['mac_addr'] = '90:A9:F7:C0:00:03'
iru1 = iENB(eref('RU1'), RU1)
iru2 = iENB(eref('RU2'), RU2)
# Cells
CELL1 = {
'cell_type': 'lte',
'cell_kind': 'enb',
'rf_mode': 'fdd',
'bandwidth': 20,
'dl_earfcn': 100, # 2120 @ B1
'pci': 1,
'cell_id': '0x01',
'tac': '0x1234',
'ru': {
'ru_type': 'ru_ref',
'ru_ref': eref('RU1')
}
}
CELL2 = copy.deepcopy(CELL1)
#CELL2['dl_earfcn'] = 500 # 2160 @ B1
CELL2['dl_earfcn'] = 2850 # 2630 @ B7
CELL2['pci'] = 2
CELL2['cell_id'] = '0x02'
CELL2['ru']['ru_ref'] = eref('RU2')
icell1 = iENB(eref('CELL1'), CELL1)
icell2 = iENB(eref('CELL2'), CELL2)