From 22686d6fe9d13285775abd0e62c2d9d85b64fc72 Mon Sep 17 00:00:00 2001 From: Denny Page Date: Fri, 4 Nov 2011 22:25:55 +0100 Subject: [PATCH] Add a delay between sending the init and version command. Some devices are having problems during the initialization sequence. The extra delay appears to improve the success rate for the affected devices. There is obviously a small performance penalty, but being able to establish a reliable connection with all devices is more important. --- src/oceanic_atom2.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/oceanic_atom2.c b/src/oceanic_atom2.c index 8465eef..0650a2b 100644 --- a/src/oceanic_atom2.c +++ b/src/oceanic_atom2.c @@ -262,6 +262,9 @@ oceanic_atom2_init (oceanic_atom2_device_t *device) if (rc != DEVICE_STATUS_SUCCESS) return rc; + // Wait before sending the next command. + serial_sleep (1000); + // Discard all additional bytes (if there are any) serial_flush (device->port, SERIAL_QUEUE_INPUT);