atulkatti
Posts: 37
Joined: Sat Oct 20, 2018 3:18 am

Booting Raspberry pi from your laptop

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.

fruitoftheloom
Posts: 20773
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Booting Raspberry pi from your laptop

Fri Oct 26, 2018 11:49 am

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
Retired disgracefully.....

atulkatti
Posts: 37
Joined: Sat Oct 20, 2018 3:18 am

Re: Booting Raspberry pi from your laptop

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

fruitoftheloom
Posts: 20773
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Booting Raspberry pi from your laptop

Fri Oct 26, 2018 3:35 pm

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.

:?
Retired disgracefully.....

atulkatti
Posts: 37
Joined: Sat Oct 20, 2018 3:18 am

Re: Booting Raspberry pi from your laptop

Fri Oct 26, 2018 4:17 pm

ok what if i connect my laptop to wifi, then how can i connect the Pi to wifi ?

Pedro_Lopes
Posts: 30
Joined: Thu Nov 03, 2016 10:04 am
Contact: Website Twitter

Re: Booting Raspberry pi from your laptop

Fri Oct 26, 2018 4:31 pm

https://www.hackster.io/pedromflopes

User avatar
HawaiianPi
Posts: 4634
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Booting Raspberry pi from your laptop

Sun Oct 28, 2018 1:26 am

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).
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

jbudd
Posts: 996
Joined: Mon Dec 16, 2013 10:23 am

Re: Booting Raspberry pi from your laptop

Sun Oct 28, 2018 10:30 am

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.

Return to “Beginners”