segunda-feira, dezembro 10, 2012

How to Run Raspberry Pi with No Monitor or Network

I went to the 4th Milton Keynes Raspberry Jam on Sunday. Now the thing with Raspberry Jams, is that you never know whether there’s going to be enough monitors to go round (some don’t have any at all). Last time I got one, this time there were not many laid out. I expect I could have had one if I’d have asked, but there was no need. I was prepared.

I had one of these…

USB to ttl serial interface (with 3V3 logic)

This is a USB to serial adaptor, which enables you to connect your Raspberry Pi serial port Tx (white) and Rx (green) pins to the USB port of another computer and login using the Pi’s serial interface.

It also has red (5V) and black (GND) leads. If the 5V lead is connected to the 5V pin on the RasPi, you can actually power the RasPi through your computer’s USB port – if it’s capable of providing enough output. But if you’re powering the RasPi separately, omit the red lead (but still attach the black one).

How to connect the serial-USB adaptor

A closer look

I bought this one from and it arrived very promptly. I’ve made another purchase from them recently that went equally well. Yes

If the right settings are configured on the Pi, (and they are by default on Raspbian) this means you can get a command line login console directly on your laptop. You will need to install drivers for the USB interface if you’re using windows. You can download those here.

USB-serial login on Raspberry Pi

Since none of my demos for this Jam involved the GUI (Graphical User Interface – Windows-like interface) this was more than sufficient for me.

What’s the catch?

There isn’t one really, but there are a couple of quirks. You need to unplug the USB dongle if you want to start a new session (in Putty, at least. This is a good reason not to power your Pi with it if you’re likely to need to reset the connection.) You do also have to install drivers on your other computer to run the USB-RS232 adaptor – but that’s normal for any device.

Another Gotcha! (If you have a Gertboard)

If you’ve installed the Arduino IDE for Gertboard using Gordon’s script, you’ll need to uncomment the second line below at the bottom of /etc/inittab

#Spawn a getty on Raspberry Pi serial line

#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

sudo nano /etc/inittab

and change…

#T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100


T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100

then CTRL+o, Enter, CTRL+x to save and exit. It should look like this…

Edit the last line of /etc/inittab if needed

If you’re running an older version of Debian or Raspbian, you might need to disable the kernel log output on /dev/ttyAMA0 by removing the line “console=ttyAMA0,115200 kgdboc=ttyAMA0,115200″ from /boot/cmdline.txt

But if you’re using a linux distribution (distro) newer than July 2012, you probably won’t need to.

How to do the actual serial port login

  • If using Windows, you’ll need to install the drivers You can download those here.

  • You’ll need a client application, like Putty, which can handle a serial login.

  • You’ll need to configure it, but that’s quite simple.

  • You’ll need to make sure your wires are hooked up correctly (as in the photos above).

You can download Putty from here

Configure Putty for a serial connection:

Settings you need to tweak on Putty

  • choose the virtual COM port that your computer allocates to the USB device (Mine is on COM7). You should be able to find this in “Devices and Printers” if you are a Windows user.

  • select serial connection

  • set the speed to 115200

  • save settings (if you want to)

If your wires are hooked up right, it should now just be a question of clicking Open to start a connection.

When you are faced with this screen (minus the yellow text I’ve added)…

Logging into your Pi with Putty through serial port

…just press enter and you should get a login prompt.

You can only use this as a terminal. You can’t view LXDE through it. But if a terminal is what you want, this does the job very nicely indeed. And since you can power your Pi with it too, it makes quite a useful tool for people who do demos at Raspberry Jams and other places.

I hope this is useful for you Grin


Sem comentários:


Related Posts Widget for Blogs by LinkWithin