   ts.writeRegistration(header, reg);
   client.subscribe(registration.topic);
   for (int i = 0; i < ; i++) {
-    char[TOPIC_LENGTH] topic;
+    char[TOPIC_LENGTH + LCOMMAND + 1] topic;
+    char command[LCOMMAND] = {0};
+    for (i = 0; i < LCOMMAND; i++) {
+      strcpy_P(command, commands[i]);
+    }
     strcpy(topic, registration.topic);
-    strcat(topic, commands[i]);
+    strcat(topic, "/");
+    strcat(topic, command);
     client.subscribe(topic);
   } else {
     Serial.println(F("Unable to register, out of space"));


const uint8_t HEADER = sizeof(RadioHeader);

const PROGMEM char commands[][9] = {
  { "state" },
  { "set" },
  { "timestamp" },
}

// Values stored as 2 nibbles.  First nibble is the nodeid, second 
// nibble is the sensorid.  NodeId 15 (F) is reserved (gateway).  
// TODO possible expansion to uint16_t to support many more nodes and sensors

RFM69 radio;
EthernetClient ethClient;

#include "topicStorage.h"
#include "controls.h"

#define LCOMMAND 10

uint8_t mac[] = {  0xDE, 0xED, 0xBA, 0xFE, 0xFE, 0xED }; // get real mac
uint8_t server[] = { 192, 168, 0, 1 };
