 
   for (byte port = 0; port <= 0xf; port++) {
     uint16_t portByte = ~(1 << port);
-    //  debug("Checking port ");
-    //  debugln(port);
-    //  debug("portByte ");
-    //  debugln2(portByte, HEX);
-    // set all echos high
+    uint16_t echoByte = 0xffff;
+    debug("Checking port ");
+    debugln(port);
+    debug("portByte ");
+    debugln2(portByte, HEX);
     // set all echos high
     Wire.beginTransmission(JIGADDR_E);
-    Wire.write(0xff);
-    Wire.write(0xff);
+    Wire.write((uint8_t)(echoByte & 0xff));
+    Wire.write((uint8_t)((echoByte >> 8) & 0xff));
     error = Wire.endTransmission(true);
+    if ( error ) {
+      Serial.print("Failed to write to jig E  = ");
+      Serial.println(error);
+      digitalWrite(RED_LED, ON);
+      return;
+    }
 
     // enable the port
 
     Wire.beginTransmission(OCTO_ADDR);
+    Wire.write((uint8_t)(portByte & 0xff));
     Wire.write((uint8_t)((portByte >> 8) & 0xff));
-    Wire.write((uint8_t)(portByte & 0xff));
     error = Wire.endTransmission(true);
     if ( error ) {
       Serial.print("Failed to write to OctoSonar error = ");

      digitalWrite(RED_LED, ON);
      return;
    }
    //  debug("sent portByte ");
    //  debugln2(portByte, HEX);
    //read them back
    Wire.requestFrom(JIGADDR_T, 2);
    if (Wire.available() != 2) {

  byte error = 1;
  // keep last status 5s before start again
  delay(5000);
  digitalWrite(GREEN_LED, OFF);
  digitalWrite(RED_LED, OFF);
  Serial.println("Looking for OctoSonar");
  while (error != 0) {
