iotappstory / ESP-Library

Software Distribution and Management Over the Air
GNU Lesser General Public License v2.1
124 stars 35 forks source link

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

Open QuantusHoka opened 5 years ago

QuantusHoka commented 5 years ago

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.

Onno-Dirkzwager commented 4 years ago

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?