xkxx
Posts: 39
Joined: Sat Dec 10, 2011 5:26 am

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 6:29 am

Hi all,
My friends and I are high school students who are interested in getting Raspberry Pis for our programming experiments and probably some projects. Our plan is to purchase our raspis together in one order once bulk purchasing is available in order to minimize the shipping fee from UK. But now I am concerned about not having the GPIO pins (which I assume includes the UART pins) out of the box.

As boarding students we don\'t have any TVs or monitors in our dorm rooms, neither any of us can afford buying one, so using raspi the way foundation conceived is not possible for us. However, we do have our own laptops, and so we are thinking about connecting raspi to the laptops and communicating over either serial or ssh. The issue with ssh is that we can\'t assume sshd is built-in and ready to use for all system images (Some of us may do distro-hopping before settling down on one distro, and if any of the images are lack of sshd we will have trouble), and if any problems arise during booting (incompatibilities with sd cards, broken images, etc) we won\'t be able to figure out what it is. Therefore having UART is considered crucial for us. However, if it\'s decided not to ship with the UART pins connected it means to us that we won\'t get UART at all, as none of us has the capabilities yet to do soldering or such. I hope there\'s a proper solution for this problem. We are looking forward to play with our raspis.

Thanks in advance,
xkxx

macemoneta
Posts: 59
Joined: Sun Oct 23, 2011 12:47 pm
Contact: Website

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 8:30 am

You can always use mini test clips, like these: http://goo.gl/ggdyf

I use them periodically. They\'re small enough to fit in the holes, and hold securely.

xkxx
Posts: 39
Joined: Sat Dec 10, 2011 5:26 am

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 2:58 pm

Such minigrabbers will add extra cost, especially since $35 is already 2-week allowance for us. Paying $5 for an ethernet wire or an uart-to-usb adapter is OK, but anything more than that is really unaffordable for us students. We have actually bought the accessories we need during Black Friday and it would be too bad if we can\'t use them.

User avatar
jojopi
Posts: 3086
Joined: Tue Oct 11, 2011 8:38 pm

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 3:36 pm

As I understand it, the UART pins will be low-voltage logic level. So you will need a special serial adapter anyway, not a regular RS232 adapter. And there is no universally standard pinout for these, so you would always need to work out cabling.

Actually, I think it is probably easier to jam three wires (transmit, receive, ground) into the plated holes than it would be to connect them to a fitted header.

Also, if you can not guarantee that sshd will be running, how do you know that getty will? Most distros these days do nothing with the serial port out of the box, and cannot use it to fix booting, and most computers (including the Pi, really) do not have serial ports anyway.

xkxx
Posts: 39
Joined: Sat Dec 10, 2011 5:26 am

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 4:10 pm

From the wiki page I can find the pinouts for uart, and I guess I can just follow that. We bought a bunch of uart-to-usb adapters from ebay so we can plug it in the usb ports on our laptops and connect the pins on the adapter to raspberry pi. The reason why we consider uart is that the beginners wiki page recommends it. We didn\'t know anything about uart prior to that.
I think uart is for outputting kernel boot messages and once I connect to uart I can use it as a console. It doesn\'t depend on any special drivers on the images loaded on raspberry pi, does it?

User avatar
spennig
Posts: 84
Joined: Mon Aug 29, 2011 11:34 am
Location: New Forest
Contact: Website

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 4:13 pm

And you quite easily ensure that sshd is available, together with any other pre-requisites (users, sudo enabled etc.) by running the rootfs in qemu before copying it to the SD card.

tonycollinet
Posts: 38
Joined: Sat Dec 10, 2011 4:12 pm

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 4:15 pm

Why not get one of the cheap video to USB input devices for your laptop, and use the laptop screen, from the composite video output of the pi. There are many on ebay/amazon for as low as $5. Take care you can return them though, because at that price point, reviews indicate quality is variable.

xkxx
Posts: 39
Joined: Sat Dec 10, 2011 5:26 am

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 4:40 pm

Well, we can determine if a image doesn\'t have sshd, but we will have no way to fix it because we don\'t have the experience of building custom booting images.
And for the composite to usb input device, should have thought about that. But I guess we are stuck with the uart adapters now. We assumed the uart pins would be there because it was there on the alpha board and I think Gert confirmed somewhere in the forum that it would make it to the final board. We didn\'t anticipate that the pins wouldn\'t be connected.
Actually, here\'s a request. Is it possible to make the boards with only the uart pins connected so we can use them out of the box? I think a lot of people don\'t need all the gpio pins but need uart for serial connection.

dpawson
Posts: 129
Joined: Mon Nov 14, 2011 5:05 pm
Contact: Website

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 4:55 pm

Take a look at http://www.bitsbox.co.uk/connects.html
They have pins you could perhaps solder to the rpi board, then run wires
to a 9 way 232 connector and solder there?
0.1 inch pitch. Few pence, but shipping could be a problem unless
you have friends in the UK?

