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