Hello.
I am using your BLE client server example as a base to learn more and now i want to do something else. In you example you read the temperature from the ESP32 to the client. I want to see if i can now read the Chip ID to the client. when i insert chipid variable into dtostrf as below I get a long number that has not relation to the chip ID.
Please give me some advice:
chipid = ESP.getEfuseMac(); char txString[64]; //[8] dtostrf(chipid, 1, 2, txString);// float_val, min_width, digits_after_decimal, char_buffer // Set new characteristic value pCharacteristic->setValue( txString);//txString // Send the value to the Android application pCharacteristic->notify(); Serial.print(“Sent value: “); Serial.println(txString);
Hi Derick.
That may be happening because the Chip ID is not properly formatted?
Take a look at this discussion and see if this helps to solve your problem: https://arduino.stackexchange.com/questions/58677/get-esp32-chip-id-into-a-string-variable-arduino-c-newbie-here
They suggest using the snprintf() function: http://www.cplusplus.com/reference/cstdio/snprintf/
Let me know if this helps.
Regards,
Sara