1

I have a raspberry pi 3 model B and I’m trying to set it up for the first time using my laptop. So far I’ve been able to find its IP and ssh to it with an Ethernet cable connecting it to the network, but I want to go wireless. I’ve looked for wifi dongles online but most of them seem to be suitable for raspberry pi 2 only ( I don’t know why and what the difference is really) How can I deal with this situation? Thanks in advance

3 Answers3

3

As stated, the pi3 has its wireless, so you shouldn't need a separate dongle.

Whether you shut-down the pi and edit it on the SD-card, or want to configure via ssh, the actions are :

1) edit etc/dhcpcd.conf and add the following lines:

interface wlan0
static ip_address=192.168.178.3/24
static routers=192.168.178.1
static domain_name_servers=192.168.178.1

(change the IP addresses to match your network)

2) edit /etc/wpa_supplicant/wpa_supplicant.conf and put in soemthing like this:

country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
    ssid="ssidforwifi"
    psk="wifipsk"
}

3) reboot, because that is easier than figuring-out how to restart the network with systemd.

And now, the Pi should be accessible through WiFi.

Why a fixed IP-address? Because it is a server. If you use dynamic dhcp addresses, you always have to search what IP address the Pi has. And yes, you could also hand-out a fixed IP address, based on your mac-id, if you really want.

Ljm Dullaart
  • 2,491
  • 9
  • 15
  • Thank you! I followed the first step by changing router and domain_name_server IP addresses to the ones that match my network. For static ip_address, I looked into the addresses that my ip scanner shows and entered an address that ends with an arbitrary but different number. for the second step, I basically copied what you wrote here except changed the ssid, psk and the country. Tried sudo reboot, waited about 5 minutes, unplugged network cable, still can't seem to use the ip address I entered to ssh to pi. Am I missing something? – Khorshid Vahidi Mar 25 '18 at 21:27
  • You should not use an arbitrary number; you should assign a number that is outside the DHCP range. Anyway, next is the debugging. Connect your cable and see if there is an IP address on wlan0. Does the wifi connect? What does grep dhcp /var/log/daemon* tell you? Is the gateway on the WiFi within the subnet of the WiFi range? etcetera. – Ljm Dullaart Mar 26 '18 at 17:19
-1

For initial setup you need a mouse and an hdmi cable

  1. Connect hdmi to display and pi
  2. Power on the Pi and the display
  3. Connect the mouse and do the initial setup process
  4. Install xvkbd which is an on-screen keyboard
  5. Connect to WiFi
  • An RPi can be set up remotely as a headless device if the SDCard is configured correctly from another computer. – Charemer Mar 21 '18 at 17:17
-1

I think you can follow the above answer. These are the few things that you need to do.

  1. You need to have the raspbian os in the sd card. YOU MUST THESE IS THE ONLY WAY. next time you can use your laptop wireless.
  2. Connect with pc display through hdmi.
  3. Install the rpi. And set it up. enable everything. esp VNC if i am not mistaken.
  4. Connect RPI with your hotspot. (Your rpi can nly be access just when using your wifi means once you set this rpi connect with the selected wifi NEVER CHANGE IT during wireless) Then provide your rpi an ip address.need to overwrite files. google on "how to set up ip address on rpi" REFER TO ANSWER FROM Ljm Dullaart
  5. Download vnc in your laptop.
  6. Disconnect rpi from pc display.
  7. on back the rpi. Let it reboot and everything (1mins)
  8. Then on the vnc viewer just key in the ip add.
  9. You should be able to connect now.

Hope i help you.

diniebee
  • 1
  • 1
  • 1
    The poster is "trying to set it up for the first time using my laptop" - yes he can connect to it using SSH it via Ethernet and configure anything. There's no need for VNC to be able to accomplish setting up the WiFi. – Charemer Mar 21 '18 at 17:16
  • Yes, if you want to connect with it "wirelessly" you can use that method. – diniebee Mar 23 '18 at 00:20
  • do you connect it to wifi? @KhorshidVahidi – diniebee Mar 26 '18 at 00:47