Can't receive String from my Bluno device

Hi all,

I am trying to build an app to communicate with my Bluno.
I can transmit Strings without any problems, but when I try to receive Strings, it shows me the last value I transmitted.
Attaching my blocks:

Here is the relevant part of my code:

#include <SoftwareSerial.h>
SoftwareSerial BTserial(0, 1); // RX, TX

void setup() {
    Serial.begin(9600);
    BTserial.begin(9600);
    temp.begin();
}

void loop() {
    Serial.println("Please insert the number of what you would like to do:"); //Prompt User for Input
    Serial.println("1) Calibrations");
    Serial.println("2) Measurments");
    Serial.println("3) Measure all");
    Serial.println();
    userinput = UserInput();
....
else if (userinput.equals("3")) { // User is looking to measure all in at once
        Serial.println("Starting to measure");
        Serial.println();
        // Temperature ,^C
        userinput = UserInput();
        Serial.println("Temp:");
        Serial.println();
        temperature = temp.readTemperature();
        delay(5000);
        char strFloat[8];
        dtostrf(temperature, 2, 2, strFloat);
        Serial.write(strFloat, strlen(strFloat));
        BTserial.write(strFloat, strlen(strFloat));
        }
}

// Function to read the user's input
char UserInput() {
    while (BTserial.available() == 0) {}
    char input = BTserial.read();
    Serial.println(input);
    return input;
}

I guess that my Arduino code is not writing to the characteristic UUID?
Any ideas on what can I do?

Have you connected to your device using LightBlue yet? I’d imagine your device trasmita data over the notify channel instead of the write characteristic. Thunkable apps as of this time are unable to listen for data on a notify channel for ble devices.

Thanks for your comment!

I have tried connecting with LightBlue, but I couldn’t read the temperature from there either. That’s why I suspect my problem is in the Arduino code…

Fwiw, i did a quick google of that devices ble chip CC2540 Vs the hm10 (I own 2 of these )

Seems they are the same device basically. If this is true, I’ve been in contact with the hm10 manufacturer and they have verified this device can’t write to or update the readable characteristic via the code. It only notifies.

1 Like