Commit Graph

772 Commits

Author SHA1 Message Date
Holger Hans Peter Freyther c265bef48c sysmobts: Add slave on/off action for the sysmoBTS2050
Add new power actions for the sysmoBTS2050. This allows to
switch off the secondary/slave when the system temperature
is too high and back on when the normal level is reached.

Do not allow to switch off the master (so remove the enum
value), do not check if the slave is switching itself off.
2014-12-16 20:22:28 +01:00
Holger Hans Peter Freyther 02a2afa962 sysmobts: Comment out the varpoware options that are not implemented 2014-12-16 20:22:28 +01:00
Holger Hans Peter Freyther ffc193443c sysmobts: Add "normal" actions to execute
Instead of keeping state to remember what was done and needs
to be undone this patch introduces actions that will be executed
when the system is back to normal.

By design the system is considered to be in the normal state
and these actions will be only executed after the system is
coming back to the normal state.

One advantage of this scheme is that an operator can decide
that an overheated systems hould be off duty and requires manual
interaction to be allowed back in service.

The change has only been smoke tested

Fixes: SYS#833
2014-12-16 20:22:28 +01:00
Holger Hans Peter Freyther 8968b48643 sysmobts: Remove unused global variables
We do not need to have these variables anymore. Just remove them.
2014-12-16 15:12:56 +01:00
Holger Hans Peter Freyther 641a934931 sysmobts: Read the clock calibration from another place
Read the clock calibration from the place that will be read by
the BTS process. Use the standard eeprom code for doing that.
The code assumes that this and the other eeprom code don't
write/invlidate the others reason. If that assumption would not
be true calls to eeprom_free_resources should be added.
2014-12-16 15:12:55 +01:00
Holger Hans Peter Freyther 69897d7eed sysmobts: Don't list non integer parameters in the help
The command can only read integer parameters. Don't offer
buffers as this will lead to error 22.
2014-12-16 15:09:22 +01:00
Holger Hans Peter Freyther 0d09e75f9c eeprom: Fix brown paper bag introduced a long while ago
91d204e2db while adding checks
to resolve coverity issues. We simply had no one writing to
the eeprom so this was unnoticed for a long time.
2014-12-16 15:09:22 +01:00
Holger Hans Peter Freyther 42cc96e2c1 sysmobts: Add an option to stop the systemd sysmobts.service
For systems without direct access to the PA the best option
is to simply switch off the bts service. This will stop the
transmission which will take load from the DSP/FPGA/RF circuit
and indirectly from the PA as well.

We should introduce "pa-on and bts-on" that can be executed
as "normal" action.
2014-12-12 14:53:23 +01:00
Holger Hans Peter Freyther 8381a6a483 sysmobts: Actions can be executed in all levels
Somebody could decide to switch off the PA in the warning level
already. Support this mode of operation. This means we could have
a config that:

* Enables the PA in the normal level
* Disables it in the critical level

With kdbus or better IPC we could even have the PA and other
parts be represented as service that talk to a bts manager and
then simply execute start/stop requests. This would make the
entire TODO entry irrelevant as state would be managed by
systemd and one can see the time the service was executed.
2014-12-12 14:40:25 +01:00
Holger Hans Peter Freyther 4d4dc26742 bts: Move BTS and children into the enabled state after opstart
With "show bts 0" all objects were still listed as dependency.
Once the BTS has been started.. move all the other objects into
the enabled state. Our OpenBSC OML code doesn't care but people
using the VTY to inspect state will be more happy.

One day... we will create proper statemachines inside the BTS
and the BSC instead of changing the state in the BTS impl.

Fixes: ONW#1330
2014-11-10 15:16:16 +01:00
Holger Hans Peter Freyther 48eb374a96 bts: Start with the site manager being enabled and available
We would never transition the sitemanager to anything. Our SW
does not support SW activation's so we are always ready.

Related: ONW#1330
2014-11-10 15:12:38 +01:00
Holger Hans Peter Freyther 2fa6ef2687 bts: Mark NSVC1 as offline. We do not expose a second NSVC
OsmoBSC> show bts 0
  ...
  GPRS NSVC1: Oper 'Disabled', Admin 'unknown 0x0', Avail 'Off line'
2014-11-10 13:18:59 +01:00
Holger Hans Peter Freyther 6d8bcbd192 bts: Fix typo in OML comment 2014-11-10 13:01:33 +01:00
Holger Hans Peter Freyther b89a5fa55d bts: In case the line isn't created do not exit with code 1
The service file will prevent a re-launch of the sysmobts.service
in case the main process exits with '1'. In case the ethernet is
not available yet the routine would fail and the sysmobts process
will not be restarted.

unable to connect/bind socket: Network is unreachable
<000f> input/ipaccess.c:885 cannot open OML BTS link: Network is unreachable
unable to connect to BSC
root@sysmobts-v2:~# echo $?
2

Fixes: SYS#736
2014-11-10 12:53:22 +01:00
Holger Hans Peter Freyther 9f0002b52b ctrl: Fix compiler warning
bts_ctrl_lookup.c: In function 'bts_controlif_setup':
bts_ctrl_lookup.c:97:2: warning: implicit declaration of function 'bts_ctrl_cmds_install' [-Wimplicit-function-declaration]
  rc = bts_ctrl_cmds_install(bts);
  ^
