srsUE cannot connect to gNb
Issue Description
I followed this tutorial - https://docs.srsran.com/projects/project/en/latest/tutorials/source/srsUE/source/index.html
I am trying to use the over-the-air setup to establish connection between the srsUE and gNb, but the UE gets stuck after attaching UE, with the following message - "RF status: O=10, U=0, L=0". There are overflows and underflows on the gNb side too.
My gNb and UE start and here are the screenshots (will also attach log files)
Setup Details
PC1 - gNb and Open5GC Lenovo Legion 5 (AMD Ryzen 5 4600h + Nvidia GTX 1660 + 8GB RAM) Ubuntu - 22.04 UHD Version - UHD_4.1.0.5-3 Radio - B210
Here is my configuration file - gnb.yaml.txt
PC2 - srsUE Raspberry Pi4 8GB varient. Ubuntu - 22.04 UHD Version - UHD_4.1.0.5-3 Radio - B210
Here is my configuration file - ue.conf.txt
I have ensured that both setups have the cpu's set to performance and have also run the performance script.
Additional Information
I ran the usrp benchmarks scripts on both the pcs with the selected frequencies and had no issues there.
Here are my log files - amf.log.txt gnb.log.txt ue.log.txt
gnb log says:
2024-07-15T03:18:27.564308 [GNB ] [W] CPU0 scaling governor is not set to performance, which may hinder performance. You can set it to performance using the "srsran_performance" script
also RPi5 might be too slow for srsUE, you could try lower BW maybe it helps.
Sorry my bad, I reran the performance script and also this command - "sudo cpupower frequency-set --governor performance" , and ensured that the CPUs are set to performance mode. I also lowered the channel bandwidth on the gNb side to 5mhz (i don't know how to explicitly set it on the srsUE side). The behaviour is still the same, here are the new logs - ue.log.txt gnb.log.txt
I will also run the UE on the Nvidia Jetson TX2, since it might be more powerful, but is there any way to run the UE on the RPi 4 ?
Installed srsran4g on the Jetson TX2 and tweaked the config a bit but still i cant establish connection. (also rerunning the performance script helped a bit, gNb overflows and underflows are less frequent) Note that the tx2 has ubuntu 18.04 and UHD 3.15. Here are the screenshots -
UE (TX2) -
gNb -
Here are the config files - gnb.yaml.txt mainak_ue.conf.txt
and here are the logs -
could you use srate: 30.72 in gnb config?
Still the same - here are the logs. (also my Samsung S23 ultra cannot see the network when I do a network search, I understand it cant connect (without a programmed sim and a different config), but it should be able to see it right ?)
Logs - ue.log.txt gnb.log.txt
I also tried running the UE from another x86 system (Core i7 11th gen and 16gb of RAM), just to check if its a performance issue. But it was the same response.
Then I thought it would be a Tx/Rx gain tuning issue, so i connected the 2 B210s using SMA cables, and tested it again both x86 machines. This time the out of sync message wasn't present, but instead it showed - "PBCH-MIB: CRC failed" in the UE logs.
here are the logs-
with 5MHz cell, could you use srate: 5.76 in gnb conifg? could you also increase log level to debug in the gnb config?
@pgawlowicz , thanks a lot for taking the time to help me out - Here are the logs with the suggested changes. I still cant establish connection with the b210s connected via sma cables (on x86 machines)
please also change srate: 5.76 in ue config. Seems it is too slow to process signal samples with 23.04MHz
That makes sense, I changed both srate to 5.76 , now it shows RRC connected, but then it is released right after -
The ip address is not assigned, there is nothing on the amf log too. Also should there be a network adapter created on the UE machine? where the ipaddress is assigned ? because i dont see any adapter that was created, when i use the command ifconfig.
here are the logs - gnb.log.txt ue.log.txt
I had to delete some lines from the ue log , it was 89 mb, hopefully, this will be or i'll provide a google drive link.
if ue is not getting an IP assigned, an interface will not be created. Could you try to apply this patch and send logs again? 0002-nr-rrc-fix-apply-t_offset-only-once-after-SIB1.patch.txt
Hi, are you sure the patch is applied correctly, srsUE commit is the same in both cases (i.e., commit ec29b0c1f) but maybe because the changes from patch are not commited.
Hi I did apply it locally, but now I forked it and applied the patch (ensured the changes) and here is the new log file - gnb.log.txt ue.log.txt
hmm, PUSCH SNR is very small:
2024-07-18T22:36:24.696728 [PHY ] [D] [ 1010.6] PUSCH: rnti=0x4601 h_id=0 prb=[3, 6) symb=[0, 14) mod=QPSK rv=0 tbs=11 crc=KO iter=6.0 sinr=-30.3dB t=306.8us uci_t=0.0us ret_t=0.0us
2024-07-18T22:36:24.706472 [PHY ] [D] [ 1011.6] PUSCH: rnti=0x4601 h_id=0 prb=[3, 6) symb=[0, 14) mod=QPSK rv=0 tbs=11 crc=KO iter=6.0 sinr=-30.7dB t=148.4us uci_t=0.0us ret_t=0.0u
could you try to tune tx/rx gains on both gnb and ue? you could try the following config in both:
tx_gain: 60
rx_gain: 30
Thanks for that , I tuned the tx/rx gains for both the ue and the gnb (tried a couple of configs). Whats seems to be working is -
[gnb] tx_gain: 80 rx_gain:50 [ue] tx_gain: 50 rx_gain:70
Now the UE connects for a file and then it fails the scheduling request - "Scheduling request failed: releasing RRC connection..."
The AMF log aslo shows that it recieves the request. Here are the logs -
amf.log.txt gnb.log.txt ue.log.txt
do i have to adjust the time_adv_nsamples on the ue side? If yes can you tell me how to calculate it correctly ?
Update : I saw that there was thread where you suggested another user to add the inactivity timer in their gnb config- cu_cp: inactivity_timer: 7200
So I added it, and still the RRC is released.
PDSCH at UE seems to be more or less OK, but PUSCH at gnb has a huge cfo. Do you have a possibility to connect your b200s to a better clock source?
I don't have access to a better clock source like a GPSDO, at the moment. Is there anything that I can tune to make the connection more stable to get a IP address ( and make it last for a few mins ) ?
Because if I do that , I can reasonably convince my lab to buy the external clocks.
I managed to connect for a second, using different B210s. But it disconnected right after.
Hello,
How can I add this patch to the SrsRan Project folder?
I have the same error with X310 as gnb and a b210 as UE and I do not have an assigned IP or an interface created.
I already tried downloading the BW, srate in both gnb and ue scripts, and applying the performance.
Fork the code and use the git apply command.
Something like -> git apply name-of-file.patch
Or use a vs code extension, which does it for you. ( Its pretty simple)
Let me know if it works for you ? Are you using external clocks ?
It would be a great help if you can tell me about your setup and findings .
@pgawlowicz Hey, Luckily we have ordered 2 units of the GPSDO for using as external reference clocks.
While it arrives, I wanted to get a more stable connection, but i left it running for a few hours, and now it wont connect at all - Can you please suggest what happened? and how to fix that ?
The UE log -
2024-08-03T18:12:13.715850 [UE ] [I] Using binary srsue with arguments: mainak_ue.conf 2024-08-03T18:12:13.744771 [UE ] [I] Built in Release mode using commit 4e49269f7 on branch CPS_LAB. 2024-08-03T18:12:13.780048 [RF ] [I] Configuring physical DL channel 0 with band-pass filter (0.0, 0.0) 2024-08-03T18:12:13.780049 [RF ] [I] Configuring physical UL channel 0 with band-pass filter (0.0, 0.0) 2024-08-03T18:12:15.302913 [STCK ] [E] Unknown PCAP option true 2024-08-03T18:12:15.305275 [PHY-SA ] [D] [ 0] SYNC: state=IDLE, tti=0 2024-08-03T18:12:15.305277 [PHY-SA ] [D] [ 0] Discarding samples and sending tx_end 2024-08-03T18:12:15.310992 [MAC ] [I] [ 0] Resetting MAC 2024-08-03T18:12:15.310996 [MAC ] [D] [ 0] Msg3 buffer flushed 2024-08-03T18:12:15.310998 [MAC ] [I] [ 0] Logical Channel Setup: LCID=0, LCG=0, priority=0, PBR=-1, BSD=50ms, bucket_size=0 2024-08-03T18:12:15.311001 [MAC ] [I] [ 0] Logical Channel Setup: LCID=1, LCG=0, priority=1, PBR=-1, BSD=50ms, bucket_size=0 2024-08-03T18:12:15.311012 [MAC ] [D] [ 0] After MAC reset:
- lcid=0, lcg=0, prio=0, Bj=0, PBR=-1, BSD=50, buffer_len=0, sched_len=0
- lcid=1, lcg=0, prio=1, Bj=0, PBR=-1, BSD=50, buffer_len=0, sched_len=0 2024-08-03T18:12:15.311012 [MAC ] [I] [ 0] Setting configuration 2024-08-03T18:12:15.311014 [MAC ] [I] [ 0] BSR: Configured timer reTX 2560 ms 2024-08-03T18:12:15.311020 [RLC ] [I] Added LTE radio bearer with LCID 0 in Transparent Mode 2024-08-03T18:12:15.311033 [USIM ] [I] Read Home PLMN Id=00101 2024-08-03T18:12:15.316014 [RLC-NR ] [I] Added LTE radio bearer with LCID 0 in Transparent Mode 2024-08-03T18:12:15.316019 [MAC-NR ] [D] [ 0] cc_idx=0, set number of HARQ processes for DL to 8 2024-08-03T18:12:15.316020 [MAC-NR ] [I] [ 0] Logical Channel Setup: LCID=0, LCG=0, priority=0, PBR=0, BSD=0ms, bucket_size=0 2024-08-03T18:12:15.316028 [RRC ] [I] using srand seed of 316028 2024-08-03T18:12:15.344405 [MAC ] [D] [ 0] DL retx: 0.00 %, perpkt: 0.00, UL retx: 0.00 % perpkt: 0.00 2024-08-03T18:12:15.344409 [RLC ] [D] lcid=0, rx_rate_mbps=0.00 (real=0.00), tx_rate_mbps=0.00 (real=0.00) 2024-08-03T18:12:15.344429 [GW ] [D] gw_rx_rate_mbps=0.00 (real=0.00), gw_tx_rate_mbps=0.00 (real=0.00) 2024-08-03T18:12:15.345909 [STCK ] [I] Triggering NAS switch on 2024-08-03T18:12:15.345957 [NAS5G ] [I] Switching on 2024-08-03T18:12:15.345961 [NAS5G ] [D] Changed to mm5g state: DEREGISTERED, with substate PLMN-SEARCH 2024-08-03T18:12:15.406510 [PHY-SA ] [D] [ 0] run_stack_tti: from recv 2024-08-03T18:12:15.406511 [PHY-SA ] [D] [ 0] SYNC: Setting initial TTI time to 0.901121 2024-08-03T18:12:15.406512 [PHY-SA ] [D] [ 0] run_stack_tti: calling stack tti=0, tti_jump=1 2024-08-03T18:12:15.406512 [PHY-SA ] [D] [ 0] run_stack_tti: stack called 2024-08-03T18:12:15.406513 [PHY-SA ] [D] [ 0] SYNC: received 5760 samples from radio 2024-08-03T18:12:15.406515 [PHY-SA ] [D] [ 0] SYNC: state=IDLE, tti=0 2024-08-03T18:12:15.406516 [PHY-SA ] [D] [ 0] Discarding samples and sending tx_end 2024-08-03T18:12:15.406556 [MAC ] [D] [ 0] Running MAC tti=0 2024-08-03T18:12:15.406557 [MAC ] [D] [ 0] Update Bj: lcid=0, Bj=0 2024-08-03T18:12:15.406557 [MAC ] [D] [ 0] Update Bj: lcid=1, Bj=0 2024-08-03T18:12:15.406561 [MAC ] [D] [ 0] RA: IDLE: rar_window_start=-1, rar_window_length=-1 2024-08-03T18:12:15.406562 [MAC-NR ] [D] [ 0] Running MAC tti=0 2024-08-03T18:12:15.406567 [MAC-NR ] [D] [ 0] nof_lcids_with_data=0, nof_lcgs_with_data=0, last_non_zero_lcg=-1 [lcg0=0, ] [lcid0=0, ] 2024-08-03T18:12:15.406570 [RRC ] [D] State IDLE 2024-08-03T18:12:15.406598 [USIM ] [I] Read Home PLMN Id=00101 2024-08-03T18:12:15.406599 [NAS5G ] [I] Requesting IMSI attach (IMSI=001010123456780) 2024-08-03T18:12:15.406603 [NAS5G ] [D] Starting T3410. Timeout in 15000 ms. 2024-08-03T18:12:15.406604 [NAS5G ] [I] Sending Registration Request 2024-08-03T18:12:15.406604 [NAS5G ] [D] Initiating RRC NR Connection 2024-08-03T18:12:15.406606 [RRC-NR ] [I] Proc "Setup Request" - Initiation of Setup request procedure 2024-08-03T18:12:15.406607 [RRC-NR ] [I] Proc "Cell Selection" - Starting... 2024-08-03T18:12:15.406612 [NAS5G ] [D] Changed to mm5g state: REGISTERED-INITIATED 2024-08-03T18:12:15.406613 [STCK ] [D] tti_tprof: duration=0 msec 2024-08-03T18:12:15.406615 [PHY-SA ] [I] [ 0] Cell Search: Going to IDLE 2024-08-03T18:12:15.406616 [PHY-SA ] [I] [ 0] Tuning Rx channel 0 to 1842.50 MHz 2024-08-03T18:12:15.406620 [RF ] [I] Mapping RF channel 0 (device=0, channel=0) to logical carrier 0 on f_rx=1842.5 MHz 2024-08-03T18:12:15.407577 [PHY-SA ] [D] [ 0] run_stack_tti: from recv 2024-08-03T18:12:15.407577 [PHY-SA ] [D] [ 0] run_stack_tti: calling stack tti=0, tti_jump=1 2024-08-03T18:12:15.407578 [PHY-SA ] [D] [ 0] run_stack_tti: stack called 2024-08-03T18:12:15.407578 [PHY-SA ] [D] [ 0] SYNC: received 5760 samples from radio 2024-08-03T18:12:15.407579 [PHY-SA ] [D] [ 0] SYNC: state=IDLE, tti=0 2024-08-03T18:12:15.407579 [PHY-SA ] [D] [ 0] Discarding samples and sending tx_end 2024-08-03T18:12:15.407639 [MAC ] [D] [ 0] Running MAC tti=0 2024-08-03T18:12:15.407640 [MAC ] [D] [ 0] Update Bj: lcid=0, Bj=0 2024-08-03T18:12:15.407640 [MAC ] [D] [ 0] Update Bj: lcid=1, Bj=0 2024-08-03T18:12:15.407643 [MAC ] [D] [ 0] RA: IDLE: rar_window_start=-1, rar_window_length=-1 2024-08-03T18:12:15.407644 [MAC-NR ] [D] [ 0] Running MAC tti=0 2024-08-03T18:12:15.407647 [MAC-NR ] [D] [ 0] nof_lcids_with_data=0, nof_lcgs_with_data=0, last_non_zero_lcg=-1 [lcg0=0, ] [lcid0=0, ] 2024-08-03T18:12:15.407648 [STCK ] [D] tti_tprof: duration=0 msec 2024-08-03T18:12:15.408637 [PHY-SA ] [D] [ 0] run_stack_tti: from recv 2024-08-03T18:12:15.408637 [PHY-SA ] [D] [ 0] run_stack_tti: calling stack tti=0, tti_jump=1 2024-08-03T18:12:15.408638 [PHY-SA ] [D] [ 0] run_stack_tti: stack called 2024-08-03T18:12:15.408638 [PHY-SA ] [D] [ 0] SYNC: received 5760 samples from radio 2024-08-03T18:12:15.408639 [PHY-SA ] [D] [ 0] SYNC: state=IDLE, tti=0 2024-08-03T18:12:15.408639 [PHY-SA ] [D] [ 0] Discarding samples and sending tx_end 2024-08-03T18:12:15.408671 [MAC ] [D] [ 0] Running MAC tti=0 2024-08-03T18:12:15.408672 [MAC ] [D] [ 0] Update Bj: lcid=0, Bj=0 2024-08-03T18:12:15.408672 [MAC ] [D] [ 0] Update Bj: lcid=1, Bj=0 2024-08-03T18:12:15.408673 [MAC ] [D] [ 0] RA: IDLE: rar_window_start=-1, rar_window_length=-1 2024-08-03T18:12:15.408673 [MAC-NR ] [D] [ 0] Running MAC tti=0 2024-08-03T18:12:15.408674 [MAC-NR ] [D] [ 0] nof_lcids_with_data=0, nof_lcgs_with_data=0, last_non_zero_lcg=-1 [lcg0=0, ] [lcid0=0, ] 2024-08-03T18:12:15.408675 [STCK ] [D] tti_tprof: duration=0 msec 2024-08-03T18:12:15.409706 [PHY-SA ] [D] [ 0] run_stack_tti: from recv 2024-08-03T18:12:15.409707 [PHY-SA ] [D] [ 0] run_stack_tti: calling stack tti=0, tti_jump=1 2024-08-03T18:12:15.409707 [PHY-SA ] [D] [ 0] run_stack_tti: stack called 2024-08-03T18:12:15.409707 [PHY-SA ] [D] [ 0] SYNC: received 5760 samples from radio 2024-08-03T18:12:15.409708 [PHY-SA ] [D] [ 0] SYNC: state=IDLE, tti=0 2024-08-03T18:12:15.409709 [PHY-SA ] [D] [ 0] Discarding samples and sending tx_end 2024-08-03T18:12:15.409804 [MAC ] [D] [ 0] Running MAC tti=0 2024-08-03T18:12:15.409805 [MAC ] [D] [ 0] Update Bj: lcid=0, Bj=0 2024-08-03T18:12:15.409805 [MAC ] [D] [ 0] Update Bj: lcid=1, Bj=0 2024-08-03T18:12:15.409807 [MAC ] [D] [ 0] RA: IDLE: rar_window_start=-1, rar_window_length=-1 2024-08-03T18:12:15.409807 [MAC-NR ] [D] [ 0] Running MAC tti=0 2024-08-03T18:12:15.409809 [MAC-NR ] [D] [ 0] nof_lcids_with_data=0, nof_lcgs_with_data=0, last_non_zero_lcg=-1 [lcg0=0, ] [lcid0=0, ] 2024-08-03T18:12:15.409810 [STCK ] [D] tti_tprof: duration=0 msec 2024-08-03T18:12:15.410783 [PHY-SA ] [D] [ 0] run_stack_tti: from recv 2024-08-03T18:12:15.410783 [PHY-SA ] [D] [ 0] run_stack_tti: calling stack tti=0, tti_jump=1 2024-08-03T18:12:15.410784 [PHY-SA ] [D] [ 0] run_stack_tti: stack called 2024-08-03T18:12:15.410784 [PHY-SA ] [D] [ 0] SYNC: received 5760 samples from radio 2024-08-03T18:12:15.410784 [PHY-SA ] [D] [ 0] SYNC: state=IDLE, tti=0 2024-08-03T18:12:15.410785 [PHY-SA ] [D] [ 0] Discarding samples and sending tx_end 2024-08-03T18:12:15.410831 [MAC ] [D] [ 0] Running MAC tti=0 2024-08-03T18:12:15.410831 [MAC ] [D] [ 0] Update Bj: lcid=0, Bj=0 2024-08-03T18:12:15.410831 [MAC ] [D] [ 0] Update Bj: lcid=1, Bj=0 2024-08-03T18:12:15.410832 [MAC ] [D] [ 0] RA: IDLE: rar_window_start=-1, rar_window_length=-1 2024-08-03T18:12:15.410832 [MAC-NR ] [D] [ 0] Running MAC tti=0 2024-08-03T18:12:15.410833 [MAC-NR ] [D] [ 0] nof_lcids_with_data=0, nof_lcgs_with_data=0, last_non_zero_lcg=-1 [lcg0=0, ] [lcid0=0, ] 2024-08-03T18:12:15.410834 [STCK ] [D] tti_tprof: duration=0 msec
I am not even receiving any underflow/overflow messages on the UE side.
Isn't there a manual command on the UE side to set a starting frequency offset (I believe it is rf.freq_offset)? If the difference between gnb and ue is too high, the UE won't be able to compensate it
Hi @CrashxZ @pgawlowicz I have already made the changes of the new patch, but still no IP address is assigned. Now I get the following errors: 2024-08-05T19:51:57.158745 [RRC-NR ] [I] Proc "Cell Selection" - Completed with failure. 2024-08-05T19:51:57.158751 [RRC-NR ] [W] Could not finish setup request. Deallocating dedicatedInfoNAS PDU Do you know how can I fix them?
Attached logs: gnb_20M.log ue.log
@CrashxZ Yes, I'm using GPSDO for both radios X310 as GNB and B210 as UE. But I have also performed tests with the internal clock of both radios, and I have the same error result with and without it.
Late: 0; Underflow: 1; Overflow: 0;
@Erick5G could you share your configs?
Sure, @pgawlowicz
I've tested band n3 and n78 with this configuration for GNB and it's worked perfectly for Cost UE. Also with internal clock or gpsdo got the same result. But no sucess for SrsUE with B210.
Attached config: ue_rf.conf.txt gnb_x310_20MHz_UECOST.yml.txt
I've tried new config for GNB, adding the following lines:
pdcch:
dedicated:
ss2_type: common
dci_format_0_1_and_1_1: false
common:
ss0_index: 0
coreset0_index: 12
prach:
prach_config_index: 1
Found Issues:
- [PHY-SA ] [E] [ 0**] prach_cfg.freq_offset=1 is not compatible with LTE**
- PDCCH DMRS Rx: Measure L=2; ncce=4; RSRP=-30.2 dBfs; EPRE=-5.7 dBfs; Corr=0.004 Discarded PDCCH candidate L=2;ncce=4; Correlation is too low (0.0<0.5); EPRE=-5.68; RSRP=-30.17;
- [PHY-SA ] [E] [ 6360] SYNC: detected out-of-sync... skipping slot ...
- [PHY0-NR] [E] [ 6380] PBCH-MIB: NR SFN (639) does not match current SFN (638)
- [PHY0-NR] [W] [ 6440] PBCH-MIB: CRC failed
Ubuntu Terminal for the UE Random Access Transmission: prach_occasion=0, preamble_index=0, ra-rnti=0x39, tti=3694 Random Access Transmission: prach_occasion=0, preamble_index=0, ra-rnti=0x39, tti=3854 Random Access Transmission: prach_occasion=0, preamble_index=0, ra-rnti=0x39, tti=4014 Random Access Transmission: prach_occasion=0, preamble_index=0, ra-rnti=0x39, tti=4174
Attached Conf & logs: gnb_x310_20MHz_SRSUE.yml.txt ue.conf.txt ue.log
As additional information: srsRan_Project is being used for the GNB and srsRan_4G for the UE. I hope this information is of some use. Regards