Forum >communication problem between 2 ble ,one on uno one on mega
communication problem between 2 ble ,one on uno one on mega

Hi
I have a problem I'm straggling to fix for more than a weak whiteout success
I have one ble link on the uno threw joystick shield v2, defined as master, and sending data threw the serial.print command ,three numbers at a time with an 's' character at the end
I have a second ble , on a mega board threw expansion shield. The mega reads data from serial communication, by serial.read. The ble defined as peripheral, and have default definitions.
These is a connection established between the two of them , as the green indicator is on both sides.
these is an example of the reading code on the mega:
if (Serial.available())
{
char c[10];
for (int i=0; i<10;i++)
{
c[i] = 0;
}
c[0] = Serial.read();
int i =0;
while (c[i]!='s' && i<10)
{
i++;
c[i] = Serial.read();
}
Serial.print(c);
Serial.print(" ");
Serial.println(counter_time);
}
The problem: The mega board is not getting any information from the serial.read, the check Serial.available()) is not true.
When I connect the ble directly to the pc threw usb cable, I can I see in the serial monitor of the ble port, the data coming in. So my problem is somewhere between the mega board and ble link.
I tried switching to different expansion board, didn’t work, and to different mega board, didn’t work either. Don’t know what to do anymore
I have a problem I'm straggling to fix for more than a weak whiteout success
I have one ble link on the uno threw joystick shield v2, defined as master, and sending data threw the serial.print command ,three numbers at a time with an 's' character at the end
I have a second ble , on a mega board threw expansion shield. The mega reads data from serial communication, by serial.read. The ble defined as peripheral, and have default definitions.
These is a connection established between the two of them , as the green indicator is on both sides.
these is an example of the reading code on the mega:
if (Serial.available())
{
char c[10];
for (int i=0; i<10;i++)
{
c[i] = 0;
}
c[0] = Serial.read();
int i =0;
while (c[i]!='s' && i<10)
{
i++;
c[i] = Serial.read();
}
Serial.print(c);
Serial.print(" ");
Serial.println(counter_time);
}
The problem: The mega board is not getting any information from the serial.read, the check Serial.available()) is not true.
When I connect the ble directly to the pc threw usb cable, I can I see in the serial monitor of the ble port, the data coming in. So my problem is somewhere between the mega board and ble link.
I tried switching to different expansion board, didn’t work, and to different mega board, didn’t work either. Don’t know what to do anymore
2015-09-28 23:12:43 Ok, thanks for your photos, I came to realise your expansion shield is V7 but not this one.
Then turn the switch to RUN but not PROG, your problem will be fixed. Btw, you can reset the ble link module to factory setting, including the USBDEBUG.
Leff
Then turn the switch to RUN but not PROG, your problem will be fixed. Btw, you can reset the ble link module to factory setting, including the USBDEBUG.

2015-09-27 07:48:49 the wiring is done automatically threw XBEE shields
I added three pics with my hardware
https://drive.google.com/folderview?id=0BwE-Ba3ePCwOR29ZVXQ4V1UxSmc&usp=sharing
1. Arduino with Joystic Shield and BLE on top -used as remote control
2. Mega with Expansion shield and BLE
The remote control BLE used as "CENTREL" and the Vehicle BLE as "peripheral"
Gandelman Roma
I added three pics with my hardware
https://drive.google.com/folderview?id=0BwE-Ba3ePCwOR29ZVXQ4V1UxSmc&usp=sharing
1. Arduino with Joystic Shield and BLE on top -used as remote control
2. Mega with Expansion shield and BLE
The remote control BLE used as "CENTREL" and the Vehicle BLE as "peripheral"

2015-09-24 21:13:23
Good!
Could you uploaded an photo about your wiring? It can help me to know whether it was right or wrong.
Leff
Gandelman Roma wrote:I use seial.*** to read or write mssgs , no matter on what com the arduino mega or the ble is (5 and 19 on my system).
is it wrong?
Good!
Could you uploaded an photo about your wiring? It can help me to know whether it was right or wrong.


2015-09-24 10:20:31 I turned off the USEDEBUG , and walla, something happened between the mega and the ble , and now I can see the serial mssgs coming in, I don't why it is related , but it worked 
as for the Second and Third question:
I use seial.*** to read or write mssgs , no matter on what com the arduino mega or the ble is (5 and 19 on my system).
is it wrong?
as for the baud rate ,I use the default of 115200 on all the cards and software
Gandelman Roma

as for the Second and Third question:
I use seial.*** to read or write mssgs , no matter on what com the arduino mega or the ble is (5 and 19 on my system).
is it wrong?
as for the baud rate ,I use the default of 115200 on all the cards and software

2015-09-22 01:38:39 Hello Gandelman,
First: turn OFF the USBDEBUG function( according to my experience ) to make sure the reliably communication with controler board.
Plz use AT+SETTING=DEFAULT to your BLE ble link on Mega.
Second: May I know which socket(COM0, 1, 2) you BLE link module was located on? Could you show me a picture. I just want to point out the mistake most people would make:
Serial.***(); ------------- COM0
Serial1.***(); ------------- COM1
Serial2.***(); ------------- COM2
Third Are all the baud rates ( 9600/115200/ etc. ) on Both BLE Link & both codes on Uno/Mega & Serial monitor the same?
Leff
First: turn OFF the USBDEBUG function( according to my experience ) to make sure the reliably communication with controler board.
When I connect the ble directly to the pc threw usb cable, I can I see in the serial monitor of the ble port, the data coming in.
Plz use AT+SETTING=DEFAULT to your BLE ble link on Mega.
Second: May I know which socket(COM0, 1, 2) you BLE link module was located on? Could you show me a picture. I just want to point out the mistake most people would make:
Serial.***(); ------------- COM0
Serial1.***(); ------------- COM1
Serial2.***(); ------------- COM2
Third Are all the baud rates ( 9600/115200/ etc. ) on Both BLE Link & both codes on Uno/Mega & Serial monitor the same?