2014-11-10 12:04:48 +01:00
Holger Hans Peter Freyther 1cce69364d abis: Fix compiler warning and remove const from syntax
libosmo-abis doesn't make it easy to have these parameters
as const.. just declare it non-const in the api. We pass
a static string but we know it will not be modified.
2014-11-10 12:02:45 +01:00
Holger Hans Peter Freyther 8332e29c9f tch: Avoid compiler warnings when using the direct RTP mode
tch.c: In function 'l1_to_rtppayload_amr':
tch.c:247:29: warning: unused variable 'amr_mrc' [-Wunused-variable]
  struct amr_multirate_conf *amr_mrc = &lchan->tch.amr_mr;
                             ^
tch.c: In function 'rtppayload_to_l1_amr':
tch.c:335:10: warning: unused variable 'amr_if2_core_len' [-Wunused-variable]
  uint8_t amr_if2_core_len = payload_len - 2;
2014-11-10 11:59:53 +01:00
Holger Hans Peter Freyther be63f03254 sysmobts: Call the routine send and receive instead of get 2014-11-10 11:58:21 +01:00
Andreas Eversberg 9f22fcfd36 Correctly fill system information messages from BSC
SI 5*/6 require L2 header of 0x03,0x03. All SI might be less than 23
octets, so they need to be filled with 0x2b.
2014-08-27 23:45:47 +02:00
Harald Welte 11b14fd662 tx_power: Check actual TRX output power against intended value
We use the completion call-back from L1 to compare the instructed
TRX board output power with the actual value as reported  back from
L1.

Right now we only print an error message in case the values disagree.

In the future we might want to either use that value as part of our
calculation or send an OML alarm report to the BSC.
2014-08-25 19:01:24 +02:00
Harald Welte 9e873335ec Revert "add nominal transmit power for upcoming sysmoBTS 1020 and 1100"
This reverts commit d0866fe477, as it
was a bit premature.  We need to address this more properly.
2014-08-25 18:06:29 +02:00
Holger Hans Peter Freyther 04585dd90a tx: Generate a working configuration file on "write"
We do not have the vty test script to do roundtrip testing. There
is no max-initinal-pout, then there was a typo inside 'initial' and
for the relative step size the unit is dB/mdB. Fix both of that.
2014-08-25 16:06:56 +02:00
Holger Hans Peter Freyther 645cba8532 tx: Fix another typo i found today morning 2014-08-25 16:01:29 +02:00
Holger Hans Peter Freyther adddb65f46 sysmobts: Remove left-over from non-generic power control 2014-08-25 16:01:23 +02:00
Holger Hans Peter Freyther fbf04438b7 ctrl: Use msgb_free to free message 2014-08-25 16:01:23 +02:00
Harald Welte e0e9b30f5c tx_power.c: fix potential array out-of-bounds access 2014-08-25 10:05:55 +02:00
Harald Welte 68b9b376cf make use of libosmocore 'gsm_meas_rep_unidir'
Back in March 2013, some structures and defines related to decoded
measurement reports have been moved from openbsc to libosmocore
(libosmocore e128f4663104ed64e33e362cff2566f36d65e658) so that they can
be used also from osmo-bts.  This finally follows up on that.

You need openbsc 7ff4f0e0fc692bfab829da50edb104e58b271e7e or later.
2014-08-25 09:22:00 +02:00
Harald Welte d0866fe477 add nominal transmit power for upcoming sysmoBTS 1020 and 1100 2014-08-25 08:48:37 +02:00
Harald Welte 913044ecc5 tx_power.c: Fix typos in comments 2014-08-25 08:46:48 +02:00
Harald Welte 3dd6ebe0b8 add information on unit (milli-dB) to control interface doc 2014-08-25 08:42:08 +02:00
Harald Welte 1fb66c8e6a disable clock control interface on HW_SYSMOBTS_V1 2014-08-24 18:16:45 +02:00
Harald Welte ab09e27d72 add control_if.h to Makefile.am 2014-08-24 17:42:47 +02:00
Harald Welte c0a3030277 add a small document describing the use of the control interface 2014-08-24 17:19:59 +02:00
Harald Welte be18984959 ctrl: Add sysmobts control interface
This sysmobts specific control interface allows for clock calibration
from an external program by means of the "trx.0.clock-info" and
"trx.0.clock-correction" values.
2014-08-24 17:07:02 +02:00
Harald Welte 9d0fd073e9 l1_if: pass private 'void *data' from call to callback
When enqueueing a command towards the L1, we can now pass along
a private data pointer, which then gets passed to the call-back
upon completion.
2014-08-24 17:05:23 +02:00
Harald Welte 8e4cc1cbb8 fix build problem introduced with control interface 2014-08-24 17:04:54 +02:00
Harald Welte 993575bcd8 use libocmocore #defines for VTY port numbers 2014-08-24 16:59:07 +02:00
Harald Welte 0ff0f2d00f ctrl_if: Move control interface to port 4238
... which is now defined in libosmocore
2014-08-24 16:59:05 +02:00
Harald Welte d9a2aa8d99 add control interface to common BTS (for thermal attenuation)
Using this control interface, an external program can request
attentuation of the transmitter for thermal management reasons. The
external application doesn't have to know anthing about the actual
transmit power, but it can just configure a certian value of milli-dB
(1/10000 bel) and update (increase/decrease) that value depending on
the thermal environment.
2014-08-24 16:42:02 +02:00
Harald Welte e43feaf231 New generic transmit power handling
In order to support transmit power reduction by thermal management
as well as the variety of new internal / external PA configurations
of BTSs, we need a slightly more complex system.