HTH Dave

bradburts
Posts: 341
Joined: Sun Oct 02, 2011 7:07 am

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 5:17 pm

[quote]
Well, we can determine if a image doesn\'t have sshd, but we will have no way to fix it because we don\'t have the experience of building custom booting images.[/quote]

It just a few steps to add sshd to a system.
Easiest if you can borrow an HDMI monitor for a few minutes, plug your PI in and then install OpenSSH.
If for some strange reason you cannot borrow a monitor for a few minutes then you could boot another Linux system on your laptop and then copy the files onto the SD.
There are also USB to RS232 dongles which are nice and cheap but then you would have to direct the shell to then dongle, again would need to copy files or borrow a monitor.
Best not to solder really, even after you have soldered the pins you would to create a driver and then have to configure the PI to use your \'uart\'.
Stick with SSH & VNC.

EDIT
Sorry, forgot to say how:

Code: Select all

sudo apt-get install openssh-server
provide password and answer \'yes\' if prompted.

User avatar
walney
Posts: 233
Joined: Wed Nov 30, 2011 6:57 pm
Contact: Website

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 5:18 pm

If you are worried about using solder, you can buy conductive silver epoxy glue (or paint). It is expensive, but you would need a very small amount (and could share it).

xkxx
Posts: 39
Joined: Sat Dec 10, 2011 5:26 am

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 5:35 pm

@dpawson: no I don\'t live in UK and we really can\'t solder. I don\'t think it\'s even allowed to have the equipments in the dorm.
@bradburts: unfortunately there\'re no monitors that we can *borrow* in the school, and we are boarding students. I\'m using Linux as my primary os so I guess the latter way would work. The USB to RS232 (uart) dongles are exactly what I\'m talking about and we have them already, but the problem is that we can\'t use them if there\'re no uart pins but only holes for soldering. If only we have the uart pins we are all set to go. And probably we\'ll install and use ssh once the system is ready because it seems that serial is slow.
PS @bradburts: I use this command to install sshd on my laptop to get remote access to it. Thanks for your kindness.

hippy
Posts: 6244
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 5:44 pm

[quote]Quote from xkxx on December 10, 2011, 06:29
if it\'s decided not to ship with the UART pins connected it means to us that we won\'t get UART at all, as none of us has the capabilities yet to do soldering or such. [/quote]

It\'s not that hard to solder the three or four pins needed to the R-Pi and I am sure that someone in high school would be able to teach you how or perhaps do it for you. It\'s not so hard to teach yourself; \"even Liz can do it\" (paraphrasing her own words).

If you really are stuck you could even flatten the insertion ends of the pins slightly so they are push-fit contacts until you can get them soldered in properly. Some PCB\'s even have their pin holes slightly off centre line to allow that with no effort necessary but I don\'t believe the R-Pi does.

Johannes
Posts: 64
Joined: Sun Jul 31, 2011 8:05 pm

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 5:52 pm

Soldering is a skill worth learning. Don\'t be afraid, find a tech-minded teacher and ask for a quick tutorial and some supervision while you fix up your Raspberry Pis.

The serial port on the Raspberry Pi is not TTL level (5V). Make sure that your serial adapters are not just 3.3V tolerant but true 3.3V adapters, or you run the risk of frying the Pi.

That said, I expect that most distributions which are going to run on the Raspberry Pi without significant extra work will come with sshd by default, because running Raspberry Pis without a monitor is such an attractive option. Many of us will make them into headless servers.

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 6:02 pm

There are good software solutions to this issue too. e.g. grab a statically built sshd server (such as dropbear), then you can just add that to your distros boot script and install the standard sshd after that. As others have said, I expect there are plenty of other people who\'d want sshd running on first boot. Rob Landley\'s Aboriginal Linux has dropbear binaries under \"prebuilt binaries/extras\" http://www.landley.net/aboriginal/

For debugging boot issues there is netconsole, but sadly it doesn\'t seem to work with the smsc9512 (complains polling is not supported).

http://www.kernel.org/doc/Documentation ... onsole.txt

Johannes
Posts: 64
Joined: Sun Jul 31, 2011 8:05 pm

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 6:04 pm

[quote]Quote from xkxx on December 10, 2011, 17:35
The USB to RS232 (uart) dongles are exactly what I\'m talking about and we have them already[/quote]

If they are adapters with a 9-pin plug, like in the following picture, then they\'re not the right kind.
[img]https://upload.wikimedia.org/wikipedia/ ... SERIAL.jpg[/img]

To connect to the builtin serial port, you need an adapter like this:
http://www.ebay.com/itm/150710735528

xkxx
Posts: 39
Joined: Sat Dec 10, 2011 5:26 am

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 6:21 pm

@Johannes: the ebay one is exactly what we bought
@asb: netconsole seems interesting. maybe we\'ll try that if we can\'t get ssh to work
Thanks for all the replies. I still don\'t think we\'ll do soldering, and I hope the images will have sshd on them. It would be great if we can have uart out of the box though, and I believe many people will need it.

