diff --git a/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/MySensorsBindingConstants.java b/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/MySensorsBindingConstants.java index a452ce9806db6..fed9796a9b449 100644 --- a/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/MySensorsBindingConstants.java +++ b/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/MySensorsBindingConstants.java @@ -202,7 +202,7 @@ public class MySensorsBindingConstants { public final static String CHANNEL_LAST_UPDATE = "lastupdate"; // Wait time Arduino reset - public final static int RESET_TIME = 5000; + public final static int RESET_TIME = 3000; public final static Map CHANNEL_MAP = new HashMap() { /** diff --git a/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/internal/MySensorsBridgeConnection.java b/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/internal/MySensorsBridgeConnection.java index a9b2f1db9f8ba..fabf582684a39 100644 --- a/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/internal/MySensorsBridgeConnection.java +++ b/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/internal/MySensorsBridgeConnection.java @@ -24,6 +24,8 @@ public abstract class MySensorsBridgeConnection { private Logger logger = LoggerFactory.getLogger(MySensorsBridgeConnection.class); + private static final MySensorsMessage I_VERSION_MESSAGE = new MySensorsMessage(0, 0, 3, 0, false, 2, ""); + public List updateListeners; public boolean pauseWriter = false; @@ -73,6 +75,7 @@ protected boolean startReaderWriterThread(MySensorsReader reader, MySensorsWrite int i = 0; synchronized (this) { while (!iVersionResponse && i < 5) { + addMySensorsOutboundMessage(I_VERSION_MESSAGE); waitingObj = this; waitingObj.wait(1000); i++; diff --git a/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/protocol/MySensorsWriter.java b/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/protocol/MySensorsWriter.java index 15e8b0ff90c60..8ac995344a15c 100644 --- a/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/protocol/MySensorsWriter.java +++ b/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/protocol/MySensorsWriter.java @@ -35,15 +35,10 @@ public abstract class MySensorsWriter implements MySensorsUpdateListener, Runnab protected ExecutorService executor = Executors.newSingleThreadExecutor(); protected Future future = null; - private static final MySensorsMessage I_VERSION_MESSAGE = new MySensorsMessage(0, 0, 3, 0, false, 2, ""); - protected int sendDelay = 1000; public void startWriter() { future = executor.submit(this); - - // Send the I_VERSION message - mysCon.addMySensorsOutboundMessage(I_VERSION_MESSAGE); } @Override diff --git a/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/protocol/serial/MySensorsSerialConnection.java b/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/protocol/serial/MySensorsSerialConnection.java index 8975b1b9ec24a..9f233506fd9a9 100644 --- a/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/protocol/serial/MySensorsSerialConnection.java +++ b/addons/binding/org.openhab.binding.mysensors/src/main/java/org/openhab/binding/mysensors/protocol/serial/MySensorsSerialConnection.java @@ -31,7 +31,8 @@ public class MySensorsSerialConnection extends MySensorsBridgeConnection { private String serialPort = ""; private int baudRate = 115200; - public int sendDelay = 0; + private int sendDelay = 0; + private boolean skipStartupCheck = false; private NRSerialPort serialConnection = null; @@ -44,6 +45,7 @@ public MySensorsSerialConnection(String serialPort, int baudRate, int sendDelay, this.serialPort = serialPort; this.baudRate = baudRate; this.sendDelay = sendDelay; + this.skipStartupCheck = skipStartupCheck; }