xref: /openwifi/doc/app_notes/ad-hoc-two-sdr.md (revision a83823a4ba0671824e6b8d0d55ae2ee873975a61)
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- 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.
10- 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:
11  ```
12  ssh [email protected]
13  (password: openwifi)
14  service network-manager stop
15  cd openwifi
16  ./wgd.sh
17  (Wait for the script completed)
18  ifconfig sdr0 up
19  ./sdr-ad-hoc-up.sh sdr0 44 192.168.13.1
20  (Above command setup ad-hoc network at channel 44 with static IP assigned to sdr0 NIC)
21  iwconfig sdr0
22  ```
23- You should see output like:
24  ```
25  sdr0    IEEE 802.11  ESSID:"sdr-ad-hoc"
26          Mode:Ad-Hoc  Frequency:5.22 GHz  Cell: 92:CA:14:27:1E:B0
27          Tx-Power=20 dBm
28          Retry short limit:7   RTS thr:off   Fragment thr:off
29          Encryption key:off
30          Power Management:off
31  ```
32  If you see "Cell: Not-Associated", please wait and run "iwconfig sdr0" again until a randomly generated Cell ID appears.
33
34- 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:
35  ```
36  ssh [email protected]
37  (password: openwifi)
38  service network-manager stop
39  cd openwifi
40  ./wgd.sh
41  ifconfig sdr0 up
42  ./sdr-ad-hoc-up.sh sdr0 44 192.168.13.2
43  iwconfig sdr0
44  ```
45- You should see output like:
46  ```
47  sdr0    IEEE 802.11  ESSID:"sdr-ad-hoc"
48          Mode:Ad-Hoc  Frequency:5.22 GHz  Cell: 92:CA:14:27:1E:B0
49          Tx-Power=20 dBm
50          Retry short limit:7   RTS thr:off   Fragment thr:off
51          Encryption key:off
52          Power Management:off
53  ```
54  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.
55
56  Now the communication link should be already setup between the two ad-hoc nodes, and you can ping each other.
57