Page 1 of 1

Booting Raspberry pi from your laptop

Posted: Fri Oct 26, 2018 11:36 am
by atulkatti
I was able to setup PI by connecting it to display and then connecting it to wifi. Now i need to take my pi to another site and connect to wifi there. I may not be able to find a display to connect to over there. How can i boot it through my laptop so that i can then add wifi details in Pi.

Re: Booting Raspberry pi from your laptop

Posted: Fri Oct 26, 2018 11:49 am
by fruitoftheloom
atulkatti wrote:
Fri Oct 26, 2018 11:36 am
I was able to setup PI by connecting it to display and then connecting it to wifi. Now i need to take my pi to another site and connect to wifi there. I may not be able to find a display to connect to over there. How can i boot it through my laptop so that i can then add wifi details in Pi.

https://www.raspberrypi.org/documentati ... ess-cli.md

Re: Booting Raspberry pi from your laptop

Posted: Fri Oct 26, 2018 3:24 pm
by atulkatti
But isnt this useful only when your laptop and pi are connected to same wifi, but then you want to connect to another network. In my case i wont know before hand what the ssid and pwd for new network is. When i go to this new place i will not have my old wifi network

Re: Booting Raspberry pi from your laptop

Posted: Fri Oct 26, 2018 3:35 pm
by fruitoftheloom
atulkatti wrote:
Fri Oct 26, 2018 3:24 pm
But isnt this useful only when your laptop and pi are connected to same wifi, but then you want to connect to another network. In my case i wont know before hand what the ssid and pwd for new network is. When i go to this new place i will not have my old wifi network

Well you quoted "Booting Raspberry pi from your laptop" which is only feasible if you are running your Laptop as a Server and the RPi is a Client.

So I wrongly assumed you would be using your Laptop between the RPi and whatever Wireless Device.

:?

Re: Booting Raspberry pi from your laptop

Posted: Fri Oct 26, 2018 4:17 pm
by atulkatti
ok what if i connect my laptop to wifi, then how can i connect the Pi to wifi ?

Re: Booting Raspberry pi from your laptop

Posted: Fri Oct 26, 2018 4:31 pm
by Pedro_Lopes

Re: Booting Raspberry pi from your laptop

Posted: Sun Oct 28, 2018 1:26 am
by HawaiianPi
atulkatti wrote:
Fri Oct 26, 2018 11:36 am
I was able to setup PI by connecting it to display and then connecting it to wifi. Now i need to take my pi to another site and connect to wifi there. I may not be able to find a display to connect to over there. How can i boot it through my laptop so that i can then add wifi details in Pi.
If you know the WiFi credentials you can create a file called wpa_supplicant.conf on the small FAT32 "boot" partition of a Raspbian imaged SD card, and that will be moved to its correct location and used to connect to the network when the Pi starts up.

My wpa_supplicant.conf file looks like this.

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
	ssid="Your network SSID"
	psk="Your WPA/WPA2 security key"
	key_mgmt=WPA-PSK
}
Edit country=, ssid= and psk= with your information (use a pure text editor, not a word processor).

If you haven't already done so, you can enable SSH at boot time by adding an empty file named ssh (or ssh.txt) to that same "boot" partition.

There is also something called a serial console cable that will let you log into your Pi without a network connection. I use cheap CP2102 USB-TTL (3V3) adapters I get from ebay for less than 2 bucks.

There may be other options as well, depending on what model Raspberry Pi you have (if it's a Pi Zero, you also have USB Gadget mode, which will let you SSH in over USB).

Re: Booting Raspberry pi from your laptop

Posted: Sun Oct 28, 2018 10:30 am
by jbudd
When i go to this new place i will not have my old wifi network
Use the mobile hotspot feature of your smartphone.

/etc/wpa_supplicant/wpa_supplicant.conf can have the login details for more than one wifi network:

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
        ssid="MyPhone"
        psk="Aardvark"
}

network={
        ssid="MyHomeWifi"
        psk="Pangolin"
}

network={
        ssid="ThePub"
        psk="Echidna"
}

With both the laptop and Pi connected to your phone you can login by ssh and add a stanza for the new network to wpa_supplicant.conf.