507 error unable to connect

Hello I had made MIT app for my personal project of robot while am connecting it with HC 05 bluetooth model having 38400 baud rate it shows 507 error unable to connect is the device is turned on ? But I had connected properly and bluetooth is also on .... Can you please help me out ....


Testing if the button for this event is enabled is pretty useless, because the event would not have fired if the button weren't already enabled.

Testing if BlueTooth is Connected would be more useful.