   {
     if (token == READ_TOKEN)
     {
-      DEBUG_PRINT(2, "Read token received\n");
-      int packetSize = udp4readCmnds.parsePacket();
+      DEBUG_PRINT(3, "Read token received from nibe\n");
+      int packetSize = udp.parsePacket();
       if (packetSize) {
-        len = udp4readCmnds.read(data, packetSize);
+        len = udp.read(data, packetSize);
+        DEBUG_PRINTDATA(2, "Send read command to nibe, len=%d, ", len);
+        DEBUG_PRINT(1, " data in: ");
+        DEBUG_PRINTARRAY(1, data, len)
+        DEBUG_PRINT(1, "\n");
 #ifdef TRANSPORT_ETH_ENC28J60
-        udp4readCmnds.flush();
-        udp4readCmnds.stop();
-        udp4readCmnds.begin(INCOMING_PORT_READCMDS);
+        udp.flush();
+        udp.stop();
+        udp.begin(INCOMING_PORT_READCMDS);
 #endif
       }
     }
     else if (token == WRITE_TOKEN)
     {
-      DEBUG_PRINT(2, "Write token received\n");
+      DEBUG_PRINT(3, "Write token received from nibe\n");
       int packetSize = udp4writeCmnds.parsePacket();
       if (packetSize) {
         len = udp4writeCmnds.read(data, packetSize);
+        DEBUG_PRINTDATA(2, "Send write command to nibe, len=%d, ", len);
+        DEBUG_PRINT(1, " data in: ");
+        DEBUG_PRINTARRAY(1, data, len)
+        DEBUG_PRINT(1, "\n");
 #ifdef TRANSPORT_ETH_ENC28J60
         udp4writeCmnds.flush();
         udp4writeCmnds.stop();


void sendUdpPacket(const byte * const data, int len)
{
  DEBUG_PRINTDATA(2, "Sending UDP packet, len=%d\n", len);
  DEBUG_PRINTARRAY(2, data, len)
  DEBUG_PRINT(2, "\n");

  udp.beginPacket(targetIp, TARGET_PORT);
  udp.write(data, len);
  udp.endPacket();
}

#define DEBUG_BUFFER_SIZE       80

#ifdef ENABLE_DEBUG
 #define DEBUG_PRINT(level, message) if (verbose >= level) { debugPrint(message); }
 #define DEBUG_PRINTDATA(level, message, data) if (verbose >= level) { sprintf(debugBuf, message, data); debugPrint(debugBuf); }
 #define DEBUG_PRINTARRAY(level, data, len) if (verbose >= level) { for (int i = 0; i < len; i++) { sprintf(debugBuf, "%02X", data[i]); debugPrint(debugBuf); }}
#else
 #define DEBUG_PRINT(level, message)
 #define DEBUG_PRINTDATA(level, message, data)
 #define DEBUG_PRINTARRAY(level, data, len)
#endif

#ifdef ENABLE_DEBUG