User avatar
jojopi
Posts: 3086
Joined: Tue Oct 11, 2011 8:38 pm

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 6:35 pm

[quote]Quote from xkxx on December 10, 2011, 16:10
I think uart is for outputting kernel boot messages and once I connect to uart I can use it as a console. It doesn\'t depend on any special drivers on the images loaded on raspberry pi, does it?[/quote]

The kernel can be built with or without serial support built in. If it is built in (not as a module) then you can get boot messages sent to serial with a kernel command line option like \"console=ttyS0,38400\". (On the Pi, I understand you can set kernel command line options in the FAT file \"cmdline.txt\".)

If you also boot in single user mode then the distro is likely to let you use the serial console interactively. But in general if you want to be able to log in over serial you need to have a getty daemon installed and configured. I would consider this less standard these days than an sshd.

I do not think we know yet what distro images will be available for the Pi or what kernel options will be compiled in or what daemons will be running out of the box.

xkxx
Posts: 39
Joined: Sat Dec 10, 2011 5:26 am

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 6:56 pm

@jojopi: I think we\'ll stick with single user mode for setup on uart and switch to ssh for later login because we\'re definitely not going to try x11 over serial :)
Btw if uart is not considered normal usage for raspi they should really update the sections about uart and serial connection in the beginner and verified peripherals wiki or people will start buying usb-uart adapters :)

stanis
Posts: 1
Joined: Sat Dec 10, 2011 8:47 pm

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 8:51 pm

Which board are you going to use?
The one with network and 256MB? in that case a network cable would give you SSH as well. And if it\'s the 128MB version, a USB to Network adapter could give you that as well.
No need to fiddle with ssh through the UARTS, no special kernel compilation etc. With SSH over network, it will be faster anyway...

xkxx
Posts: 39
Joined: Sat Dec 10, 2011 5:26 am

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 10:28 pm

@stanis: We\'re going to use Model B for the ethernet port. The only problem with ssh is that it\'s usable only after the system has booted, and if anything happened during boot (likely incompatibilities with sd cards or issue with system images) we wouldn\'t know and wouldn\'t be able to solve it. Having low-level access like uart solves this problem. But now we can\'t use uart as the pins are not mounted.

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5202
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 10:48 pm

\"Even Liz can do it\" is actually a really good assessment of how easy it is; I am notoriously cack-handed. Do you have an electronics lab or a friendly physics teacher at your school? There should be soldering equipment in the electronics or physics department, and any good teacher should be pleased to have you ask for help on this sort of thing. It\'s a really useful skill to have anyway, whatever age you are; best to learn how to solder now!
Director of Communications, Raspberry Pi

xkxx
Posts: 39
Joined: Sat Dec 10, 2011 5:26 am

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 11:16 pm

@Liz: any chance we can get uart out of the box (shipped with uart pins soldered)? Yes, we do have a physics lab in our school and I\'ll ask my physics teacher to help solder the pins in case ssh fails to work (actually I\'d be amazed if my raspi can boot successfully the first time, as we\'ll risk using high-end SD cards). But other people who wants uart may not have the capabilities for soldering.

Anyway here\'s my plan:
1. We will try booting raspi and connecting to it through ssh. If it works: fantastic; if not: goto step 2
2. If for some reasons (sd card problem I\'d assume) the booting fails or something goes wrong: complain on the forum for 2 days, then beg our physics teacher to solder the pins and try connecting through uart.
3. If it works: great; if we find out what problem(s) occur during booting: fix it; if the problem is the sd card: ...buy a new card
4. ... I have no idea what to do if anything else fails :(

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5202
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 11:23 pm

Fraid not. I\'d love to help, but we\'re just not able to offer custom builds of any sort because it creates a nightmare of bureaucracy and admin, as well as costing us more at the factories because it increases the number of steps there are in production.

Hell; you\'re resourceful enough to have come up with your UART idea. I\'ve got a hunch that you and other people in your position are also resourceful enough to work out how to get those pins soldered on! I promise you that the soldering part is not as big a hurdle as you think. (Any chance I can get you to skip part 1 of step 2?) 8)
Director of Communications, Raspberry Pi

asb
Forum Moderator
Forum Moderator
Posts: 853
Joined: Fri Sep 16, 2011 7:16 pm
Contact: Website

Re: UART for using Raspi without a screen

Sat Dec 10, 2011 11:58 pm

xkxx: if you have an SD card and the internet I think it\'s not going to be too hard to get something that boots, acquires network address, and starts and ssh server. If it doesn\'t work it is admittedly hard to debug, but remember the raspi has composite out too. Maybe there\'s a TV somewhere you could have access to for just a few minutes for initial configuration (assuming you don\'t have access to a DVI or HDMI monitor).

Return to “General discussion”