HC05 sending strings from the arduino issue, receiving works fine

my bluetooth setup for some reason is acting up...
I am building a very basic Bluetooth string receive and send app with MIT App inventor, and i can receive a string from the app perfectly, but my string that i send is not making it there...

anything wrong with the code below? I am sure there are better ways of doing it but wrong?
Thanks for your time

P.S. I can also provide the MIT app blocks/design if need be... it all is bare bones, nothing fancy just trying to debug the issue

//Bluetooth
#include <SoftwareSerial.h>
SoftwareSerial bluetooth(11, 5); //BlueTooth RX ,TX

unsigned long timestampSend = 0; // BT Write wait period
String readString;

void setup()
{
  Serial.begin(9600);
  bluetooth.begin(9600);
  delay(1000);
  Serial.print("Ready");
}

void loop()
{

  if (millis() >= timestampSend + (1000)) // sending data over BT every 500mS
  {
    while (bluetooth.available())
    {
      delay(10);
      char data = bluetooth.read();
      readString += data;

    }

    if (readString.length() > 0) {
      Serial.println("Received Value: " + readString);

      readString = ""; //clears variable for new input
    }

    bluetooth.println("Worked");
    Serial.println("Sent");
    timestampSend = millis();
  }
}

vermin_sapper:
but my string that i send is not making it there...

How do you know that?
The fact that you are receiving OK rather suggests there is nothing wrong with bluetooth, and the code looks pretty right. The only line that really counts is

 bluetooth.println("Worked");

So try that in Setup and using a standard bluetooth terminal.

Hi Nick, Thanks for the quick reply,
So i took your advice and went and downloaded a bluetooth app (actually a few) and all of them do the same thing, my arduino receives the strings and tries to send data but it is not showing up in the phone terminal.
I did move the
bluetooth.println("Worked");
into the setup. Still no change...
Any other recommendations/thoughts?

The RX and TX pins on the HC-05 are 3.3V

You may want to use a voltage divider circuit for the HC-05's RX pin.

.

Sorry, I should have mentioned that i have a voltage divider circuit (1.5k/1.5k+3.85k)*4.7 = 3.3V ish

So i unplugged the module's VCC , pressed the button on the module , reconnected the VCC and the module was blinking every 2 seconds (it's in AT mode !) , now i go ahead to the serial monitor and using that script i typed the command i wanted to execute and it just didn't do nothing , i saw the serial LED on the arduino blink , but nothing was written in the serial monitor and nothing was changed in the arduino.

Does anyone know how to solve this ?

Why would you want to be in AT mode?

That's for changing settings.

I want AT mode because I need addr to pair the module to another one.

Nick, just to clarify the unplugging the module's vcc is a different person's problem not related to the OP. From your comment it sounded like you thought that was the same person.

I went and checked the solder bridges and they all appear fine... wondering if the BT device just decided to stop working...? not sure what else to check. I double/triple checked the wiring continuity. All the wires go where they need to.

I don't want throw in the towel but i too am running out of ideas to test and i am starting to think i just need to cut my losses and move over to wifi (esp8266) instead of the HC05?

The reason for my odd choice of pins for the software serial is that i have a bunch of hall effect sensors that i use for wind directional sensing. So i decided i would sacrifice 2/8 hall effect sensors to have serial debugging as i can make up for the 'missing' hall sensor with software with a bit of error.

(sidestepping the hijack horseshit...) I imagine the 3.3ish volts would be OK, but where does the 4.7v come from? It is time to be suss about everything and, along with checking that the Arduino Tx wire is kosher, the power supply is about the last card in the pack. Are you using a phone charger on the barrel jack?

Yes, I did.
Much and all as I respect WiFi, I'm a bit of a fan of Node MCU and recognise that it may serve your purpose well, nothing beats the simplicity of bluetooth, indeed that is its raison d'ètre, and this is not a good enough reason for throwing in the towel. You are probably just doing something stupid - something you will only do once.

Leave all that other sensor stuff out of the game for the moment.

From a software point, this is a forlorn hope, but you might try the following.
Bluetooth on hardware serial, upload with it disconnected

void Setup{
Serial.begin(9600);
}

void Loop{
Serial.println("hello");
delay(1000);
}

Run, see result on serial monitor
Connect bluetooth, hopefully see result on phone
You can see result on phone and monitor simultaneously.
You might find the following background notes useful.
http://homepages.ihug.com.au/~npyner/Arduino/GUIDE_2BT.pdf
http://homepages.ihug.com.au/~npyner/Arduino/BT_2_WAY.ino
but I rather feel you have advanced past this stuff!

Nick_Pyner:
(sidestepping the hijack horseshit...) I imagine the 3.3ish volts would be OK, but where does the 4.7v come from? It is time to be suss about everything and, along with checking that the Arduino Tx wire is kosher, the power supply is about the last card in the pack. Are you using a phone charger on the barrel jack?

I had my O-scope wired up to the power supply and sampling at 20kHz it appeard 100%.
I thought that maybe the arduino Uni socket solder joint got bad so i ohm'd it out to the bottom side of the arduino board and that was ok.

Furthermore i thought (from past experience), maybe i blew the arduino pins that i am using for my BT software serial, and since i only have esp8266 lying around i got the module working on the same uno and then switched to the same software serial pins that i used for BT and that worked fine... proving that the pins work fine with the software serial and that the solder joints for pins 11 and 5 are good.

ANDI JUST FOUND THE PROBLEM... I am seriously embarrassed to say what i f#$%^&* up.
I have my wind direction sensor's number 1-8 in a circle so (45degrees) per sensor... well after your initial help saying why the bluetooth does not work on pins 0,1 (hardware serial, won't make that STUPID mistake again). Neways in my programming i replaced 5th hall sensor with my BT RX pin well that is NOT pin 5 it is pin 7 on the Uno...
you were right - stupid mistakes takes the longest time to solve and are so basic.

Changed the pin to 7 in the code and TADA it works, how embarrassing.

Thanks for sticking with me to the end...

Ps. I too am a fan of making things as simply as possible... less things that can go wrong/break etc. Think i need to slow down when making changes as i often miss things like this... lesson learned!!!