A while back @ScruffR did a really nice write up to add extra inputs to the softAP page, Photon SoftAP Inputs, however I am trying to change one of the outputs, namely for my purposes the device-id to our product serial number which consists of 6 hex digits.
My method described below is going to make some cringe, but it’s the only way I got it to work, I’m looking to learn a much more elegant way and one that uses less RAM space.
I have successfully done this by changing index_html from a const char to char, and this portion in index_html,
<input type=text id=‘device-id’ size=‘25’ value=’’ disabled
<input type=text id=‘mydevice-id’ size=‘25’ value=‘FFFFFF’ disabled
I then use strstr and strcpy to insert our serial number where “FFFFFF” is. Since mydevice-id doesnt exist the text field shows the default value which is our serial number.
Although it works, changing index_html from const char to char uses 1.2k of precious RAM.
Is there a way to accomplish this without having to change index_html to a char and still have a dynamic serial number?
Hope this makes sense and thanks in advance for your help,