help with bluetooth!!! please!
Archiver
Posts: 46,084
I ordered the bluetooth modules and was trying to get two way
communications done for a school project. I am trying to communicate
to 2 basic stamps using the bluetooth modules. I am able to connect
to one, send a character and receive a character at that end.
However, when I go to send a character back to the original one, it
isn't working. Do I need to disconnect after sending the first
character and then reconnect from the latter to return a character?
Or can I just receive and then connect back and send a following
character back?
I tried disconnecting the first one after sending a character and
then reconnecting, but i wasn't able to reconnect from the second to
first to send a character back afterwards.
I did, however, find a way to send a character back if I have
them connect to eachother at the beginning and then each send one,
but there seemed to be some timing issues that I couldn't hash out
because only like 1 in every 6 times, a character got returned.
Can someone please help!!!! THanks!
communications done for a school project. I am trying to communicate
to 2 basic stamps using the bluetooth modules. I am able to connect
to one, send a character and receive a character at that end.
However, when I go to send a character back to the original one, it
isn't working. Do I need to disconnect after sending the first
character and then reconnect from the latter to return a character?
Or can I just receive and then connect back and send a following
character back?
I tried disconnecting the first one after sending a character and
then reconnecting, but i wasn't able to reconnect from the second to
first to send a character back afterwards.
I did, however, find a way to send a character back if I have
them connect to eachother at the beginning and then each send one,
but there seemed to be some timing issues that I couldn't hash out
because only like 1 in every 6 times, a character got returned.
Can someone please help!!!! THanks!
Comments
I have performed bidirectional communications between two stamps
using eb500 modules quite a bit and not had any problems. Once the
modules are connected you can transmit data in either direction at
any time. I am not sure why you are seeing inconsistent behavior,
but here are a few suggestions that may help you isolate the problem.
1. Make sure that you are properly setting the module mode line. If
this line is driven low (command mode) with an active connection,
the data will be interpreted as commands and therefore not
transmitted. The eb500 manual has a good section starting on page 3
that describes this.
2. If you are not using flow control, it is pretty easy to miss data
if the receiving stamp is performing other tasks. The Basic Stamp 2
does not have a serial buffer built in. This means that if data
arrives while you are not waiting in a serin command, it will be
lost.
3. Make sure that the modules have are properly connected in all
cases. The LED on the eb500 module is lit when there is a valid
connection, so this is really easy to check.
If you post your code as well I may be able to spot the problem.
Talk to you soon,
Bryan Hall
A7 Engineering
http://www.a7eng.com