0

I am trying to configure WiFi connection on my STM32MP157 based Avneger96 board. I have follows below steps to configure:

  1. ifconfig eth0 down

  2. ifconfig usb0 down

  3. Start WiFi: ifconfig wlan0 up

  4. iw dev wlan0 scan | grep ssid -i This lists my WiFi with proper SSID.

  5. Since WiFi network uses WPA authentication I copy wpa_supplicant.conf file and pass the SSID and passphrase

    cp /etc/wpa_supplicant.conf .

    wpa_passphrase [SSID] [passphrase] >> ./wpa_supplicant.conf

SSID and passphrase is inserted without quotes and brackets and SSID doesn't contain any spaces.

  1. Now connecting to WiFi network:

    wpa_supplicant -B -Dnl80211 -iwlan0 -cwpa_supplicant.conf

  2. iw dev wlan0 link : Its shows it's connected to WiFi. And ping google.com is successful.

  3. Doing ifconfig shows the assigned IP Address on wlan0.

Now the problem is I am not able to access device using SSH. When I do ssh root@[IP Address], I get message that connection timed out.

ssh: connect to host [IP Address] port 22: Connection timed out

I am not able to resolve this. Can someone please let me know how to resolve this?

Your help will be much appreciated.

P.S: I am booting the board with custom Linux image built from Yocto Project. My host machine is Ubuntu 20.04. I have enabled required drivers in kernel config. And I have also included "packagegroup-base-wifi" in my image recipe and "wifi" in DISTRO_FEATURES_append. I have tried with different networks but still same error.

Edit

I tried to connect with LAN cable but IP address is not assigned in this case.

LAN connection

enter image description here enter image description here

Preeti
  • 535
  • 1
  • 6
  • 30
  • Is ssh daemon and ssh server installed? First verify if your board has ssh server installed and running https://cplusprogrammer.wordpress.com/2016/10/17/how-to-check-if-ssh-is-running-on-linux/ – Gaurav Pathak Jan 14 '22 at 12:25
  • Hi Gaurav, thanks for the hint. Out of the 5 methods shown in above link, 4 of them succeeded except for `lsof -i` which I think `lsof` is not installed. For that it's showing `lsof command not found`. And also sshd service is running and listening on the ssh port. I could even telnet to port 22. – Preeti Jan 14 '22 at 15:37
  • When you are executing ssh root@[IP Address], what IP Address are you using? – Gaurav Pathak Jan 14 '22 at 17:59
  • The IP address which is shown from `ifconfig`. Few days back when I tried it got connected. But now I am getting this issue – Preeti Jan 14 '22 at 18:41
  • 1
    Try running ssh into verbose mode ssh -vvv root@[IP Address] or ssh -vv root@[IP Address] – Gaurav Pathak Jan 14 '22 at 18:43
  • Hi Gaurav, When I try with verbose mode I get following messages. `OpenSSH_8.2p1 Ubuntu-4ubuntu0.3, OpenSSL 1.1.1f 31 Mar 2020 debug1: Reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files debug1: /etc/ssh/ssh_config line 21: Applying options for * debug2: resolve_canonicalize: hostname 192.168.109.174 is address debug2: ssh_connect_direct` – Preeti Jan 15 '22 at 11:35
  • `debug1: Connecting to 192.168.109.174 [192.168.109.174] port 22. debug1: connect to address 192.168.109.174 port 22: Connection timed out ssh: connect to host 192.168.109.174 port 22: Connection timed out` – Preeti Jan 15 '22 at 11:36
  • Take a look at this https://stackoverflow.com/questions/12172188/ssh-server-connect-to-host-xxx-port-22-connection-timed-out-on-linux-ubuntu. It may be relevant. – Gaurav Pathak Jan 16 '22 at 06:27
  • Hi Gaurav, I checked the link and tried to debug. But I cannot use commands like `sudo ufw` and `iptables -nL` because these commands are not installed. So I tried using Ethernet cable. But still IP address is not assigned to the board and I have attached image of `ifconfig` after connecting via LAN cable to my original post. I ran `dhclient eth0` but it was stuck for a minute and returned nothing. – Preeti Jan 17 '22 at 15:37
  • 1
    Are you sure you configured correct drivers for the ethernet network adapter hardware in the Linux kernel configuration? If the router is not able to assign ip address, there are lots of possibility for the issue. First check if correct driver is loaded and ethernet connector of the board has LED turned on after you connect ethernet cable to the board. – Gaurav Pathak Jan 18 '22 at 05:13

0 Answers0