My project involves Android (Samsung Galaxy 2) to Arduino (Uno) communication via HC-05.
HC-05 is connected to Arduino on pins 10,11 using SoftwareSerial lib.
I got this setup running for a while and was satisfied by the outcome - my bi-directional communication worked fine.
I made a change to the communication protocol and now messages sent from Android to Arduino get corrupted. It happens under particular circumstances - when Arduino writes (streams) packets of data to Android and, at the same time, monitors the input from Android for a particular message which signals the end of communication. This message, when read from SoftwareSerial buffer, gets corrupted. This corruption is not consistent - it corrupts the packet in (seemingly) random way.
I've already run many tests and am pretty sure that this message is not corrupted on the Android side.
- Is there anything about HC-05 or SoftwareSerial lib which prevents simultaneous bi-directional communication?
- Can it be that input/output buffers interfere in some way?
- How can I achieve reliable communication using the aforementioned HW and comm scheme?
P.S. I got pretty much code and am not sure what parts of it might be relevant to this issue. Will provide relevant parts per your request.