Bluetooth Bee comms

I am using a pair of Bluetooth Bee modules which will eventually allow me to remote control an autonomous mower.

I have SAMD21 producing Baud 9600 serial strings of “Hello World”, which I can see is being accurately produced at the RX input of one of the BBs. The other BB is clearly linked to it and is outputting into a PC. Communication is happening, but “Wd” \r is all that is coming out at the PC.

The two BBs are matched in their settings including their Baud, so I at a loss as to why the communication is faulty.
Thanks for any help. Mike

Hello @MFW and welcome to the forum!

Could you share the code you’re using to send and receive the serial strings?

Without that, it is difficult to know what the problem may be.

For now all I can suggest is that you take a look at this post that gives some recommendations on how to receive serial messages

1 Like

Hi. Thanks for responding.

My code is modularised, but I will attempt to communicate the sense of it. I was suspecting that the BBees might be slow in their communication compared with other parts of the system, but I was assuming that the relatively slow 9600 baud should do the trick.

This is in my UART library:

uint8_t string[17] = { 0X48 , 0X65, 0X6C , 0X6C , 0X6F , 0X20, 0X57 , 0X6F, 0X72 , 0X6C , 0X64 , 0X20 , 0X0D , 0X0A , 0X00
};

void configure_usart(void){

struct usart_config config_usart_1;
usart_get_config_defaults(&config_usart_1);
config_usart_1.generator_source = GCLK_GENERATOR_4;
config_usart_1.baudrate    = 9600;
config_usart_1.mux_setting = USART_RX_1_TX_0_XCK_1;
config_usart_1.character_size = USART_CHARACTER_SIZE_8BIT;
config_usart_1.data_order = USART_DATAORDER_LSB;
config_usart_1.parity = USART_PARITY_ODD;
config_usart_1.stopbits = USART_STOPBITS_1;
config_usart_1.parity = USART_PARITY_EVEN;
config_usart_1.pinmux_pad0 = PINMUX_PA16C_SERCOM1_PAD0 ;  //tx
config_usart_1.pinmux_pad1 = PINMUX_PA17C_SERCOM1_PAD1 ;  //rx
config_usart_1.pinmux_pad2 = PINMUX_UNUSED;
config_usart_1.pinmux_pad3 = PINMUX_UNUSED;
stdio_serial_init(&usart_instance_1, SERCOM1, &config_usart_1);
while (usart_init(&usart_instance_1, SERCOM1, &config_usart_1) != STATUS_OK) {
}
usart_enable(&usart_instance_1);

}

void SendStringViaBBee(void){
usart_write_buffer_job(&usart_instance_1, string, sizeof(string));

}

This is in my Main function:

while (1){

SendStringViaBBee();
delay_ms(800);

}

I will perhaps try make the buffer small and a delay function between each character being sent.

Thanks for your help.
Mike