Rpi couldn't connect to wifi

I am using Rpi3 with openhab2
I connected the Rpi to wifi in my office and everything is OK. Now I am at home and want to connect my Rpi to the internet, I tried to connect it with an ethernet cable but it is not connected. Then I did these steps:-

  • Open the file openhabian.conf in a text editor
  • Uncomment and fill in wifi_ssid=“My Wi-Fi SSID” and wifi_psk=“password123”
  • Save, Unmount, Insert, Boot

But there is no result!

Search the web for how to configure WiFi on Raspbian. The file you edited is only used the first time openHABian boots.

Hi Ahmed, You can try this…

sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

Then edit the file to look like this… keep the parts that are already there, just edit the ‘network={}’ section…

network={
        ssid="[ your router ssid ]"
        psk="[ your router wifi pw ]"
        scan_ssid=1
        proto=RSN
        key_mgmt=WPA-PSK
        pairwise=CCMP
        group=CCMP
        auth_alg=OPEN
        priority=1
        id_str="[ name of your pi ]"
}

This will actually work for hidden networks as well.