Connecting Nokia S60 Device + ArduinoBT directly


hi folks,

i'm trying connect nokia 6120c mobile phone directly arduinobt. used erich berger's tutorial ( http://www.arduino.cc/playground/code/symbians60python ), doesn't work should:

1 - arduino-code seems ok. @ least can send character "1" board via serial-port mac (using arduino-api) , led on pin 13 blinks once.

2 - guess there's wrong python code. unfortunately don't have clue exactly. when running code on phone, nothing happens led on pin 13. serial window on mac (terminal) doesn't show anything.
my phone seems okay, because there standard text displayed in terminal when launching python bluetooth console.

to make sure didn't make mistakes while copying , adapting erich's code, paste code i'm using:


*arduino*

// arduinobt s60 mobile phone
// (cleft)erich berger 2007
int = 0; //counter
int led = 13; // pin led
int reset = 7; //reset pin bluetooth
int val = 0; // serial port data
int track[61];

void ledblink() {
 digitalwrite(led, high);
 delay(100);
 digitalwrite(led, low);
 delay(100);
}

void ledblink1() {
 digitalwrite(led, high);
 delay(500);
 digitalwrite(led, low);
 delay(500);
}

void init_track() {
 for (i=0; i<=60; i++) {
  track = i;
 }  
}  
void reset_bt(){
 // reset bluetooth interface
 digitalwrite(reset, high);
 delay(10);
 digitalwrite(reset, low);
 delay(2000);
}

void config_bt(){  
 serial.println("set bt pagemode 3 2000 1");
 serial.println("set bt name bt_arduino");
 serial.println("set bt role 0 f 7d00");
 serial.println("set control echo 0");
 serial.println("set bt auth * 12345");
 serial.println("set control escape - 00 1");
}  

void setup() {
 reset_bt();
 config_bt();
 pinmode(led,output);  
 pinmode(reset,output);  
 init_track();
 serial.begin(115200);
 ledblink();  
}

void loop () {
 val = serial.read();
 if (val != -1) {
   if (val == 49) {
    ledblink1();
       for (i=0; i<=60; i++) {
         serial.print(i, byte);
         delay(10);
       }
   }
 }
}


---

*python*


# arduinobt s60 mobile phone
# (cleft)erich berger 2007

import socket

def bt_connect():
   global sock
   sock=socket.socket(socket.af_bt, socket.sock_stream)
   target=(00:07:80:83:aa:cd,1) # serial connection arduino bt
   sock.connect(target)

def bt_send_data():
   global sock
   test = "1"
   sock.send(test)

def bt_receive_data():
   global sock
   i = 0
   buffer = []
   while(i <= 60):
        data = sock.recv(1)
        print str(ord(data))
        buffer.append(data)
        = + 1
   return buffer

bt_connect()
bt_send_data()
track = bt_receive_data()

f = open('e:\\track.txt','w')

for in range (0,60):
   f.write(str(ord(track)))
   f.write("\n")

f.close()

print str("finished")
sock.close()


----------------

it great if give me issue!

thanks lot in advance....

daniel



Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Connecting Nokia S60 Device + ArduinoBT directly


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums