ARduino BLuetooth Modul

Gast #3272716
Lesenswert?

Hi Leute,

ich bin gerade dabei ein Arduino Bluetooth Modul inbetrieb zu nehmen. 
Zuvor habe ich das Bluetooth Modul von Seedstudio inbetrieb genommen. 
Das funktioniert soweit, kann den "µC" programmieren und Daten über 
Bluetooth senden.

Jetzt habe ich das Bluetooth Modul von Arduino angeschlossen und mit 5V 
versorgt. Wie erwartet, kann ich mich mit dem Bluetooth Modul verbinden. 
Im nächsten Schritt würde ich gerne ein einfaches Programm in den µC 
hochladen.
Dabei kommt immer folgende Fehlermeldung:

avrdude: stk500_getsync(): not in sync: resp=0x00

Das nichts anderes heißt, das mein Computer sich nicht mit dem µC 
vverbinden kann. Ich habe schon mehrfach die Comport einstellungen, 
Baudraten und die RX TX Pins überprüft. Leider funktioniert es immernoch 
nicht. Hat jemand von euch ein ähnliches Problem gehabt ? Ich finde die 
Doku für dieses Board ist relativ dürftig :/
Unten folgend, ist das Programm, welches ich unteranderem übertragen 
möchte ( dieses ist schon auf dem µC drauf)...Ja, ic hweiß wieso soltle 
ich das gleiche Programm noch einmal draufladen ?!?! Ich habe einfach 
nur gehofft, dass ich mit diesem Programm auf den µC komme...

Ich hoffe ihr könnt mir weiter helfen..
1
/* BT test 01
2
* ------------------
3
* Massimo Banzi
4
*
5
*/
6

7
int LED = 13;   // select the pin for the LED
8
int RESET = 7;
9

10
void setup() {
11
  pinMode(LED,OUTPUT);   // declare the LED's pin as output
12
  pinMode(RESET,OUTPUT);   // declare the LED's pin as output
13
  Serial.begin(9600);        // connect to the serial port
14
  digitalWrite(RESET, HIGH);
15
  delay(10);
16
  digitalWrite(RESET, LOW);
17
  delay(2000);
18
  Serial.println("SET BT PAGEMODE 3 2000 1");
19
  Serial.println("SET BT NAME ARDUINOBT");
20
  Serial.println("SET BT ROLE 0 f 7d00");
21
  Serial.println("SET CONTROL ECHO 0");
22
  Serial.println("SET BT AUTH * 12345");
23
  Serial.println("SET CONTROL ESCAPE - 00 1");
24
  Serial.println("SET CONTROL BAUD 115200,8n1");      //first release 19200
25
}
26

27
void loop () {
28
  digitalWrite(LED, HIGH);
29
  delay(100);
30
  digitalWrite(LED, LOW);
31
  Serial.println("ciao");
32
  delay(1000);
33
}
Gast #3272732
Lesenswert?

Es wäre sehr nett von Dir, wenn Du die genaue Shield Bezeichnung und 
einen Link angeben würdest.

Der Arduino wird über die RX/TX Pins programmiert. An diesen Pins sollte 
beim Programmiervorgang natürlich nichts angeschlossen sein.

Es gibt BT-Module die über RS232 oder über SPI kommunizieren. Welche 
verwendest Du?
Gast #3272782
Lesenswert?

Ja ich bin schon alles durchgegangen.
FÜr mich ist das auch keine "Anleitung"...


Spannungsversorgung ist auf 5 V
ich möchte folgendes Programm auch uploaden
1
/*
2
BluetoothShield Demo Code Slave.pde. This sketch could be used with
3
Master.pde to establish connection between two Arduino. It can also
4
be used for one slave bluetooth connected by the device(PC/Smart Phone)
5
with bluetooth function.
6
2011 Copyright (c) Seeed Technology Inc.  All right reserved.
7
 
8
Author: Steve Chang
9
 
10
This demo code is free software; you can redistribute it and/or
11
modify it under the terms of the GNU Lesser General Public
12
License as published by the Free Software Foundation; either
13
version 2.1 of the License, or (at your option) any later version.
14
 
15
This library is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18
Lesser General Public License for more details.
19
 
20
You should have received a copy of the GNU Lesser General Public
21
License along with this library; if not, write to the Free Software
22
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23

24
 
25
*/
26
 
27
 
28
/* Upload this sketch into Seeeduino and press reset*/
29
 
30
#include <SoftwareSerial.h>   //Software Serial Port
31
#define RxD 0
32
#define TxD 1
33
 
34
#define DEBUG_ENABLED  1
35
 
36
SoftwareSerial blueToothSerial(RxD,TxD);
37
 
38
void setup() 
39
{ 
40
  Serial.begin(115200);
41
  pinMode(RxD, INPUT);
42
  pinMode(TxD, OUTPUT);
43
  setupBlueToothConnection();
44
 
45
} 
46
 
47
void loop() 
48
{ 
49
  char recvChar;
50
  while(1){
51
    if(blueToothSerial.available()){//check if there's any data sent from the remote bluetooth shield
52
      recvChar = blueToothSerial.read();
53
      Serial.print(recvChar);
54
    }
55
    if(Serial.available()){//check if there's any data sent from the local serial terminal, you can add the other applications here
56
      recvChar  = Serial.read();
57
      blueToothSerial.print(recvChar);
58
    }
59
  }
60
} 
61
 
62
void setupBlueToothConnection()
63
{
64
  blueToothSerial.begin(115200); //Set BluetoothBee BaudRate to default baud rate 38400
65
  blueToothSerial.print("\r\n+STWMOD=0\r\n"); //set the bluetooth work in slave mode
66
  blueToothSerial.print("\r\n+STNA=SeeedBTSlave\r\n"); //set the bluetooth name as "SeeedBTSlave"
67
  blueToothSerial.print("\r\n+STOAUT=1\r\n"); // Permit Paired device to connect me
68
  blueToothSerial.print("\r\n+STAUTO=0\r\n"); // Auto-connection should be forbidden here
69
  delay(2000); // This delay is required.
70
  blueToothSerial.print("\r\n+INQ=1\r\n"); //make the slave bluetooth inquirable 
71
  Serial.println("The slave bluetooth is inquirable!");
72
  delay(2000); // This delay is required.
73
  blueToothSerial.flush();
74
}
Gast #3272813
Lesenswert?

Was willst du denn noch wissen ?!

Das habe ichz ja auch schon gesagt, das er keine Verbindung zum Board 
aufbauen kann... Diese Fehlermeldung kommt auch, wenn ich RX und tx 
vertausche bzw. keine ANgaben dazu mache....

das einzige, was ich auswählen kann ist werkzeuge -> Board -> Arduino BT
Gast #3274703
Lesenswert?

MIrco kann ja anscheinend mit dem BT Modul auf dem Arduino Board Kontakt 
aufnehmen. Ab diesem Zeitpunkt ist der Zustand mit USB gleich zu setzen. 
Das BT Modul versucht nun über RX/TX mit dem MC zu kommunizieren, was 
scheinbar schief geht. Ursache kann sein, dass der falsche MC gewählt 
wurde oder dass der Bootloader fehlerhaft ist.

Leider hat dieses Board scheinbar keine LEDs auf die RX/TX Leitung 
geschaltet. So kann man nicht sehen ob etwas gesendet wird.

MIrco will aber nicht so richtig Erklären, was er alle unternommen hat 
und wo sein Problem liegt.

Da kann man dann nur Raten.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren