Win 10 Bluetooth Serial Terminal works with HC-05 but RealTern Doesn't

HC-05 module using Arduino Mega 2560 to run very basic LED ON, LED OFF program.

On my Win 10 box I can send/receive to/from the HC-05 using Microsoft’s Bluetooth Serial Terminal app and turn the LED on/off. However, when I try to use RealTerm on the same port (Device Manager shows the HC-05 on port 27), RealTerm will open the port, but the HC-05 isn’t receiving any characters sent from RealTerm.

I’m reasonably competent (practicing EE for 50+ years), but this has me stumped. Any ideas?

TIA,

Frank

#define ledPin 13
char state = 0;
unsigned long loopcount = 0;
void setup() 
{
	pinMode(ledPin, OUTPUT);
	pinMode(18, OUTPUT); //TX1
	pinMode(19, INPUT_PULLUP); //RX1
	digitalWrite(ledPin, LOW);
	Serial.begin(115200);
	Serial1.begin(9600); // Default communication rate of the Bluetooth module
}
void loop() 
{
	if (Serial1.available() > 0) 
	{ // Checks whether data is coming from the serial port
		//Serial.println("Got a character");
		state = Serial1.read(); // Reads the data from the serial port
		Serial.print("received ");  Serial.print(state); Serial.println(" from bluetooth");
		loopcount = 0;
	}
	else
	{
		if (loopcount > 1000000)
		{
			loopcount = 0; 
			Serial.println("Nothing Yet...");
		}
		else
		{
			loopcount++;
		}
	}
	if (state == '0') {
		digitalWrite(ledPin, LOW); // Turn LED OFF
		Serial1.println("LED: OFF"); // Send back, to the phone, the String "LED: ON"
		state = 0;
	}
	else if (state == '1') {
		digitalWrite(ledPin, HIGH);
		Serial1.println("LED: ON");;
		state = 0;
	}

	if (Serial.available() > 0)
	{
		char c = Serial.read();
		Serial.print("Received "); Serial.println(c);
		Serial1.print(c);
	}
}

Well, I got it working, sort of…

I rebooted my Win 10 box, thinking that it might clear out dead com ports etc. However, when I pulled up Device Manager immediately after restarting, it still showed Com 27 as a 'Standard Serial over Bluetooth Link (Com27).

Then I used Bluetooth Settings to re-pair my PC to the HC-05, and then DM showed three SSOB links (com27, left over from the last time the HC-05 was paired, com28, and com29). All three ports show the same properties (9600 8N1 None).

Then I launched RealTerm and stepped through all 3 comports. Port 27 would ‘open’ but nothing happened when I sent characters. Same with Port 28, but when I tried Port 29 everything started working. I could transmit a 1/0 from my PC and it would cause the Mega’s LED to turn ON/OFF respectively, and the character would be echoed to the serial monitor for the Mega’s serial connection to my PC.

Then I went back and looked at RealTerm’s view of the three ports; port 29 shows green 'LED’s for CTS & DSR, and the TX & RX 'LED’s flash briefly when I send a character. However, for port 28 and 27, none of the LEDs are lit initially, and when I send a character, the TX ‘LED’ lights up and stays on.

Then I went back into the BT settings page and looked at the ‘More BT Options’ page (screenshot attached) where I saw that ports 27 (from a previous pairing, but still hanging around) and 28 showed that they were ‘incoming’ ports, whatever that means, and port 29 was shown as ‘outgoing’ and ‘HC-05 SPP Dev’ whatever that means.

My aim in all this is to use the HC-05 as part of a battery-operated digital weight scale, where I can capture/record load cell measurements remotely via a Bluetooth link. Obviously this means I have to get the BT link working reliably, and so far this part has a lot more magic in it than I like.

Any comments/suggestions?

TIA,

Frank

You are not alone with this problem and I believe you can use things as found. It is just messy The "HC-05 SPP Dev" is a reasonable response telling you it is an SPP protocaol device, which is true. This is just a guess but, assuming that by "box" you actually mean a desktop PC that has had a bluetooth dongle added, you might be able to add a bluetooth manager. The one I use is by Toshiba. It is/was a standard feature on Dell laptops, and I therefore guess it is a universal item.

Nick_Pyner:
You are not alone with this problem and I believe you can use things as found. It is just messy The “HC-05 SPP Dev” is a reasonable response telling you it is an SPP protocaol device, which is true. This is just a guess but, assuming that by “box” you actually mean a desktop PC that has had a bluetooth dongle added, you might be able to add a bluetooth manager. The one I use is by Toshiba. It is/was a standard feature on Dell laptops, and I therefore guess it is a universal item.

Thanks for the reply - at least now I know i’m not alone in the Bluetooth jungle ;-).

By ‘box’, I actually meant my Dell XPS-15 Laptop running Win 10 Home, so it already has a BT stack built-in. The Microsoft Bluetooth Settings utility I am using also came pre-installed. However, the Microsoft Bluetooth Serial app was a recent add-on from the Microsoft store.

Anyone have any experience with the Adafruit BT products (LE & non-LE)? I was thinking of using their stuff as it seems to be significantly smaller physically, and (maybe) lower power.

Regards,

Frank

I don't think Ada bluetooth is any smaller or run at any lower power than any other bluetooth, and their main distinguishing feature is their high price. I do recall they have a BLE shield with prototyping space that is Uno size and possibly quite useful - and the price well-justified.