• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP32 Sending Chip ID

Q&A Forum › ESP32 Sending Chip ID
0 Vote Up Vote Down
derick asked 3 years ago

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);
1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 years ago

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

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2023 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.