String to persistent memory (EEPROM?) I am creating a server node that I want to be able to save the wifi SSID and the password into persistent memory so that when it starts ups it can connect to the network. I have looked for several hours and found just a few bits of information. One bit I found here http://playground.arduino.cc/Code/EEPROMWriteAnything

#include &lt;EEPROM.h&gt;
#include &lt;Arduino.h&gt;  // for type definitions

template &lt;class T&gt; int EEPROM_writeAnything(int ee, const T&amp; value) {
    const byte* p = (const byte*)(const void*)&amp;value;
    unsigned int i;
    for (i = 0; i &lt; sizeof(value); i++)
          EEPROM.write(ee++, *p++);
    return i;
}

template &lt;class T&gt; int EEPROM_readAnything(int ee, T&amp; value) {
    byte* p = (byte*)(void*)&amp;value;
    unsigned int i;
    for (i = 0; i &lt; sizeof(value); i++)
          *p++ = EEPROM.read(ee++);
    return i;
}


This code will not store String values to the EEPROM. So as I thought I would ask for advice from the Stack Exchange geniuses.

Thanks!
EEPROM library has two functions put and get , which can help you store character array of any size, not exceeding the size of internal EEPROM size of Arduino. Please see the examples provided in the link above.

Here is a sample code to get you going.

int address = 10;
char arrayToStore[20];                    // Must be greater than the length of string.
String testString = "hello there";

testString.toCharArray(arrayToStore, testString.length()+1);  // Convert string to array.

EEPROM.put(address, arrayToStore);                 // To store data
EEPROM.get(address, arrayToStore);                 // To read data