Connecting Nokia S60 Device + ArduinoBT directly

Hi Folks,

I'm trying to connect my Nokia 6120c mobile phone directly with ArduinoBT. I used Erich Berger's tutorial ( Arduino Playground - SymbianS60Python ), but it doesn't work as it should:

1 - the Arduino-code seems to be ok. At least I can send the character "1" to the board via Serial-Port from my Mac (using the Arduino-API) and the LED on pin 13 blinks once.

2 - I guess that there's something wrong with my Python code. Unfortunately I don't have a clue what exactly. When running the code on the phone, nothing happens with the LED on pin 13. Also the serial window on my Mac (terminal) doesn't show anything.
My phone seems to be okay, because there is some standard text displayed in the terminal when launching the python bluetooth console.

To make sure that I didn't make any mistakes while copying and adapting Erich's code, I paste exactly the code that I'm using:

ARDUINO

// ArduinoBT with S60 Mobile Phone
// (cleft)Erich Berger 2007
int i = 0; //counter
int LED = 13; // pin for LED
int RESET = 7; //reset pin for 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 the 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);*
  • }*
  • }*
  • }*
    }
    [/color]
    ---
    PYTHON
    # ArduinoBT with 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 to 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)*
  • i = i + 1*
  • return buffer*
    bt_connect()
    bt_send_data()
    track = bt_receive_data()
    f = open('e:\track.txt','w')
    for i in range (0,60):
    _ f.write(str(ord(track*)))_
    _
    f.write("\n")_
    f.close()
    print str("finished")
    sock.close()
    _
    [/color]_
    _
    ----------------*_
    It would be great if anyone could give me some help about this issue!
    Thanks a lot in advance....
    Daniel