Easy Bluetooth with Javelin Stamp
Don Scales
Posts: 6
Hi,
I am trying to get my Easy Bluetooth module to work with the Javelin Stamp.
Wiring it up is easy (only 4 wires) - rx to cpu pin 0 tx to cpu pin 1)
Power up the Javelin - green led on Easy Bluetooth module lights.
Running windows XP - insert Blue Tooth dongle.
Find the Easy Bluetooth device on the PC and enter the pass key.
COM port 12 is allocated.
Now - there don't seem to be any Java examples for the Easy Bluetooth module.
The documentation suggests you can use it as a serial link.
I have tried reading and writing bytes to and from the Uarts.
I have tried Hyperterm on the PC.
I have tried Jave software that can talk to my phone over bluetooth.
I can't get either end to respond.
I have also tried building and sending the packets described in the
Easy Bluetooth manual - nothing.
I am ovbiously doing something wrong.
Any suggestion or software much appreciated.
Don
·
I am trying to get my Easy Bluetooth module to work with the Javelin Stamp.
Wiring it up is easy (only 4 wires) - rx to cpu pin 0 tx to cpu pin 1)
Power up the Javelin - green led on Easy Bluetooth module lights.
Running windows XP - insert Blue Tooth dongle.
Find the Easy Bluetooth device on the PC and enter the pass key.
COM port 12 is allocated.
Now - there don't seem to be any Java examples for the Easy Bluetooth module.
The documentation suggests you can use it as a serial link.
I have tried reading and writing bytes to and from the Uarts.
I have tried Hyperterm on the PC.
I have tried Jave software that can talk to my phone over bluetooth.
I can't get either end to respond.
I have also tried building and sending the packets described in the
Easy Bluetooth manual - nothing.
I am ovbiously doing something wrong.
Any suggestion or software much appreciated.
Don
·
Comments
Reading the RBT-001 User Manual, it seems I should get a responce when I set transparency
but all I get back is 0xFF.
My pc code opens the send and receive ports ok but it does not receive anything and
nothing it sends gets through.
Regards
Don
static Uart tx = new Uart(Uart.dirTransmit,CPU.pin1,Uart.dontInvert,Uart.speed9600,Uart.stop1);
static Uart rx = new Uart(Uart.dirReceive,CPU.pin0,Uart.dontInvert,Uart.speed9600,Uart.stop1);
public static void main() {
byte[noparse]/noparse adr = {0x02,0x52,0x0a,0x08,0x00,0x64,0x01,
0x64,(byte)0xca,0x34,(byte)0xa1,0x0e,0x00, // pc bluetooth address in reverse order
0x01,0x03};
byte[noparse]/noparse stm = {0x02,0x52,0x11,0x01,0x00,0x64,0x01,0x03};
int i,j;
System.out.println("Set address");
for (i = 0;i < adr.length;i++) {
tx.sendByte(adr);
System.out.println(adr);
}
CPU.delay(5000);
System.out.println("Set transparency mode");
for (i = 0;i < stm.length;i++) {
tx.sendByte(stm);
System.out.println(stm);
}
CPU.delay(5000);
System.out.println("Wait for responce");
for (i = 0;i < 5;i++) {
while (!rx.byteAvailable());
j = rx.receiveByte();
System.out.println(j&0xff);
}
tx should be pin0
I am still unable to get the Easy Bluetooth 30085 module to work with the Javelin Stamp.
I would be interested to hear from anyone who has made this work.
Since my last post -
I have had my bluetooth module checked - it works with a Basic Stamp module.
I have written software on my PC and Javelin that communicates via a second serial port.
This software works at 9600 baud and I have run it setting flow control to none (like bluetooth)
This software will not work over bluetooth.
I have bought a new Belkin bluetooth dongle and installed software for it.
The PC can see the Easy Bluetooth and connect to it.
Using Hyperterminal to send bytes, I can see the traffic on the pc monitor and I can see
the Easy Bluetooth module receiving data (the green light flashes) but the Javelin Stamp
does not receive the data sent.
I can't see why this is not working - especially after having had the module tested.
Swapping a serial connection for the bluetooth module without changing the javelin
software should eliminate the javelin software.
Puzzled regards
Don
The Easy Bluetooth 30085 module should power up in 'Transparent' mode.
This means you can send and receive bytes without having to set anything up.
The first thing you need is a Bluetooth dongle for your PC. It must be a V2
bluetooth. My first problem was trying to use a V1.
You need to set up your PC. If you have power on your EB 30085 a green LED
will light up. On the PC you should have the Bluetooth symbol bottom right.
Right click it and start your device. Right click it again and explore you BT
places. Find BT devices should find your EasyBT. Clicking on that should
ask for the pass key (0000).
Double click on the EasyBT icon and it will show you your connection.
(Com1 on EasyBT). Right click and select connect - this will give you the
PC Com port to use.
Start up Hyperterm. Select the allocated COM port. Select 9600 baud, 8 bit,
no parity, 1 stop, no flow control. If you enter data on the hyperterm, the green
light on the EasyBT will flash.
Programming the Javelin is easy - you need two Uart connections to talk to the EasyBT.
stx = new Uart(Uart.dirTransmit,CPU.pin3,Uart.dontInvert,Uart.speed9600,Uart.stop1);
srx = new Uart(Uart.dirReceive,CPU.pin4,Uart.dontInvert,Uart.speed9600,Uart.stop1);
Now my second mistake - The EasyBT module need a crossover connection.
In my example you need to connect CPU pin 3 to rx and CPU pin 4 to tx.
Yes - thats right - transmit to rx, receive from tx.
You should be able to
stx.sendString("Hello");
if (srx.byteAvailable()) System.out.println((char) srx.receiveByte());
Regards
Don