Since you're using a Raspberry and not a genuine Arduino with a HC05, how have you connected the HC05 to the RPi ? Can you post also (in addition to your RPi code, as @ABG has already asked for) the schematic diagram of the connection ?
Cheers.
I don't see any problems in your aia export that would cause a 507 error.
Try the other suggestions, the Bluetooth terminal app and posting the sketch code.