I have a text file on a micro SD containing the following lines.
[IPADDR=172.22.0.230] [IPMASK=255.255.255.0] [IPGWAY=172.22.0.254] [IPDNS=172.22.0.254]
I can read the lines from the txt file and end up with 4 String variables as follows
ipaddr = "172.22.0.230" mask = "255.255.255.0 gateway = "172.22.0.254" dns = "172.22.0.254"
I am trying to use these values to configure the IP settings on an ESP8266 Wemos D1 mini.
The Wemos device library expects each of these settings to be passed in the form of an array where each octet within the string occupies a line in the array. I believe it requires an integer array for example the IP address would be IP = 172, IP = 22, IP = 0, IP = 230
I have exhausted my programming knowledge in converting the text string 'ipaddr' = "172.22.0.230" into the integer array and my program fails with the error message:
cannot convert 'String' to 'const char*' for argument '1' to 'int atoi(const char*)'
Could someone provide me with a sketch that could do the conversion.