Hello
I have been trying to fully connect a Bluetooth XC4382 module to an arduino uno.
For the moment i just want to be able to send and receive AT commands via the usb pot to fully initiate the module. The following code is what i have been using and needs refinement to allow for full communication as at the moment as the bluetooth will not provide the basic AT commands
The code is included below
from Jaycar in Australia. However there are significant differences between the commands listed and the ones you are using e.g. You are trying an "AT+VERSION" command which is not listed in the Jaycar datasheet.
Clarification on these things will help us to help you.
In an attempt i was trying to use the AT commands and it was just displaying nothing but by the data sheet there which you found seems to be the right one, the one i was going off was for the wrong model..
I will have an attempt at putting the right inputs for the code in and see how it goes
All in all i just want to be able to speak back and fourth with AT commands to the Bluetooth module that i bought
Relatively new to all of the coding, thank you for the help
Euan71002:
In an attempt i was trying to use the AT commands and it was just displaying nothing but by the data sheet there which you found seems to be the right one, the one i was going off was for the wrong model..
I will have an attempt at putting the right inputs for the code in and see how it goes
All in all i just want to be able to speak back and fourth with AT commands to the Bluetooth module that i bought
Relatively new to all of the coding, thank you for the help
Ok.
If you are getting nothing from the basic "AT" command check that your wiring is correct. The TX pin on the Arduino must go to the RX pin on the XC4382 and the RX pin must go to theXC4382's TX pin. I.E. you connect the transmitter at one end to the receiver at the other in both directions.
Secondly if you change the serial speed of the bluetooth module with the "AT+BAUD=" command you must immediately change the BluetoothSerial baud rate to match. Otherwise the module will be sending at 115200 baud and the Arduino will be listening at 9600 baud and will either receive either garbage or nothing.
Re XC4382 BLE Bluetooth Module, I am able to get all AT commands working and responding correctly as per the data sheet except for AT+DISC?, and the other Master (ROLE=1) commands.
All AT commands work except for the master commands.
I am definitely in MASTER mode.
The XC4382 does not respond with OK+DISCS ( scan started ).
I am not in an active Bluetooth connection, so that is not the problem.
I think the XC4382 is faulty and I should return to the store to exchange.
Is someone able to advise please ?
I tried as per pdf using the default File/New sketch compiled and sent to the Arduino and IDE serial monitor screen. No responses to sending AT command from the monitor - tried both TX Rx pin combinations provided in the PDF - the Led is lit solid, I see some Tx activity on the Uno, but no Rx
To connect the XC4382 BLE Bluetooth Module to communicate directly with a computer (eg for AT
command configuration and debugging), use the following connections:
Uno/Mega/Nano with no sketch loaded (ie as transparent serial bridge):
Update: I had the cabling OK for Port 1 and 2 TX to TX and RX to RX. What I didn't know was that these should to NOT be connected when the empty (File/new) sketch is loaded. Once loaded connect the send and receive cables and open the serial monitor. The at commands on this module are case insensitive. It didnt care what the end character was either, so I used CR/LF @ 9600 so its easier to read.
The module doesn't care if RX is 5v, so no need for voltage divider.
I also found out this model wont pair with a phone as its using BLE on normal BlueTooth.. The pairing (connection) is done at the application level. I used a BLE Bluetooth Terminal app and managed to send a 0 and 1 to control a Led as per the various Bluetooth control sketches around (e.g Ralph Bacon Demo https://www.dropbox.com/sh/8tf9fjb2tugkkr8/AAD0jaeRQlWhQtfv764pTEf5a?dl=0 ).
I have been using the MIT AppInventor 2 to build an Android app as per Ralph Bacon's uTube - it now has a BlueTooth LE Extension that works well with the module - the default BlueTooth controls dont as they are for legacy BlueTooth,