Converting string/char to IPAddress ip()

Hi,

I just cannot get to convert an IP stored as a string to IPAddress ip().

Any help is appreciated.

//ee_ip format "123,123,123,123"
//from APmode web form
const char* mysid;
const char* mypass;

//from eeprom
String ee_sid, ee_pass, ee_ip, ee_router;

IPAddress ip(ee_ip);

void setup() {
  mysid = ee_sid.c_str();
  mypass = ee_pass.c_str();


}

void loop() {
  // put your main code here, to run repeatedly:

}
[code]

I just cannot get to convert an IP stored as a string to IPAddress ip().

You don't appear to have an IP address stored as a String. Nor should you. An IP address is 4 bytes. Store the data as 4 bytes.

If you are getting the data, as characters, from somewhere, post the code that does that. Do NOT use a String to collect the characters. You know (or should) how many characters are involved (a max of 15) so you can size you character array appropriately. You know, or should, when the first character is read, so you can store the data in the array, in the appropriate place.

strtok() and atoi() look useful.

thank you. Will use byte myIP[15];

byte myIP[4] will just do :wink: As long as you don't store it as ASCII.