Close

Delay While Waiting for New BT Module

A project log for Bluetooth Raspberry Pi HMD

A small and subtle HMD using Bluetooth to connect to a nearby RasPi.

josephvossjosephvoss 04/21/2015 at 03:360 Comments

Successfully hosted a serial console over a ttyUSB cable, and was able to login to my Ubuntu laptop through the HC-06 connected via rfcomm. However, the baud rate was set at 9600 b/s, and there was a noticable lag. To reduce this, I set the HC-06 to it's maximum baud rate using AT commands. Unfortunately, neither my laptop nor the Arduino Nano can communicate with successfully at these speed. After scouring the internet, I couldn't find a way to change the baud to a lower rate, so I'm currently waiting on a new HC-06. There goes $7. :(

In other news, I got the display working properly using the Adafruit libraries here and here with the Arduino Pro Mini. Characters input via my keyboard were displayed correctly on the screen over a serial connection. The code for this was very simple, and I will post it sometime in the coming week. There was a small delay, but this was again at the low baud speed of 9600. I plan to speed this up, but after my debaucle with the HC-06 I decided to give it a rest for a while.

I've given some thought on the Raspberry Pi side as to how I can have the serial console and keyboard connected on boot so I can use this display as a primary monitor. The serial console can be started easily over getty in a script in /etc/init/. To get the keyboard connected I plan to execute the following command on login.

bluez-test-input connect <MAC ADDRESS>
This is of course after the keyboard has been paired and trusted by the Pi using the other bluez commands. Ican have the pi logon to a user account automatically for a given virtual console and execute commands, so hopefully this will have the keyboard configured for input on the serial terminal. Otherwise I'd have to find a way to connect the keyboard to the arduino, which seems vastly more complicated (in addition to increasing latency).

The next step will be to display the login prompt to the TFT screen. Initial testing of this failed, but once I have a usable HC-06 I can ensure that the serial console was started succesfully, and be able to ensure the Arduino is receiving the correct data.

Ta-ta for now

-Joseph

Discussions