Back Forum New

Bluetooth Serial Shield drops <CR> when receiving data

Hello everyone,

Can anyone please help me to find the source of the weird problem with bluetooth shield. I have a device operated by RS232 protocol with TTL levels. If I control it with USB-COM adapter everything works fine. E.g. when I send :e1 command to the device it responds =010600<CR>. Now is I use bluetooth module the <CR> symbol is dropped from the communication which leads to timeout problem.
Any idea what can cause situation like this?

Here is serial port log when using USB-COM
RP_MJ_WRITE SUCCESS Length 1: :
IRP_MJ_WRITE SUCCESS Length 1: e
IRP_MJ_WRITE SUCCESS Length 1: 1
IRP_MJ_WRITE SUCCESS Length 1: .
IRP_MJ_READ SUCCESS Length 1: =
IRP_MJ_READ SUCCESS Length 1: 0
IRP_MJ_READ SUCCESS Length 1: 1
IRP_MJ_READ SUCCESS Length 1: 0
IRP_MJ_READ SUCCESS Length 1: 6
IRP_MJ_READ SUCCESS Length 1: 0
IRP_MJ_READ SUCCESS Length 1: 0
IRP_MJ_READ SUCCESS Length 1: . OD - CR here
IRP_MJ_WRITE SUCCESS Length 1: :
IRP_MJ_WRITE SUCCESS Length 1: e
IRP_MJ_WRITE SUCCESS Length 1: 1
IRP_MJ_WRITE SUCCESS Length 1: .

And BT log
IRP_MJ_WRITE BtPort0 SUCCESS Length 1: :
IRP_MJ_WRITE BtPort0 SUCCESS Length 1: e
IRP_MJ_WRITE BtPort0 SUCCESS Length 1: 1
IRP_MJ_WRITE BtPort0 SUCCESS Length 1: .
IRP_MJ_READ BtPort0 SUCCESS Length 1: =
IRP_MJ_READ BtPort0 SUCCESS Length 1: 0
IRP_MJ_READ BtPort0 SUCCESS Length 1: 1
IRP_MJ_READ BtPort0 SUCCESS Length 1: 0
IRP_MJ_READ BtPort0 SUCCESS Length 1: 6
IRP_MJ_READ BtPort0 SUCCESS Length 1: 0
IRP_MJ_READ BtPort0 SUCCESS Length 1: 0
IRP_MJ_READ BtPort0 TIMEOUT Length 0: 'Nothing here
IRP_MJ_READ BtPort0 TIMEOUT Length 0:
IRP_MJ_READ BtPort0 TIMEOUT Length 0:
IRP_MJ_READ BtPort0 TIMEOUT Length 0:

IRP_MJ_WRITE BtPort0 SUCCESS Length 1: :
IRP_MJ_WRITE BtPort0 SUCCESS Length 1: e
IRP_MJ_WRITE BtPort0 SUCCESS Length 1: 1
IRP_MJ_WRITE BtPort0 SUCCESS Length 1: .
IRP_MJ_READ BtPort0 SUCCESS Length 1: =

Also, how do I change module parameters? Sending AT<CR> from terminal doesn't get me any reply. Should R and T lines be disconnected when sending commands?
And one more question, I can connect to the module at any baud rate, not only 9600 suggested by the manual. I don't need to chage to baud rate with AT command (and actually I can't use any AT command as I receive no reply).

TOP

With my wireless module, I need to type the AT command VERY QUICKLY !
In fact using cut&past is the only way to type a full command.
I type "AT+BAUD4" the cut the 8 chars and past them in my terminal session
Then I receive the confirmation for the baudrate chnage, something like "OK9600"
The module is not connected to other bluetooth device when using the AT commands.
Hope this help !

TOP

@Dennis

When you want to use the AT command to change the name or the Baud rate , this bluetooth  module should  not connected to other bluetooth devices.

1. modify the baud rate

Send: AT + BAUD1 ("1" is a serial number, please refer to the following to find the baud rate you want)

Return: OK1200

Baud rate of the serial number as follows:

    * 1 --------- 1200
    * 2 --------- 2400
    * 3 --------- 4800
    * 4 --------- 9600
    * 5 --------- 19200
    * 6 --------- 38400
    * 7 --------- 57600
    * 8 --------- 115200
    * 9 --------- 230400
    * A --------- 460800
    * B --------- 921600
    * C --------- 1382400

Baud rate above 115200 is not recommend, because the signal interference will make the system unstable. While baud rate is above 115200, the baud rate can not be changed by PC. You have to use MCU to send commands to modify it.

2. modify the Bluetooth name

Send AT + NAMEname ("name" is the name you want, within 20 characters)

Return: OKname

3. modify pairing code

Send AT + PINxxxx ("xxxx" is the password you want)

Return: OKsetpin

4. In order to test the communication between Bluetooth module and PC, send the following command test

Send: AT (if return "OK", communication is successful.)

Return: OK

TOP

Back Forum