Serial Console to Raspberry Pi over Bluetooth

linux-kiosk

I remember the good old times, when the only way to connect to Linux server (without SSH) was a VGA monitor + keyboard or serial console. I used null modem cable
and laptop with serial port to establish serial connection to shell. Nowadays, people don’t use serial connection too often. When using servers like HP, Dell or Supermicro you have iLO/iDRAC/Web-based Management Utility.
When comes to RaspberryPI it’s different. To configure it without IP network you still need to have HDMI monitor. Of course RPI has an UART port which can be configured to serve serial access to shell. But you need to have Serial port on your laptop. I bet you don’t have it (I don’t).
Modern laptops don’t have RS232 ports. Of course you can buy USB<->RS232 converter and connect to RPI using serial cable. But I had a better idea: use BTM-222 to connect to serial port of RPI over Bluetooth.

Raspberry Pi and BTM-222

To use Bluetooth on RPI you need some external BT module. I use BTM-222 for this. Connection is quite simple: RX to TX and TX to RX and voila! By default BTM-222 runs with 19200 baud rate (gettty on RPI runs on 115200) so we need to change this. Also it is good idea to disable echo on BTM by AT command (ATE0).

inside main_0
Tune Raspberry Pi configuration

1) Change every occurence of 115200 in /boot/cmdline.txt to 19200, for example:

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

2) Change last line in /etc/inittab and replace 115200 with 19200:

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

3) Restart getty. Respawn in inittab means that process will run automatically after kill, so:

root@raspberrypi:~# ps -aef | grep AMA
root 2337 1 0 20:36 ttyAMA0 00:00:00 /sbin/getty -L ttyAMA0 115200 vt100

root@raspberrypi:~# kill -9 2337

root@raspberrypi:~# ps -aef | grep AMA
root 2340 1 0 20:36 ttyAMA0 00:00:00 /sbin/getty -L ttyAMA0 19200 vt100

Connecting from windows

Now we are ready to connect to RPI using bluetooth serial connection. Start BT on windows and look what COM number it gets:

main_0

The last step is to configure putty:

main_0

…and enjoy your wireless serial connection!

main_0

Close