When I go into settings, my phone sees the "HC_05" bluetooth signal. I click on it, and it connects right away. It stays connected for 5-10 seconds, then suddenly disconnects.
I am thinking that my phone is not receiving any data from the bluetooth module, and thus deciding that the signal is worthless, and dropping it. But even if that, why? When I call btSerial.read() from the linked code, isn't that talking to the device?
When I go into settings, my phone sees the "HC_05" bluetooth signal. I click on it, and it connects right away. It stays connected for 5-10 seconds, then suddenly disconnects.
I am thinking that my phone is not receiving any data from the bluetooth module, and thus deciding that the signal is worthless, and dropping it.
probably sounds right.
jckelley2:
But even if that, why? When I call btSerial.read() from the linked code, isn't that talking to the device?
call it from where ?
if the Arduino, then WHERE is it reading from ?
who is write-ing to it ?
are you using a Bluetooth Terminal on your phone ?
you can't just pair the devices and then let the Arduino run - the phone is actually the master here and has to tell the Arduino to do something.
If you can get any communication at all, there is not likely to be anything wrong with your code, your equipment, or your procedures.
I therefore suspect the power supply, Bluetooth is innocent, and some other peripheral is involved. This goes double if you are not getting power from a wall wart good for at least 7.5v.
retronet_RIMBA1ZO:
call it from where ?
if the Arduino, then WHERE is it reading from ?
who is write-ing to it ?
are you using a Bluetooth Terminal on your phone ?
you can't just pair the devices and then let the Arduino run - the phone is actually the master here and has to tell the Arduino to do something.
Yes, but the phone is not holding the connection long enough for me to even switch to the app and send anything to the arduino. It connects, sits for a 5-10 seconds, then drops it. This EXACT same thing happens when I try to connect it to my computer via bluetooth. The signal is connected, then dropped after 5-10 seconds.
Nick_Pyner:
If you can get any communication at all, there is not likely to be anything wrong with your code, your equipment, or your procedures.
I therefore suspect the power supply, Bluetooth is innocent, and some other peripheral is involved. This goes double if you are not getting power from a wall wart good for at least 7.5v.
I'm using a 9V wall power supply and the problem is still occurring.
OK, in the light of the above, maybe the signal is being dropped, but I don't think so. I fail to see how the phone can do that on the basis of the "worth" of the signal. If it is doing that, it is entirely down to improper settings at the phone end, Arduino and Bluetooth are innocent.
You might check the wiring. A successful pairing means just that and no more. It does not mean there will be a successful connection and it may not be a case of "not holding" and more a case of "never had" a connection.
Note that this uses the proper hardware connections, pins 0,1 - which are properly marked.
EDIT
There is also some comment above that I submit is doubtful. You may have code where action by Arduino is dependent on a signal from the phone, but there is no obligation to do this. Unless it is a scheduled event, I think the most common practice is to have Arduino send a constant stream of data, and it neither knows nor cares if anybody is receiving it.