iotappstory/ESP-Library

Device name on config page not reflected in IAS::readConfig(configStruct)

Opened this issue · 1 comments

After device set-up, the device name I entered during set-up is reflected in the config mode status page. IOTAppStory::readConfig(configStruct &config) returns a structure with deviceName set to the default "yourESP."

Example snippet:

configStruct IASConfig;
IAS.readConfig(IASConfig);
char topicBuffer[64];
sprintf_P(topicBuffer, PSTR("%s"), IASConfig.deviceName);
Serial.print(topicBuffer);

This code will print "yourESP", yet the Device Name on the config status page will show "Truck-Cab" (the name set during the initial device set-up).

My immediate goal is to use, in my code, the device name that I assigned on initial device setup

  1. Can I access that information for use in my code?
  2. Can the configuration mode be modified to allow editing of the assigned device name?
  3. Should the writeConfig method be storing the device name assigned at initial set-up?

I'm happy to make any necessary modifications to the IAS code, but I've been going through it for the last several hours, and can't find where the device name entered during set-up is stored, or where I could access that information to store it using the writeConfig method, or where I can modify the configuration pages. Any help, pointers, or direction would be appreciated.

Hi @QuantusHoka,
it's been quite some time since you started this issue, my apologies btw, are you still in to help figure this out?