So, when I run this programm and look at the Serial-Console it returns on every run another result (even bigger), the returned values looks something like this.
[code]And go.
+STNA=myBluetoothName
+STWMOD=0
43 +
85 U
34 "
9
142 43 +
23
186 180 26
183 66 B
23
57 9
130 82 R
104 h
135 152 2
252 43 +
85 U
34 "
9
142 95 _
170 166 161 144 253 29
7
114 r
162 86 V
104 h
143 152 33 !
128 253 29
7
114 r
162 86 V
248 43 +
85 U
34 "
9
142 43 +
21
186 180 26
183 66 B
7
114 r[/code]
So, as you can see, it returns many times ascii codes higher than 128 and other stupid things.
I thought that i will receive something like:
+OK
But only the first char (+) is always right.
Maybe someone else runs in this situation too and can give me a hint - its really frustrating.
I don’t have a bluetooth module, but the string you pass to bluetooth.print will not be null terminated. (strlen doesn’t count the terminating null character, so you need +1 just to accommodate the original string, then add the space required for your additional chars.)
thanks you for your reply and hint. I’ve fixed that but this doesnt change the result. So, I’ve changed the bluetooth module to a new one yet und tried the same code with some more commands: The result is now way better, but again, partially with strange output. My first guess was, that the wires are broken or not fine soldered, but i’ve changed the wires many many times with no difference.
[code]And go.
+STBD=38400
+STNA=blaa
+STWMOD=0
+STAUTO=0
+STOAUT=1
+INQ=1
13
13
10
83 S
83 S
84 T
130
68 D
61 =
51 3
56 8
100 d
48 0
48 0
13
10
13
10
159
75 K
13
22
13
13
10
83 S
83 S
84 T
158
65 A
61 =
98 b
108 l
193 Á
97 a
13
18
13
10
175 ¯
79 O
146
75 K
58 :
167 §
76 L
65 A
174 ®
69 E
210 Ò
13
10
Looks like you are at least communicating now (although with lots of errors).
I missed that you are using a mini running at 8Mhz.
Which version of NewSoftSerial are you using? According to the spec, with an 8Mhz board, v9 or v10 only work reliably up to 31.25K baud and v8 only works to 14.4K.
See if it you can get it working with a lower baud rate.