Osmo-bts-sysmo-remote » History » Version 1
keith, 04/06/2020 09:06 PM
1 | 1 | keith | h1. osmo-bts-sysmo-remote / l1fw-proxy |
---|---|---|---|
2 | |||
3 | |||
4 | By making use of the Layer1 Forwarding it is possible to run the osmo-bts-sysmo and "osmo-pcu":https://osmocom.org/projects/osmopcu/wiki/OsmoPCU processes |
||
5 | off of the sysmoBTS hardware. |
||
6 | |||
7 | This can be of great help debugging as: |
||
8 | |||
9 | * It is not necessary to cross compile and copy the binary to the sysmoBTS hardware |
||
10 | * Debugging may be much easier on a more powerful platform as the sysmoBTS does not have sufficient storage space for all the debugging symbols and tools required. |
||
11 | |||
12 | Possible issues: |
||
13 | |||
14 | * Some latency may be introduced (I do not know if this can become a significant issue on a LAN) |
||
15 | |||
16 | h2. How to prepare the sysmoBTS |
||
17 | |||
18 | |||
19 | Create a systemd service file for the Layer 1 proxy. This is the only process that will run on the sysmoBTS hardware, so you should |
||
20 | |||
21 | systemctl stop osmo-bts |
||
22 | systemctl stop osmo-pcu |
||
23 | |||
24 | You may want to also disable these services so they do not restart on next boot. |
||
25 | |||
26 | systemctl disable osmo-bts |
||
27 | systemctl disable osmo-pcu |
||
28 | |||
29 | |||
30 | Create a systemd service file: /lib/systemd/system/l1fwd.service |
||
31 | |||
32 | <pre> |
||
33 | [Unit] |
||
34 | Description=Layer 1 forwarding for sysmocom sysmoBTS |
||
35 | |||
36 | [Service] |
||
37 | Type=simple |
||
38 | ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/activity_led/brightness' |
||
39 | ExecStart=/usr/bin/l1fwd-proxy |
||
40 | ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness' |
||
41 | ExecStopPost=/bin/sh -c 'cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; sleep 3s; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0; sleep 1s' |
||
42 | Restart=always |
||
43 | RestartSec=2 |
||
44 | RestartPreventExitStatus=1 |
||
45 | |||
46 | # The msg queues must be read fast enough |
||
47 | CPUSchedulingPolicy=rr |
||
48 | CPUSchedulingPriority=1 |
||
49 | |||
50 | [Install] |
||
51 | WantedBy=multi-user.target |
||
52 | </pre> |
||
53 | |||
54 | Start this service: |
||
55 | |||
56 | systemctl daemon-reload |
||
57 | systemctl enable l1fwd |
||
58 | systemctl start l1fwd |
||
59 | |||
60 | |||
61 | h2. Local Machine. |
||
62 | |||
63 | At the time of writing, you will need to make some minor changes to the source code, then compile and run osmo-bts-sysmo-remote: |
||
64 | |||
65 | This is because the program expects to be able to read the eeprom at /sys/bus/i2c/devices/i2c-1/1-0050/eeprom and this path is unlikely to exist on your local machine. |
||
66 | If osmo-bts cannot read the eeprom, it will be unable to read the band support and calibration data and will refuse to start up. |
||
67 | |||
68 | For help builidng, follow the instructions here: https://osmocom.org/projects/cellular-infrastructure/wiki/Build_from_Source |
||
69 | |||
70 | You need to patch the following files to change the location where the program will expect to find the eeprom |
||
71 | |||
72 | /src/osmo-bts-sysmo/eeprom.c |
||
73 | /src/osmo-bts-sysmo/misc/sysmobts_par.c |
||
74 | |||
75 | change |
||
76 | |||
77 | #define EEPROM_DEV |
||
78 | |||
79 | and |
||
80 | |||
81 | #define EEPROM_PATH |
||
82 | |||
83 | to point to a location on the local machine, /tmp/eeprom maybe? |
||
84 | |||
85 | Copy the eeprom from your sysmoBTS to this location. |
||
86 | |||
87 | Do something like: |
||
88 | |||
89 | dd if=/sys/bus/i2c/devices/i2c-1/1-0050/eeprom of=/tmp/eeprom |
||
90 | |||
91 | on the sysmoBTS |
||
92 | |||
93 | and then |
||
94 | |||
95 | scp root@bts_ip:/tmp/eeprom /tmp |
||
96 | |||
97 | or your local machine. |
||
98 | |||
99 | You need to set environment variable L1FWD_BTS_HOST to point to the IP of your bts. |
||
100 | |||
101 | So for example |
||
102 | |||
103 | export L1FWD_BTS_HOST=192.168.1.10 |
||
104 | ./src/osmo-bts-sysmo/osmo-bts-sysmo-remote -c /path/to/osmo-bts-sysmo.cfg |
||
105 | |||
106 | or simply: |
||
107 | |||
108 | L1FWD_BTS_HOST=192.168.1.10 ./src/osmo-bts-sysmo/osmo-bts-sysmo-remote -c /path/to/osmo-bts-sysmo.cfg |