I've gone through A LOT of forums. Tried A LOT of Suggestions. I can't get the app to connect to HC-05. I can connect through BT Terminal and my simple Turn LED on and off Arduino code works just as it should. No go with the MIT App. Yes, I checked my Rx/Tx wires. First tried pins TX1 and RX0 on a Nano (also tried Uno). Then I used SoftwareSerial and used pins D2 and D3 (SoftwareSerial SerialBT(2,3); // RX, TX). Still no go. And yes, you'll see in my code I set the baud rate to 9600. Using a HiLetgo HC-05 module with product description specifying "Master and Slave 2-IN-1 HC 05 Module:Working Voltage 3.6V to 6V , Default baud rate:9600,Default pin:1234". I can send all the screenshots and photos you could possibly want to see to show all of this. And I am using the BT Blocks someone else suggested as a fix on another post with someone else having this exact same issue. BTW, I have CompSci degrees and I just retired after working in IT for 35+ years. There's something not right here that so many people have problems with this.
BTTest.ino (1.2 KB)
BLUETOOTH_LED.aia (85.8 KB)
BTW, I am trying to get this RC Tank running with a Android app I already built in App Inventor, but same 515 error not connecting to Bluetooth Device. Doesn't matter if it's a simple LED on/off Arduino code or the the code that will run this Tank - cannot connect with an MIT App Inventor app, no matter what I've tried from multiple suggestions I've found here and elsewhere. I can totally control the tank, all it's functions with a Bluetooth Terminal so it's not my Arduino code. I might try putting an apk code scanner on the builds and see if I can troubleshoot MIT's build of the apk's that way. There's got to be something seriously wrong in their build. Maybe I have to abandon MIT App Inventor and use something else.
See that -65536(?) on your run time screen shot?
That's a color value dropped into the connection label text value, instead of the label background color attribute.
Also, please add some on screen logging of permissions granted or rejected events. Screen1 has events to catch those.
We only get 515 errors yearly, so that's a good board search parameter.
P.S. I don't see Bluetooth Scan on your permission requests list.
How to correctly ask for Bluetooth permissions see here
Taifun





