I am trying to send data from my Temperature sensor on an Arduino to the Serial Bluetooth Terminal app on my Android. I am able to print out the data on the Serial Monitor on the Arduino IDE but I cannot send it to the App on my phone. In fact, none of the devices I click are able to connect and results in “Connection failed: read failed, socket might closed or timeout, read ret: -1” or “gatt status133” or “no serial profile found -> use long click on device to define a custom profile”. Please see my code attached and let me know if I did something wrong.
I really appreciate your help!
#include <OneWire.h>
#include <DallasTemperature.h>
#include <SoftwareSerial.h>
#define ONE_WIRE_BUS 8
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
float Celsius = 0;
float Fahrenheit = 0;
SoftwareSerial BT(2,3);
void setup() {
sensors.begin();
Serial.begin(9600);
BT.begin(9600);
BT.println(“Hello from Arduino!”);
}
void loop() {
sensors.requestTemperatures();
Celsius = sensors.getTempCByIndex(0);
Fahrenheit = sensors.toFahrenheit(Celsius);
Serial.print(Celsius);
Serial.print(” C “);
Serial.print(Fahrenheit);
Serial.println(” F”);
delay(1000);
if(BT.available()) {
BT.print(“The temperature level in F is: “);
BT.println(Fahrenheit);
BT.print(“The temperature level in C is: “);
BT.println(Celsius);
delay(1000);
}
}
Please login or Register to submit your answer
Staff replied 3 years ago
Hello Salena,
1. Can you explain where is the simpleRTK2B connected?
2. Which bluetooth are you using?
Staff replied 2 years ago
Closed because no answer.
Staff replied 2 years ago
Closed because no answer.