aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo/misc
AgeCommit message (Collapse)AuthorFilesLines
2017-06-22Copy sysmobts.service to osmo-bts-sysmoMax2-6/+6
This way the name of systemd service file will match the name of the binary similar to lc15. Add aliases so the user can use both old and new names regardless of which file is installed. Once the corresponding changes to OE recipes are applied old file can be removed. Based on work by Pau Espin Pedrol <pespin@sysmocom.de> Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5
2017-05-15Prepare for BTS attribute reporting via OMLMax4-23/+37
* move BTS model name resolution into separate function * add convenience wrappers for BTS type and number fo TRX and use then in L1 interface Change-Id: I4649100df8f1b8e095f210fc294567ba014c0b6a Related: OS#1614
2017-04-30sysmobts: Store a simple network config in the EEPROM as wellHolger Hans Peter Freyther4-8/+168
Make it possible to store: * Static vs. DHCP mode * IPv4 address * Netmask * GW IPv4 address * DNS IPv4 address Add a simple CRC8 and pick 0xFF as initial value so an all zero EEPROM will not generate a 0 CRC. The code tries to differentiate exit code between unreadable EEPROM and CRC error. This is a reference to see if we want to have store it in the EEPROM or not. Change-Id: Id8a37fe952ef2a8ef36778729f506f900accf8d1
2017-04-29sysmobts: Make reservation for mode/netmask/ip and sucHolger Hans Peter Freyther2-1/+16
Change-Id: Ib98856356dc296be9e449d35479bc9234c0c4d32
2017-03-14Handle ctrl cmd allocation failuresMax1-18/+19
Check that ctrl command was successfully allocated before using it. Fixes: CID163884 Change-Id: Id19e1ce5fae6f936c9ed93f9a6317b57d28d7311
2017-02-24Use oml-alert CTRL command for temp reportMax3-12/+64
Send temperature reports via OML alert facility exposed by CTRL protocol. Change-Id: If29fbd0ab01fefc76e87b90cf1fbc81b2089ba76 Related: OS#1615
2017-02-02sysmobts_eeprom.h: Fix/extend model number definitionsHarald Welte1-1/+2
Fix the model number definition for the 1020 and add the one for 1002. Change-Id: Iba4cfbbda1000d7e34eca614b3a6165d2feb65e1
2016-10-14msgb ctx: use new msgb_talloc_ctx_init() in various main()sNeels Hofmeyr1-3/+1
Change-Id: I31d62d5e1f0b272985fdef5013270d385c4b988a
2016-09-24sysmobts_mgr, lc15bts_mgr: fix tall context for telnet vtyNeels Hofmeyr1-1/+1
Instead of passing the msgb ctx to telnet_init(), pass the *mgr* ctx. Change-Id: I213fe52648a1937d8f8c1730ce787e42f0add75f
2016-07-07sysmobts: Fix eeprom padding before gpg keyHolger Hans Peter Freyther2-1/+7
Correct the too short padding I introduced in the commit a55b166c6c7af79cbefe8e65fe77b2d61c634d2d. The result needs to be 121 and not 120. Add static asserts to make sure it does not happen again. Change-Id: I3da7f3b8d3c8e12deb8b805cd15ff52a103d4e56
2016-06-15sysmobts: Add the barebox boot state reservationHolger Hans Peter Freyther1-1/+2
We are using up to 48 (actually only 8) bytes to manage the boot state of the device. Add it to the eeprom reservation. It turns out the current padding was too large (37 + 84 don't end at 120). Change-Id: I4c1de5925577f1d0b7b5cc08529642ffa333d7de
2016-01-04fix large amount of compiler warnings in common and sysmobts codeHarald Welte1-1/+1
2015-01-10sysmobts: Check mgr->calib.bts_conn for NULLHolger Hans Peter Freyther1-1/+1
Check the right variable for NULL. Fixes: CID 1262214
2015-01-10sysmobts: Improve some log messages for calib controlHolger Hans Peter Freyther1-2/+11
* Print the GPS FD that was opened (e.g. to see if it was closed again) * Print the state changes/expectations * Print the correct to be applied. I wondered if I shouldo do a cor = cor * -1.. cor = -cor.. or add CLOCK_CORR(err) macro to use it inside the printf and correction and decided the gain is not worth the risk.
2015-01-09sysmobts: Create a calibration loop that will be runHolger Hans Peter Freyther2-21/+64
Continously run the calibration process. Everytime we call the reset function classify the outcome. In case of a failure schedule the next command soon and otherwise wait several hours. Remember if the process was started through the VTY or the run loop. In case it can't be started immediately reset and schedule a new run.
2015-01-09sysmobts: Start the calibration the first time the link is upHolger Hans Peter Freyther2-0/+13
After a reboot the system might have been off for a long time and the currently used value might be wrong. Remember that we never ran the calibration and execute it on start.
2015-01-09sysmobts: Initial version to use libgps to determine FIX stateHolger Hans Peter Freyther2-2/+113
We should only calibrate the clock if there is a GPS fix. Start gpsd to determine if there is a fix or not. Work around trimble decoding issues (sent an email upstream). We need to gain some more experience to see if there memory leaks. We also need to re-schedule the calibration depending on the outcome.
2015-01-09sysmobts: The correction for GPS is in the reverse directionHolger Hans Peter Freyther1-3/+18
Change the sign before passing it as correction value. The error is the difference between the TCXO and GPS. We need to correct by the reverse of the error. This seems to be different depending on the clock source we have. This is a last minute untested change.
2015-01-09sysmobts: Use the ctrl interface for calibrationHolger Hans Peter Freyther3-4/+260
This runs the entire procedure for calibration with reasonable error and success checking. It can be triggered from the VTY of the sysmobts-mgr right now. What is missing is to hook up with GPSD to check if the system has a fix and provide a mode that will continously run the calibration command.
2015-01-09sysmobts: Begin with calib control from the sysmobts managerHolger Hans Peter Freyther4-0/+152
In the long run we will connect to GPSD and wait for a fix and then run the calibration. The first step is to open (and re-open) the control connection to the BTS. As the connection is on localhost there should not be a computation overhead to always have the connection open. When connecting assume that the ASYNC connect worked directly as otherwise we get no notification of the failure. This looks like a "bug" of libosmo-abis that should check if the socket has been connected or not.
2014-12-26sysmobts: Include the serial number in the find responseHolger Hans Peter Freyther1-1/+10
Read the serial number once and format it as a string. In case no serial number is present -1 will be returned. Manually tested with a slightly modified version. serial_nr was the expected one.
2014-12-16sysmobts: Add slave on/off action for the sysmoBTS2050Holger Hans Peter Freyther5-10/+97
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-16sysmobts: Comment out the varpoware options that are not implementedHolger Hans Peter Freyther1-0/+4
2014-12-16sysmobts: Add "normal" actions to executeHolger Hans Peter Freyther3-10/+113
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-16sysmobts: Read the clock calibration from another placeHolger Hans Peter Freyther3-9/+39
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-16sysmobts: Don't list non integer parameters in the helpHolger Hans Peter Freyther3-2/+23
The command can only read integer parameters. Don't offer buffers as this will lead to error 22.
2014-12-12sysmobts: Add an option to stop the systemd sysmobts.serviceHolger Hans Peter Freyther3-0/+34
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-12sysmobts: Actions can be executed in all levelsHolger Hans Peter Freyther1-20/+25
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-11-10sysmobts: Call the routine send and receive instead of getHolger Hans Peter Freyther1-4/+4
2014-08-24use libocmocore #defines for VTY port numbersHarald Welte1-1/+2
2014-08-22sysmobts: Use the uc connection on both slave and masterHolger Hans Peter Freyther3-6/+11
We can use this on both slave and master. But only have the master switch on the PA.
2014-08-21sysmobts: Enable the PA on start and disable it as first actionHolger Hans Peter Freyther5-6/+66
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-21sysmobts: Show the current temperature controls state int he VTYHolger Hans Peter Freyther3-0/+8
2014-08-21sysmobts: Provide information about the state transitionsHolger Hans Peter Freyther1-0/+12
2014-08-21sysmobts: Implement a small state machine for temp controlHolger Hans Peter Freyther5-6/+204
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-21sysmobts: Remove the sbt2050 timer and move defines backHolger Hans Peter Freyther3-19/+6
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-21sysmobts: Simplify some includes/dependenciesHolger Hans Peter Freyther3-19/+1
2014-08-21sysmobts: Begin to add various limits and actionsHolger Hans Peter Freyther3-13/+275
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-21sysmobts: Fix the temperature log message alignmentHolger Hans Peter Freyther1-1/+1
2014-08-21sysmobts: Move ipaccess-find counterpart to a dedicated source fileHolger Hans Peter Freyther4-144/+210
2014-08-21sysmobts: Fix the build when no 2050 uc header file was foundHolger Hans Peter Freyther1-0/+14
Fix the build (provide empty stubs) when the header file is not present.
2014-08-21sysmobts: Fix the power request resultHolger Hans Peter Freyther3-25/+63
We want to know which componets are enabled and the voltage and current used by the components.
2014-08-21sysmobts: Read the temperature sensors on the deviceHolger Hans Peter Freyther1-0/+16
Read the sensors that are always present and the ones that are only present on the sysmoBTS 2050.
2014-08-21sysmobts: Add is_sbts2050_masterHolger Hans Peter Freyther3-4/+11
2014-08-21sysmobts: Read the model number and trx once from the deviceHolger Hans Peter Freyther3-21/+43
Use it for the ipaccess-find response and for the sysmobts classification code. This can be used by the vty in a second.
2014-08-21sysmobts: Initialize fd with an invalid fdHolger Hans Peter Freyther1-1/+2
Initialize the ucinfo with an invalid fd to prevent writing on fd=0 by accident.
2014-08-21sysmobts: Use another logp region as it is mostly related to rempHolger Hans Peter Freyther1-3/+3
2014-08-21sysmobts: There is only one uc make it a singletonHolger Hans Peter Freyther3-74/+76
Move the init and polling into the sysmoBTS related part. In the future we should have _one_ temperature control.
2014-08-21sysmobts: Clean-up the parsing routinesHolger Hans Peter Freyther2-40/+38
2014-08-21sysmobts: Move the sysmoBTS 2050 controller handlingHolger Hans Peter Freyther3-260/+285
Move the code to a separate file to keep things nicely apart of each other.