Publish chipid to mqtt using ESP32-CAM
You would be better off formatting it nicely instead of relying on String...

char macValue[17]; // Don't forget one byte for the terminating NULL...
uint64_t mac = ESP.getEFuseMac();
sprintf(macValue, "%016x", mac);
client.publish("esp32/ChipID", macValue);


However, I'm not certain that sprintf can cope with a 64 bit value like that directly. If not, you can split it:

char macValue[17]; // Don't forget one byte for the terminating NULL...
uint64_t mac = ESP.getEFuseMac();
uint32_t hi = mac &gt;&gt; 32;
uint32_t lo = mac;
sprintf(macValue, "%08x%08x", hi, lo);
client.publish("esp32/ChipID", macValue);