xref: /openwifi/doc/app_notes/ap-client-two-sdr.md (revision b58ec5b67eec31564dabaaf0471a3a639de0e46a)
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 "AP board" and the other "client board". 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 AP board 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  cd openwifi
15  ./fosdem.sh
16  (It will create a WiFi AP by hostapd program with config file: hostapd-openwifi.conf)
17  (Wait for the script completed)
18  cat /proc/interrupts
19  (Execute the "cat ..." command for several times)
20  (You should see the number of "sdr,tx_itrpt1" grows, because it sends the "openwifi" beacon periodically)
21  ```
22- Connect another computer to the client board via Ethernet cable. The computer should have static IP 192.168.10.1. Open a terminal on the computer, and then in the terminal:
23  ```
24  ssh [email protected]
25  (password: openwifi)
26  service network-manager stop
27  cd openwifi
28  ./wgd.sh
29  (Wait for the script completed)
30  ifconfig sdr0 up
31  iwlist sdr0 scan
32  (The "openwifi" AP should be listed in the scanning results)
33  wpa_supplicant -i sdr0 -c wpa-openwifi.conf
34  ```
35  If wpa-openwifi.conf is not on board, please create it with [this content](https://github.com/open-sdr/openwifi/blob/master/user_space/wpa-openwifi.conf).
36- Now the client is trying to associate with the AP. You should see like:
37  ```
38  root@analog:~/openwifi# wpa_supplicant -i sdr0 -c wpa-openwifi.conf
39  Successfully initialized wpa_supplicant
40  sdr0: CTRL-EVENT-SCAN-STARTED
41  sdr0: SME: Trying to authenticate with 66:55:44:33:22:8c (SSID='openwifi' freq=5220 MHz)
42  sdr0: Trying to associate with 66:55:44:33:22:8c (SSID='openwifi' freq=5220 MHz)
43  sdr0: Associated with 66:55:44:33:22:8c
44  sdr0: CTRL-EVENT-CONNECTED - Connection to 66:55:44:33:22:8c completed [id=0 id_str=]
45  ```
46  The AP board terminal should print like:
47  ```
48  ...
49  sdr0: STA 66:55:44:33:22:4c IEEE 802.11: authenticated
50  sdr0: STA 66:55:44:33:22:4c IEEE 802.11: associated (aid 1)
51  sdr0: AP-STA-CONNECTED 66:55:44:33:22:4c
52  sdr0: STA 66:55:44:33:22:4c RADIUS: starting accounting session 613E16DE-00000000
53  ```
54  If not, please adjust antenna/distance and re-run the commands on the client side.
55
56- After association is done, in another terminal of client (**DO NOT** terminate wpa_supplicant in the original client terminal!):
57  ```
58  dhclient sdr0
59  (Wait for it completed)
60  ifconfig sdr0
61  (Now you should see the IP address like 192.168.13.x allocated by AP)
62  ping 192.168.13.1
63  (Ping the AP)
64  ```
65  Now the communication link should be already setup between the AP and the client.
66