   char *json = getDatastreams();
   // if there's a successful connection:
   DBG Serial.println("Connecting.");
-  if ((settings.feed != 0) && client.connect(HOST, PORT)) {
+  if ((settings.feed != 0) && client.connect(settings.host, settings.port)) {
     DBG Serial.println("connected.");
     DBG Serial.print("PUT /v2/feeds/");
     DBG Serial.println(settings.feed);

    strncpy(settings.apikey, inputBytes,49);
    settings.apikey[48] = '\0';
  }
  else if (cmd == 'R') {
    reset();
  }

  strcpy (settings.magic,MAGIC);
  settings.period = PERIOD;
  settings.feed = FEED;
  settings.host = HOST;
  settings.port = PORT;
  strcpy (settings.apikey,KEY);
}

void setup() {
