xref: /openwifi/doc/app_notes/ad-hoc-two-sdr.md (revision f2860429262ea644146d68e487279aacbf0d35de)
1<!--
2Author: Xianjun jiao
3SPDX-FileCopyrightText: 2019 UGent
4SPDX-License-Identifier: AGPL-3.0-or-later
5-->
6
7**NOTE** the terminal session mentioned in the following text can also be setup via USB-UART instead of Ethernet.
8
9**NOTE** adrv9361z7035 has ultra low TX power in 5GHz. Move **CLOSER** when you use that board in 5GHz!!!
10
11- Power on two SDR boards. Call one board "adhoc1" and the other "adhoc2". On each board, the TX and RX antenna should vertical/orthogonal to each other as much as possible to gain a good TX/RX isolation.
12- Connect a computer to the adhoc1 via Ethernet cable. The computer should have static IP 192.168.10.1. Open a terminal on the computer, and then in the terminal:
13  ```
14  ssh [email protected]
15  (password: openwifi)
16  service network-manager stop
17  cd openwifi
18  ./wgd.sh
19  (Wait for the script completed)
20  ifconfig sdr0 up
21  ./sdr-ad-hoc-up.sh sdr0 44 192.168.13.1
22  (Above command setup ad-hoc network at channel 44 with static IP assigned to sdr0 NIC)
23  iwconfig sdr0
24  ```
25- You should see output like:
26  ```
27  sdr0    IEEE 802.11  ESSID:"sdr-ad-hoc"
28          Mode:Ad-Hoc  Frequency:5.22 GHz  Cell: 92:CA:14:27:1E:B0
29          Tx-Power=20 dBm
30          Retry short limit:7   RTS thr:off   Fragment thr:off
31          Encryption key:off
32          Power Management:off
33  ```
34  If you see "Cell: Not-Associated", please wait and run "iwconfig sdr0" again until a randomly generated Cell ID appears.
35
36- Connect another computer to the adhoc2 via Ethernet cable. The computer should have static IP 192.168.10.1. Open a terminal on the computer, and then in the terminal:
37  ```
38  ssh [email protected]
39  (password: openwifi)
40  service network-manager stop
41  cd openwifi
42  ./wgd.sh
43  ifconfig sdr0 up
44  ./sdr-ad-hoc-up.sh sdr0 44 192.168.13.2
45  iwconfig sdr0
46  ```
47- You should see output like:
48  ```
49  sdr0    IEEE 802.11  ESSID:"sdr-ad-hoc"
50          Mode:Ad-Hoc  Frequency:5.22 GHz  Cell: 92:CA:14:27:1E:B0
51          Tx-Power=20 dBm
52          Retry short limit:7   RTS thr:off   Fragment thr:off
53          Encryption key:off
54          Power Management:off
55  ```
56  The "Cell: 92:CA:14:27:1E:B0" should be the same as adhoc1, because the later joined node should discover the Cell ID of the existing network and join/get it automatically. If not, please adjust the antenna/distance and re-run the commands.
57
58  Now the communication link should be already setup between the two ad-hoc nodes, and you can ping each other.
59