Page 1 of 1

Is there a way to set up a Pi without using a monitor?

Posted: Thu Sep 19, 2013 6:40 pm
by allfox
Hello guys~

I want to set up a new SD card for my Pi, but I don't have a display device for Pi.

I have a laptop, whose monitor can't be rewired.

Currently, I wifi and ssh to Pi for playing around. This SD card was set up using a TV, which I didn't carry with me when I moving HQ.

So is it possible to set up a new SD card only using a laptop and a headless Pi?

Re: Is there a way to set up a Pi without using a monitor?

Posted: Thu Sep 19, 2013 6:55 pm
by Joe Schmoe
The short answer is "Yes, as long as you do everything right."

I.e., if something goes wrong, you might not be able to debug it.

You might also want to look into getting a serial connection going. Question-for-the-crowd: Does it count as "headless" if you have a serial connection?

(Just kidding, BTW)

Re: Is there a way to set up a Pi without using a monitor?

Posted: Thu Sep 19, 2013 7:06 pm
by Heater
Yes.

The Pi has a UART (serial interface) on it's GPIO pins that is available from the GPIO header.

On that interface the Linux kernel sends all boot time messages and then when the system is up and running there is a user shell (command line interface) running on it that you can log into and control everything, the same as the command line interface on the HDMI monitor.

All you need to do is connect the relevant pins (Tx, Tx, Gnd) of that UART on the GPIO header to a serial to USB interface which is connected to your PC which is running some terminal program. Minicom on Linux perhaps HyperTerminal on Windows.

Re: Is there a way to set up a Pi without using a monitor?

Posted: Thu Sep 19, 2013 8:46 pm
by DeeJay
allfox wrote: So is it possible to set up a new SD card only using a laptop and a headless Pi?
Yes - but I think the laptop needs to be on a wired connection. Which Operating System and/or installer mechanism do you hope to use on the RPi.

Re: Is there a way to set up a Pi without using a monitor?

Posted: Thu Sep 19, 2013 8:48 pm
by AndrewS
Heater wrote:All you need to do is connect the relevant pins (Tx, Tx, Gnd) of that UART on the GPIO header to a serial to USB interface which is connected to your PC
Just make sure it's a USB to TTL 3.3V serial adaptor, if you use a 'traditional' USB to serial RS232 adaptor you'd damage your Pi.
More info in the wiki: http://elinux.org/RPi_Serial_Connection

Re: Is there a way to set up a Pi without using a monitor?

Posted: Thu Sep 19, 2013 9:28 pm
by Heater
AndrewS,
Just make sure it's a USB to TTL 3.3V serial adaptor,
Good point.

I tend to forget because that's all I have.

Re: Is there a way to set up a Pi without using a monitor?

Posted: Thu Sep 19, 2013 9:47 pm
by jbeale
If you search for PL2303HX on ebay, you'll find 3.3V level USB-serial converters starting under $2 with free shipping, and connecting wires included! That's what I use. They also provide the USB +5V from your host PC on a pin, which you can actually use to power your Pi (+5V is the corner GPIO pin, farthest from the ethernet jack) at least if you don't have any significant power-drawing devices connected. Here is a photo of that setup working: http://www.raspberrypi.org/phpBB3/viewt ... =44&t=9665

Re: Is there a way to set up a Pi without using a monitor?

Posted: Fri Sep 20, 2013 3:05 am
by bulletmark
allfox wrote: I want to set up a new SD card for my Pi, but I don't have a display device for Pi.
..
So is it possible to set up a new SD card only using a laptop and a headless Pi?
Just create a raspbian image on SD card using your laptop in the normal way, boot the pi off it, and then ssh in and configure it how you want. I've never plugged a monitor (or keyboard or mouse) into my RPi. Or are you asking something else?

Re: Is there a way to set up a Pi without using a monitor?

Posted: Fri Sep 20, 2013 4:52 am
by allfox
Thanks for all the replies.

So there are two ways here:
1 Connect Pi's GPIO to laptop's USB for interact.
2 Connect Pi's ethernet with laptop and SSH to interact.

I thought Raspbian's SSH is default to off, I had to use raspi-config to enable it.

Anyway, I'll try both of them. Thank you, guys.

Re: Is there a way to set up a Pi without using a monitor?

Posted: Fri Sep 20, 2013 5:25 am
by bulletmark
allfox wrote: I thought Raspbian's SSH is default to off, I had to use raspi-config to enable it.
The ssh server (sshd) is enabled by default in raspbian.

I also have noticed that raspi-config is flawed because regardless of whether the ssh server is enabled or not, it always defaults to select "Enable" which makes users presume it is currently disabled. So you would have thought that you enabled the ssh server when in fact it was already enabled and running.

Re: Is there a way to set up a Pi without using a monitor?

Posted: Fri Sep 20, 2013 12:37 pm
by AndrewS
bulletmark wrote:I also have noticed that raspi-config is flawed because regardless of whether the ssh server is enabled or not, it always defaults to select "Enable" which makes users presume it is currently disabled.
I suggested something similar a while ago https://github.com/asb/spindle/issues/75