Version 1.1, 02.01.2008
This is a quick 2 days hack on Bluetooth based NXT remote control for J2ME compatible mobile phone.
So, we have the following:
I've run all tests on Nokia 6131 and Nokia 6230, therefore all used tools are for Nokia.
First, you need an applet. You can download it from:
You can install the applet to you phone via:
If you want to build an applet from the source, you need Nokia 6131 NFC SDK 1.1. Also, if you want to run the applet on your PC with Bluetooth support, you can use BlueCove Bluetooth stack for Windows and J2ME emulator for Windows. You may want to install the applet onto your phone over Bluetooth via BlueCove OBEX Push J2ME application, make sure your Bluetooth dongle drivers are supported by BlueCove. Currently BlueCove supports Mac OS X, WIDCOMM, BlueSoleil and Microsoft Bluetooth stack found in Windows XP SP2.
Now I will describe the content of the archive. Everything is based on batch files, as this is my favorite way to work. If you have any questions about using IDE for Java, such as Eclipse, for example, I will not be able to help with it. If something goes wrong, first thing is to check the paths settings in batch files. The good thing about batch files is clarity and simplicity.
This archive includes everything for playing with applet on the PC:
phone
build.cmd - Build the applet project. Correct your own settings of paths of the installed Nokia NFC SDK and Java.
clean.cmd - Clean-up temporary files.
src/*.java - Applet source files.
brick
btrc.nxc - Demo program, which receives the commands from the phone and draws the arrows on the brick's screen. It is really simple. Most difficult part of it is about drawing the arrows on the screen. The protocol between the applet and the NXT is pretty simple - it uses just the strings up to 80 characters long.
btio.nxc - Very popular Bluetooth library for NXT by Daniele Benedettelli. I've made modified it a little bit.
tools\nbc.exe - Command line NXC compiler by John Hansen. Version 1.0.1.b32.
tools\nexttools.exe - NXT command line tool management tool by John Hansen. Version 1.0.10.1.
compile.cmd - Build NXT demo program.
download.cmd - Download NXT demo program to the brick over USB.
run.cmd - Run NXT demo program on the brick over USB.
clean.cmd - Clean-up temporary files.
lib\bluecove-2.0.1
BlueCove Bluetooth JSR-82 DLL and BlueCove OBEX Push J2ME application.
lib\microemulator-2.0.1
J2ME Micro Emulator.
run-microemulator.cmd - Run the applet in Micro Emulator with Bluetooth support.
run.cmd - Run the applet in Nokia NFC Emulator. Bluetooth will not be emulated normally until you activate Nokia BT driver from Nokia Connectivity Framework which is included into Nokia NFC SDK. Be careful - Nokia BT driver can affect your real Bluetooth driver. Instead I recommend you use Micro Emulator because it uses BlueCove DLL which does not substitute Bluetooth driver but only uses the current stack.
download-bluetooth.cmd - Install the applet to the phone over Bluetooth. It requires BlueCove OBEX Push J2ME application installed - a useful and handy tool because you do not need the monster like Nokia PC Suite installed. Make sure your Bluetooth driver is supported by BlueCove.
Basic steps to playing with applet:
That is it!
There is a video about how this demo works - http://youtube.com/watch?v=F0HW3Mth0Pw.
Special thanks for my brother Evgeny Demin (http://www.handshake.ru/en) for testing.
If you have any question about these, feel free to ask me.
Copyright (C) 2007-2008 by Alexander Demin
alexander(@)demin.ws