User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

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

Thu Sep 19, 2013 6:40 pm

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?

Joe Schmoe
Posts: 4277
Joined: Sun Jan 15, 2012 1:11 pm

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

Thu Sep 19, 2013 6:55 pm

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)
And some folks need to stop being fanboys and see the forest behind the trees.

(One of the best lines I've seen on this board lately)

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

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

Thu Sep 19, 2013 7:06 pm

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.
Memory in C++ is a leaky abstraction .

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

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

Thu Sep 19, 2013 8:46 pm

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.
Last edited by DeeJay on Thu Sep 19, 2013 8:54 pm, edited 1 time in total.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

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

Thu Sep 19, 2013 8:48 pm

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

Heater
Posts: 15949
Joined: Tue Jul 17, 2012 3:02 pm

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

Thu Sep 19, 2013 9:28 pm

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.
Memory in C++ is a leaky abstraction .

User avatar
jbeale
Posts: 3675
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

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

Thu Sep 19, 2013 9:47 pm

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

bulletmark
Posts: 121
Joined: Wed Oct 17, 2012 10:10 pm
Location: Brisbane Australia

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

Fri Sep 20, 2013 3:05 am

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?

User avatar
allfox
Posts: 452
Joined: Sat Jun 22, 2013 1:36 pm
Location: Guang Dong, China

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

Fri Sep 20, 2013 4:52 am

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.

bulletmark
Posts: 121
Joined: Wed Oct 17, 2012 10:10 pm
Location: Brisbane Australia

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

Fri Sep 20, 2013 5:25 am

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.

User avatar
AndrewS
Posts: 3625
Joined: Sun Apr 22, 2012 4:50 pm
Location: Cambridge, UK
Contact: Website

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

Fri Sep 20, 2013 12:37 pm

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

Return to “General discussion”