Skip to content

Commit

Permalink
Make set_lbt_th.sh output more human friendly:
Browse files Browse the repository at this point in the history
While no argument is given (for checking)
  • Loading branch information
JiaoXianjun committed Feb 9, 2023
1 parent 3d0e9e6 commit 6faed2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 5 additions & 1 deletion doc/app_notes/frequent_trick.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
```
./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:
```
./set_lbt_th.sh 70
dmesg
```
Above will disable the automatic CCA threshold setting from the openwifi driver.

Recover the driver automatic control on the threshold:
```
./set_lbt_th.sh 0
dmesg
```
Disable the CCA by setting a very strong level as threshold, for example -1dBm:
```
./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.

Expand Down
3 changes: 2 additions & 1 deletion user_space/set_lbt_th.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ if [ $lbt_th -ne 987654321 ]; then
fi

# 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

0 comments on commit 6faed2c

Please sign in to comment.