Make set_lbt_th.sh output more human friendly:

While no argument is given (for checking)
This commit is contained in:
Xianjun Jiao 2023-02-09 16:09:11 +01:00
parent 3d0e9e61c8
commit 6faed2c4d0
2 changed files with 7 additions and 2 deletions

View File

@ -20,22 +20,26 @@ Some usual/frequent control trick over the openwifi FPGA. You need to do these c
In normal operation, different threshold is set to FPGA according to the different calibration of different frequency/channel by driver automatically. Show the current LBT threshold in FPGA: In normal operation, different threshold is set to FPGA according to the different calibration of different frequency/channel by driver automatically. Show the current LBT threshold in FPGA:
``` ```
./set_lbt_th.sh ./set_lbt_th.sh
dmesg
``` ```
"reg val: 00000086" means the current threshold is 134 (86 in Hex). Its unit is rssi_half_db. Check rssi_half_db_to_rssi_dbm()/rssi_dbm_to_rssi_half_db() in sdr.c to see the relation to rssi dBm. It shows: "sdr,sdr FPGA LBT threshold 166(-62dBm). The last_auto_fpga_lbt_th 166(-62dBm). rssi corr 145". Check rssi_half_db_to_rssi_dbm()/rssi_dbm_to_rssi_half_db() in sdr.c to see the relation to rssi dBm.
Override a new threshold -NNdBm to FPGA, for example -70dBm: Override a new threshold -NNdBm to FPGA, for example -70dBm:
``` ```
./set_lbt_th.sh 70 ./set_lbt_th.sh 70
dmesg
``` ```
Above will disable the automatic CCA threshold setting from the openwifi driver. Above will disable the automatic CCA threshold setting from the openwifi driver.
Recover the driver automatic control on the threshold: Recover the driver automatic control on the threshold:
``` ```
./set_lbt_th.sh 0 ./set_lbt_th.sh 0
dmesg
``` ```
Disable the CCA by setting a very strong level as threshold, for example -1dBm: Disable the CCA by setting a very strong level as threshold, for example -1dBm:
``` ```
./set_lbt_th.sh 1 ./set_lbt_th.sh 1
dmesg
``` ```
After above command, the CCA engine will always believe the channel is idle, because the rx signal strength not likely could exceed -1dBm. After above command, the CCA engine will always believe the channel is idle, because the rx signal strength not likely could exceed -1dBm.

View File

@ -13,5 +13,6 @@ if [ $lbt_th -ne 987654321 ]; then
fi fi
# show # show
./sdrctl dev sdr0 get reg xpu 8 # ./sdrctl dev sdr0 get reg xpu 8
./sdrctl dev sdr0 get reg drv_xpu 0
set +x set +x