Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Wednesday, April 13, 2011

TTL Bluetooth Transceiver with Linux

I recently got one of these cheap chinese TTL to Bluetooth transceivers.

http://gb.suntekstore.com/wireless-bluetooth-transceiver-module-rs232-||-ttl.html

I got mine off ebay delivered for under US$7. The seller unfortunately didn't have a pinout diagram or any real info about the module (or maybe couldn't understand enough English to work out what I was asking).

I figured that all of them on the market are probably the same design so it shouldn't be a big deal.

Luckily I was right. The best resource I found was this:

http://www.egochina.net.cn/e-shop/ebay/datasheet/Bluetooth_Module_L6.rar

A number of diagrams, manuals and pieces of software in that archive.

The only problem is they are all windows specific.

The Ubuntu Bluetooth applet let me see and pair with the device, but no clue on how to use it.

Time to learn a little more about the Linux bluetooth stack.

hcitool scan
Scanning ...
 00:19:5D:24:B7:63 OBDII

Ok so we can see it from the command line and see it's address, it's the only thing found.

Most of the other diag tools didn't return any useful info.

Eventually I found the following to work.

sudo rfcomm bind /dev/rfcomm0 00:19:5D:24:B7:63

picocom -b 38400 /dev/rfcomm0

At that point I could talk to my MCU over bluetooth!

Thursday, December 23, 2010

Renesas RDK bring up

I'm a free software junky. Have been since the late 1990's. I run Linux on all my machines. I wouldn't have it any other way.

Which can pose a problem in the embedded space. Nearly all tools are highly Windows centric.

With the RDK, things are even worse, in that they are pushing a proprietary RTOS, Toolchain, and Debug environment. I think as also is typical, most are restricted in some way. A drug dealer approach to getting you to cough up some cash. Just a taste.

As as Engineer and tinkerer, I like to understand how things work, to have a chance to be able to fix bugs.

"If you can't change it, you don't own it." - DJ Delorie

What I find incredible that so many hackers types, who like to dismantle, re-purpose and build things, are happy to be closed off to this whole world by using highly restricted OSes and tools. It seems like a contradiction.

Anyway, there is no coincidence with the above quote, luckily for the RDK, free software hero DJ Delorie has done a lot of the heavy lifting for us Linux users.

I started here: http://www.renesasrulz.com/thread/3137

To shortcut bring up a little, I went and got the precompiled GCC binaries from kpitgnutools

The blinky example worked first go, yay!

For my application, I was initially planning on skipping using an OS entirely (due to the proprietary nature of the one that comes with the kit) and just coding to the hardware directly.

First step would be to get an on board timer running and generating interrupts... the heart beat of the application.

Plus blinking LEDs are pretty boring when you have an LCD sitting there.

So I set about modifying the blinky example from DJ to be timer and interrupt driven and also use the LCD.

The result is here: https://github.com/Zizzle/blinky2

Since getting that running I discovered that FreeRTOS looks good and is easy to build under Linux and run thanks again DJ.

http://www.renesasrulz.com/thread/3109

http://interactive.freertos.org/entries/308741-makefile-for-linux-hosted-demo-build-on-144-pin-rx-62n-board

So I may end up using FreeRTOS for my brewbot. Subject of another post I guess.