Talking to the Raspberry Pi’s Serial Console with a Modern Device BUB

Modern Device >>

bubpi1

A question popped up on the Raspberry Pi forum a little while back asking whether the BUB could be used to connect to the serial port on the Raspberry Pi’s GPIO header. The answer is yes; it works quite well! The BUB is essentially a breakout board for FTDI’s FT232 chip that translates between a USB connection and a TTL-style UART. This is the chip that was on the pre-Uno Arduino (USB translation is handled in software on a second microcontroller on the Arduino Uno). The BUB (and BUB II) are used to communicate with most Modern Device and Jee Lab controllers, except for the BBLeo.

The BUB has a few other features that make it a bit more flexible than Just Another Breakout Board. For example there’s a polyfuse to help protect your computer if you accidentally draw too much current, and a jumper to change logic levels from 3.3 to 5 volts. The BUB I also has a handy breakout area that allows you to reroute the signals to any of the pins on the header. This is useful for connecting to devices with different pinouts like the Raspberry Pi or Parallax Propeller.

The default Raspbian OS for Raspberry Pi launches a serial console on startup, which listens for activity on the serial pins on the GPIO header. With a BUB board you can log in to your Raspberry Pi over the serial connection. The serial UART on the Raspberry Pi is connected to pins 8 (Transmit) and 10 (Receive) as shown below. You’ll need to connect the grounds as well, and there happens to be a GND signal on pin 6.

figure1

Note that the Transmit of the Raspberry Pi is connected to the Receive of the BUB and vice versa, which makes sense if you think about it.

Next, get a BUB, and jumper the signals to the auxiliary header as shown in Figure 2. Connect the header to the Raspberry Pi so the signals line up with the proper pins as shown in the photo at the top of this post.

bubpi2

You’ll need the FTDI drivers for your particular OS if you don’t have them already; download the “VCP” drivers from FTDI.

Very important: Confirm that the logic level jumper on the BUB is connected to 3.3V, not 5V.

Once you’ve booted up the Raspberry Pi, connect the BUB and the serial cable to your computer. Each FTDI chip has a unique ID which gets mashed up into the device name, which will be unique for each BUB board. On a Mac or Linux you can see this device in your /dev directory. On a Mac it will be in the form /dev/tty.usbserial-******* where the asterisks are your unique id. My BUB registers as /dev/tty.usbserial-A9014YYQ, for example, which is the same way it appears in the Arduino IDE. On Linux the BUB will show up as /dev/ttyUSB0 (if it’s the only USB device you’ve got plugged in).

On a Mac or Linux use the device name along with the screen program to connect to the Raspberry Pi over the serial connection. The Pi’s serial console is running at 115200 baud, so use the following command:

screen /dev/tty.usbserial-A9014YYQ 115200

or

screen /dev/ttyUSB0 115200

on Linux. Hit return and you should get a login prompt. You’re off and running!

screen

The post Talking to the Raspberry Pi’s Serial Console with a Modern Device BUB appeared first on Modern Device.

Back to blog