Reading Bluetooth via Serial: cant get it to work

I am trying to give input to my Arduino via Bluetooth on the serial port.
my "Arduino" is actually a barebones without USB but with an FTDI
I use the Bluetooth Terminal app on my Android phone.
My program section looks as follows:

if (Serial.available() > 0) {
incomingByte = Serial.read();
Serial.print(F("Received: "));
Serial.write(incomingByte);
Serial.println();
}
if (incomingByte==115){
ShowStatus();
}

If I Connect my arduino to the serial or usb port on my computer, it works fine. If I send any character it will print that character back to the Serial port and if I type an "s" (asc 115), it will take the action required.

Now if I remove the serial or USB adaptor and connect a bluetooth module, BluetoothTerminal will connect to that and I do see output on my phone from some other Serial.print statements i make in the program, but there is no reaction to any character I send from the BluetoothTerminal. The Serial port is set to 9600baud.

I checked my connections and those look fine.

Anybody can give me some pointers on how to tackle this?

and if I type an "s" (asc 115), it will take the action required.

So, why doesn't your code reflect that. Why should one need to consult an ASCII table to figure out what to type?

if (incomingByte == 's')
{

See, they don't really need to.

Anybody can give me some pointers on how to tackle this?

Post ALL of your code. Post a schematic. Post a picture of your actual setup. An out-of-focus, tiny, poorly lit picture, with wires, all the same color, all tangled up is fine. (Well, not really.)

If you are having trouble receiving serial data try one of the examples in serial input basics.

And, as @PaulS suggested, post a schematic showing all the connections. A photo of a pencil drawing is usually the best.

...R

PaulS:
So, why doesn't your code reflect that. Why should one need to consult an ASCII table to figure out what to type?

if (incomingByte == 's')

{



See, they don't really need to.
Post ALL of your code. Post a schematic. Post a picture of your actual setup. An out-of-focus, tiny, poorly lit picture, with wires, all the same color, all tangled up is fine. (Well, not really.)

My code does reflect that:
if (incomingByte==115){

and if you read on I said that the "s" was '115' So, no need to consult the ascii table, just to read my message properly.

I dont think putting my entire code here adds anything as the majority of the code has nothing to do with the bluetooth input.
The same for publishing my circuit, it is just a bluetooth module connected to the FTDI, what difference does it make that there is an RTC and a transmitter attached to it.
Also, I said it is working fine on the normal serial port.

I appreciate any attempt of people to help me but before you bite my head off, please read the info in the question

I dont think putting my entire code here adds anything as the majority of the code has nothing to do with the bluetooth input.

You are in the minority, but I respect your right to not post your code.

The same for publishing my circuit, it is just a bluetooth module connected to the FTDI, what difference does it make that there is an RTC and a transmitter attached to it.

Maybe it does; maybe it doesn't. As to how the bluetooth module is connected to the FTDI, in the absence of a schematic, I'll assume duct tape.

Also, I said it is working fine on the normal serial port.

I'm not sure what this means. Looking at a schematic, I'd be sure.

Anyway, good luck solving your problem.

Robin2:
If you are having trouble receiving serial data try one of the examples in serial input basics.

And, as @PaulS suggested, post a schematic showing all the connections. A photo of a pencil drawing is usually the best.

...R

Thank you,
I think Paul suggested a bit more, but the drawing would just show a bluetoothmodule properly connected to the Tx/Rx pins of the Atmegachip. There is no problem including that, and I would have in any other case but it seems very superfluous . It is just Vcc to Vcc, Grnd to grnd Tx to Rx, Rx to Tx
I havent accidentally switched Tx and Rx and as my original question shows the Bluetooth module receiving, but I have attached a drawing. https://drive.google.com/file/d/0B7z0rHYydpXncUdiRWREVFlNcDQ/view?usp=sharing
I have tried the examples, that showed the same behaviour (no reaction to input). That doesnt really surprise me as it is the same code as I use, but it is good to know that the rest of my program doesnt cause the problem.
Checked connections again, especially the Tx (bluetooth) to Rx (Atmega), is OK.

As the small code in the examples is having the same behaviour as my program, I dont think my program is of importance in fault finding, other than that maybe bluetooth needs a different approach than the serial port.
I would suspect my bluetooth module, but that has always worked fine

PaulS:
You are in the minority, but I respect your right to not post your code.
Maybe it does; maybe it doesn't. As to how the bluetooth module is connected to the FTDI, in the absence of a schematic, I'll assume duct tape.
I'm not sure what this means. Looking at a schematic, I'd be sure.

Anyway, good luck solving your problem.

Well I dont want to make it a debate, but as I followed the suggestion to try some examples, who had the same behaviour, it isnt my code.
I do not regularly duct tape components together and expect a good electrical connection. As I said in my original question, the terminal could connect to the bluetooth module, it wouldnt if the connection was wrong.

It isnt that I want to keep my code secret, but I didnt see the relevance and wanted to spare people from having to go through say 800 lines of code, where in fact only the serial connection was of importance. That I was right is supported by the fact that the examples did the same.
And really, I see snippets of code posted all over.

I am grateful for anybody taking the trouble to answer, I just tried to be effective in what I thought was important and what was superfluous

Ed1960:
but the drawing would just show a bluetoothmodule properly connected

Do you want help or a debate ?

Post your complete code and your drawing. Make sure the drawing shows what you have actually done rather than what you would have liked to have done.

...R

Robin2:
Do you want help or a debate ?

Post your complete code and your drawing. Make sure the drawing shows what you have actually done rather than what you would have liked to have done.

...R

I posted the circuit.
I am not here for a debate, i was merely explaining why posting the entire code wouldnt add anything.
Anyway:
This code:
char receivedChar;
boolean newData = false;

void setup() {
Serial.begin(9600);
Serial.println("");
}

void loop() {
recvOneChar();
showNewData();
}

void recvOneChar() {
if (Serial.available() > 0) {
receivedChar = Serial.read();
newData = true;
}
}

void showNewData() {
if (newData == true) {
Serial.print("This just in ... ");
Serial.println(receivedChar);
newData = false;
}
}
Does not work. It prints the . but does not react to input.

I posted the circuit earlier already:
and just did again, but aparently it doesnt show up: https://drive.google.com/file/d/0B7z0rHYydpXncUdiRWREVFlNcDQ/view?usp=sharing

Ed1960:
Does not work. It prints the . but does not react to input.

You seem to be connecting your Bluetooth module to Pins 0 and 1 (Arduino terminology) which are the pins used to communicate with the Serial Monitor.

Try using SoftwareSerial and a different pair of pins for connecting to the Bluetooth module.

...R
PS you can add a JPG image as an attachment.
PPS - please use the code button </> for your code

How are you reading the output ? Try connecting the the blue tooth tx to the tx that is connecting to what ever you are using for the readout, which may make a direct path to the readout device.

I use Bluetooth for my Arduino projects (HC and HM modules), and communicate with Windows and Android with no problems with the Serial RX and TX pins, and different flavors of Software Serial. I would first try using your module with a different device and different app. You obviously have it connected correctly. Do you have a Windows PC with a Bluetooth adapter in it or a USB adapter? Most off the shelf Bluetooth stacks support software serial ports. If so, you can also test your module by connecting the BT adapter to your USB to serial/ttl adapter on one USB port, and have it talk to your PC's BTadapter's serial port, and test by opening two serial monitoring sessions on the port of each.

Robin2:
You seem to be connecting your Bluetooth module to Pins 0 and 1 (Arduino terminology) which are the pins used to communicate with the Serial Monitor.

Try using SoftwareSerial and a different pair of pins for connecting to the Bluetooth module.

...R
PS you can add a JPG image as an attachment.
PPS - please use the code button </> for your code

Thanks for your suggestion. I already solved the problem. Reinstall bluetoothmonitor.
I used the Tx and Rx because that seems the most opportune: as I dont use the serial monitor when the device is in operation.
I did try adding the picrure as attachment, but anything between the 'img' and '/img' tags just didnt show up

zoomkat:
How are you reading the output ? Try connecting the the blue tooth tx to the tx that is connecting to what ever you are using for the readout, which may make a direct path to the readout device.

I am reading that over Bluetooth with the Bluetooth terminal on my android. Reception is fine, it was the transmission that didnt work. Reinstall of Bluetooth monitor did the trick.
For my device I need to connect Tx to Rx and vice versa
Thanks for yr reply

Thanks for your links Runaway Pancake, I solved the problem by a reinstall of bluetooth terminal on my android phone, but your links are certainly interesting for anybody else experiencing problems