Also, as at high power a single dB can be quite a big difference,
we are now doing all computations in milli-dB(m), i.e. 1/10000 bel.

Ramping is now used both for up and down ramping, as that is useful in
cases where you want to gracefully shut down a cell by shrinking its
radius, gradually handing over subscribers to neighboring cells.

Furthermore, this code is becoming part of the 'common' codebase, as it
is not really specific to how sysmobts is working.

The user can specify a single aggregate value for external system
gain/attenuation.  Let's say you have 1dB loss of antenna cable, so you
can put that as 'user-gain -1' into the config, which means that a
'transmit power of 20dBm' will be compensatet for that and the TRX is
instructed to output 21dBm to compensate the cable loss.  Similarly,
external PAs can be described by a positive user-gain.

One of the next steps will be to communicate those values and the
nominal power capability of the specific BTS to the BSC, so the BSC will
automatically show correct signal levels in the VTY and log files.

The code includes provisions for future extensions regarding
* an external and an internal PA with calibration tables
* a thermal attenuation setting to be controlled by the site manager
2014-08-24 10:46:21 +02:00
Harald Welte fcca2e8218 remove copy of gsm_bts_num()
... which is now available from gsm_data_shared.[ch] of openbsc
2014-08-24 10:46:21 +02:00
Holger Hans Peter Freyther 15f899f89e sysmobts: Use the uc connection on both slave and master
We can use this on both slave and master. But only have the
master switch on the PA.
2014-08-22 00:06:01 +02:00
Holger Hans Peter Freyther 3a54b7aa30 Merge branch 'sysmocom/features/sysmobts-mgr-temp'
Implement the first round of temperature control and actions. Only
the PA can be switched off, it will never be switched on again, in
case the microcontroller doesn't respond we will do nothing as well.
These todos need to be addressed in the near future.
2014-08-21 23:55:37 +02:00
Holger Hans Peter Freyther 1f8053e366 sysmobts: Enable the PA on start and disable it as first action
The PA will be unconditionally turned. This makes it possible
that in case of a crash, the PA will be turned on and then we
will do the temperature measurement and turn it off again. There
are no known crashes with the sysmobts-mgr right now so the risk
seems to be okay. In case we can't switch off the PA we have no
way to escalate it right now. We have not seen a dead uc either
so the risk is okay as well.

We can't switch the PA back on once we reach the normal level
as the BTS might transmit with full power and we would need more
current than the power supply/rails can carry. So leave the
system off right now.

What is missing is to use the OML router to actually inform
the BSC that something bad has happened at the BTS.
2014-08-21 23:55:27 +02:00
Holger Hans Peter Freyther e02d7796c3 sysmobts: Show the current temperature controls state int he VTY 2014-08-21 23:55:27 +02:00
Holger Hans Peter Freyther 714ccb9992 sysmobts: Provide information about the state transitions 2014-08-21 23:55:27 +02:00
Holger Hans Peter Freyther b0674e9636 sysmobts: Implement a small state machine for temp control
Check the temperature and move between "NORMAL", "WARNING"
and "CRITICAL" state. We will only return from CRITICAL to
WARNING when the temperature has significantly changed, and
when being in state "WARNING" we enter an intermediate state
to allow an easy hysteris.
2014-08-21 23:55:27 +02:00
Holger Hans Peter Freyther d036cce744 sysmobts: Remove the sbt2050 timer and move defines back
We haven't done anything with the result of the micro controller
query and querying every six hours for the temperature of the
system will not help us. We need to query the temperatures more
frequently but avoid writing to the eeprom too frequently so we
will start another timer for that.
2014-08-21 23:55:27 +02:00
Holger Hans Peter Freyther c42bf5fdf5 sysmobts: Simplify some includes/dependencies 2014-08-21 23:55:27 +02:00
Holger Hans Peter Freyther ca71d07e44 sysmobts: Begin to add various limits and actions
The idea is that for different parts of the system we can define
thresholds for warning and critical (severe) temperate thresholds.
And once any of these temperatures is reached we will execute an
action. When crossing from NORMAL to WARNING or WARNING to SEVERE
we will need to apply some hysteris before switching back to the
lower level. E.g. when being SEVERE mode, at least wait until we
are below the warning level again. Besides being able to switch
off things we could start reducing the transmit power of the system
until the system is cold enough again.

No action is implemented so far, everything is varpoware!
2014-08-21 23:55:27 +02:00