2

I want to design a simple application to write data from the raspbbery pi to my pc.

My questions are :

  1. When raspberry pi starts I understand that it writes to the serial port boot messages. Can I disable it ?

  2. Do I need a FTDI chip in order to acheive the conexion, or a Prolific cable will do just fine ?

3
  • 2
    There are 2 serial ports on the GPIO. The one with the boot messages is not a full UART, so it may be better to leave that one for debugging and use the other one unless you need the GPIOs for something else. Commented Feb 27, 2013 at 12:38
  • @gnibbler any document that shows how to connect to second one ?
    – opc0de
    Commented Feb 27, 2013 at 12:42
  • Assuming you have a rev2.0 board it is on GPIO30/31 Commented Feb 27, 2013 at 12:44

1 Answer 1

7

When [a] [Raspberry Pi] starts, I understand that it writes [boot messages] [to the serial port]. Can I disable [these messages] ?

Yes, you can find instructions in several places including Hobbytronics

Disable Serial Port Login

To enable the serial port for your own use you need to disable login on the port. There are two files that need to be edited

The first and main one is /etc/inittab

This file has the command to enable the login prompt and this needs to be disabled. Edit the file and move to the end of the file. You will see a line similar to

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

Disable it by adding a # character to the beginning. Save the file.

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

Disable Bootup Info

When the Raspberry Pi boots up, all the bootup information is sent to the serial port. Disabling this bootup information is optional and you may want to leave this enabled as it is sometimes useful to see what is happening at bootup. If you have a device connected (i.e. Arduino) at bootup, it will receive this information over the serial port, so it is up to you to decide whether this is a problem or not.

You can disable it by editing the file /boot/cmdline.txt

The contents of the file look like this

  dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Remove all references to ttyAMA0 (which is the name of the serial port). The file will now look like this

  dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

Reboot

In order you enable the changes you have made, you will need to reboot the Raspberry Pi

  sudo shutdown -r now

Do I need a FTDI chip in order to [achieve] the [connection], or [will] a Prolific cable [...] do just fine ?

Unless your PC is old enough to have a suitable RS232 port, you'll need a USB to serial adapter of some sort such as the Adafruit USB to TTL Serial Cable - Debug / Console Cable for Raspberry Pi .

enter image description here

The serial pins on the GPIO connector are not adjacent, so you need a connector (like the above example) with 4x1-way header sockets not 1x4-way header socket. Also the pi's serial port may not have a DTR line (I'm not sure on this).

The Prolific USB to Serial cable has a DE-9 serial connector - so cannot be used directly. You may be able to use female-male jumpers to connect the DE-9 sockets to the GPIO pins - but this may be troublesome. There is probably an add-on board for the Pi that provides a DE-9 connector but I expect a cable like the Adafruit cable is the cheapest, simplest and most convenient solution (though one with an extra DTR connector would be more versatile - e.g. for Arduino).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.