getting Bluetooth to work

Support in english
Post Reply
erikiiofph7
Posts: 26
Joined: Thu 10. Jul 2014, 20:10
Location: Sweden

getting Bluetooth to work

Post by erikiiofph7 »

I'm triyng to get my new little bluetooth module to work with my MDv2 unit.

Steps I've taken so far:
  • Connecting the BT module to K22, with RX & TX swapped like this:
    K22 Pin 1 to GND on BT module
    K22 Pin 2 to VCC on BT module
    K22 Pin 3 to TXD on BT module
    K22 Pin 4 to RXD on BT module
  • Uncommenting this line in MultidisplayDefines.h:

    Code: Select all

    #define BLUETOOTH_ON_SERIAL2 1
  • Installed the android app
  • Paired the BT module and named it "mdv2" on my Android.
When the MDv2 unit boots the BT module is blinking, then in the app I click on menu > mdv2 > Bluetooth connect. The BT module stops blinking and lights continuously, and the console in the app says I'm connected to the MDv2 unit, but I don't get any data. I also tried to read the N75 parameters, but no luck there either.

Is there any more line in the code that needs to be uncommented?
User avatar
bofh
Posts: 629
Joined: Tue 1. Jun 2010, 19:01
Location: Saarland
Contact:

Re: getting Bluetooth to work

Post by bofh »

the bt module is wired to serial0. it works out of the box if you connect a bt module with 115200 baud

Code: Select all

#define BLUETOOTH_ON_SERIAL2 1
is only for a debug / service mode (i.e. setting baud rate of bluetooth module, pin etc)

Code: Select all

#ifdef V2DEVDEBUG
			case 5:
				if (bytes_read >= 2){
/* ... */
					switch ( srData.asBytes[0] ) {
					case 4: //bluetooth test / config
#if defined(MULTIDISPLAY_V2) && defined(BLUETOOTH_SETUP_ON_SERIAL2)
						switch ( srData.asBytes[1] ) {
						case 0 : Serial2.print("AT");
								break;
						case 1 : Serial2.print("AT+BAUD8"); //set 115200
								break;
						case 2 : Serial2.print ("AT+NAMEmdv2");
								break;
						case 3 : Serial2.print ("AT+PIN1234");
								break;
						}
#endif
						break;
connect the bt module to serial2 (level shifter if 3,3v) directly to the seeeduino mega and you can use the debug modue the configure the bt module (i.e. connect with a terminal program and send 5 4 1 to set the bt module baudrate to 115200)
erikiiofph7
Posts: 26
Joined: Thu 10. Jul 2014, 20:10
Location: Sweden

Re: getting Bluetooth to work

Post by erikiiofph7 »

Oh, setting baud rate and then having the "bluetooth on serial2"-definitions commented made the trick!

I tried to save a log file in the Android app, and I can see it from within the app, but I can't find the app in a file manager like Astro. From the mUI app the log file is saved in /data/data/... but according to the Astro file manager the /data folder is empty. I also enabled showing hidden files, but /data is still empty. Using search function to search for *.mdv2 files didn't give any results either.

How do I transfer the log file to my computer?
erikiiofph7
Posts: 26
Joined: Thu 10. Jul 2014, 20:10
Location: Sweden

Re: getting Bluetooth to work

Post by erikiiofph7 »

Oh, my bad. I was apparantly trying to save the log file into a folder I didn't have write permissions to. Saving in a different folder worked great. Weird that I could see the old savings from within mUI save dialogue though, I take it that's a feature of the filesystem on the Android...
Post Reply