HC05 master and slave - Sending a String from slave becomes symbols in master

Hello! I have already posted this in another topic but people suggested i should just make a new topic so i just forwarded it here.

So i'm working on two HC05 bluetooth modules where the slave should continuously send a String data to the master automatically. I have a String value which contains 3 variables in it coming each with it's own data types I was able to combine many variables into a String and deserialize them again into individual variables each in their own data types using the ArduinoJson library.

My problem now is that data i want to send from the slave bluetooth to the master one only works when i type out the String in the serial monitor and press the send button from the slave to the master. The data is displayed correctly over on the master's serial monitor. But i want it that the slave would just automate the writing of the String and continuously send it to the master, so i used "println". Then it only displays signs and symbols on the master's serial monitor which is pretty much useless.. here is a snippet of my code:

finalString = String("{\"alcohol\":" + strAlcohol + ",\"lat\":" + strLat + ",\"lng\":" + strLng + "}");

The supposed variables inside the "finalString" are all variables of their own and the "finalString" serves as the String that holds all those variables, to be sent to the master. I just want the "finalString" to be sent automatically to the master bluetooth and deserialize it in there. I am coding this using the ArduinoJson library and that library functions in the way in how i write the String in declaring the "finalString" variable. Anybody have ideas why this code just sends useless signs and symbols? Robin2 suggested i should just use cstrings instead because using String with the capital 'S' corrupts the data to be sent to the master's blueooth due to low memory of arduinos? Any help is much appreciated :slight_smile:

Are all modules operating on the same baud rate?

Are all modules operating on the same baud rate?

Yes. They both start at 9600, configurated them at 9600 and serial monitors are both 9600.. :confused:

If you want additional information one of my bluetooth modules (master) is blinking fast twice every 2 seconds but my slave is blinking slow twice every 6 seconds.. but they do pair supposedly because the slave can send what i typed in the serial monitor to the master's serial monitor. it's just this automatic sending of String value doesn't work :confused:


Why are you calling the printer 2 times?