Skip to content

Commit

Permalink
Add chip UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
felipengeletrica committed May 10, 2024
1 parent d7a3e81 commit 2e3afe2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions examples/esp32-JSON/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
platform = espressif32
board = wemos_d1_mini32
framework = arduino
upload_resetmethod = nodemcu
upload_speed = 115200
monitor_speed = 115200

lib_deps =
Expand Down
8 changes: 6 additions & 2 deletions examples/esp32-JSON/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

/* CONSTANTS */
#define BUFFER_JSON 2048
#define UUID \
String((uint32_t)ESP.getEfuseMac()) + \
String((uint32_t)(ESP.getEfuseMac() >> 32))
#define DEVICE_ID String("DEVICE_SAMPLE")
/* VARIABLES */
uint64_t uptime = 0;

Expand All @@ -25,8 +29,8 @@ void loop() {
DynamicJsonDocument doc(BUFFER_JSON);

// Fill JSON object with data
doc["device_id"] = "device_id_value";
doc["serial"] = "serial_number";
doc["device_id"] = DEVICE_ID;
doc["serial"] = UUID;
doc["protocol_id"] = "0.1.0";
doc["hw_ver"] = "hardware_version";
doc["fw_ver"] = "firmware_version";
Expand Down

0 comments on commit 2e3afe2

Please sign in to comment.