diff --git a/voltha/adapters/openolt/openolt_device.py b/voltha/adapters/openolt/openolt_device.py
index 0672037..928d1aa 100644
--- a/voltha/adapters/openolt/openolt_device.py
+++ b/voltha/adapters/openolt/openolt_device.py
@@ -14,7 +14,6 @@
 # limitations under the License.
 #
 import binascii
-import grpc
 import structlog
 import time
 from scapy.layers.l2 import Ether, Dot1Q
@@ -59,7 +58,8 @@
         {'trigger': 'go_state_connected',
          'source': 'state_init',
          'dest': 'state_connected',
-         'before': 'do_state_connected'},
+         'before': 'do_state_connected',
+         'after': 'post_connected'},
         {'trigger': 'go_state_up',
          'source': ['state_connected', 'state_down'],
          'dest': 'state_up',
@@ -119,11 +119,13 @@
 
     def post_init(self, event):
         self.log.debug('post_init')
-        # Initialize gRPC
+
+        # FIXME
         time.sleep(10)
+
         self._grpc = OpenoltGrpc(self.host_and_port, self)
 
-        self.log.info('openolt-device-created')
+        reactor.callInThread(self.get_device_info)
 
     def do_state_connected(self, event):
         self.log.debug("do_state_connected")
@@ -156,6 +158,9 @@
         self.stats_mgr = self.stats_mgr_class(self, self.log, self.platform,
                                               self.data_model)
 
+    def post_connected(self, event):
+        self._grpc.start()
+
     def do_state_up(self, event):
         self.log.debug("do_state_up")
         self.data_model.olt_oper_up()
@@ -451,3 +456,32 @@
 
     def simulate_alarm(self, alarm):
         self.alarm_mgr.simulate_alarm(alarm)
+
+    def get_device_info(self):
+        self.log.debug('get_device_info')
+        timeout = 60*60
+        delay = 1
+        exponential_back_off = False
+        while True:
+            try:
+                self.device_info \
+                    = self._grpc.stub.GetDeviceInfo(openolt_pb2.Empty())
+                break
+            except Exception as e:
+                if delay > timeout:
+                    self.log.error("openolt grpc timed out connecting to olt")
+                    return
+                else:
+                    self.log.warn(
+                        "openolt grpc retry connecting to olt in %ds: %s"
+                        % (delay, repr(e)))
+                    time.sleep(delay)
+                    if exponential_back_off:
+                        delay += delay
+                    else:
+                        delay += 1
+
+        self.log.info('openolt grpc connected to olt',
+                      device_info=self.device_info)
+
+        self.go_state_connected()
diff --git a/voltha/adapters/openolt/openolt_grpc.py b/voltha/adapters/openolt/openolt_grpc.py
index 726270b..e1299db 100644
--- a/voltha/adapters/openolt/openolt_grpc.py
+++ b/voltha/adapters/openolt/openolt_grpc.py
@@ -17,7 +17,6 @@
 import structlog
 import grpc
 import threading
-import time
 from twisted.internet import reactor
 from voltha.northbound.kafka.kafka_proxy import kafka_send_pb
 from voltha.adapters.openolt.protos import openolt_pb2_grpc, openolt_pb2
@@ -32,7 +31,9 @@
         self.host_and_port = host_and_port
         self.channel = grpc.insecure_channel(self.host_and_port)
         self.channel_ready_future = grpc.channel_ready_future(self.channel)
+        self.stub = openolt_pb2_grpc.OpenoltStub(self.channel)
 
+    def start(self):
         try:
             # Start indications thread
             self.log.debug('openolt grpc starting')
@@ -51,37 +52,6 @@
 
     def indications_thread(self):
 
-        self.log.debug('openolt grpc connecting to olt')
-
-        self.stub = openolt_pb2_grpc.OpenoltStub(self.channel)
-
-        timeout = 60*60
-        delay = 1
-        exponential_back_off = False
-        while True:
-            try:
-                self.device.device_info \
-                    = self.stub.GetDeviceInfo(openolt_pb2.Empty())
-                break
-            except Exception as e:
-                if delay > timeout:
-                    self.log.error("openolt grpc timed out connecting to olt")
-                    return
-                else:
-                    self.log.warn(
-                        "openolt grpc retry connecting to olt in %ds: %s"
-                        % (delay, repr(e)))
-                    time.sleep(delay)
-                    if exponential_back_off:
-                        delay += delay
-                    else:
-                        delay += 1
-
-        self.log.info('openolt grpc connected to olt',
-                      device_info=self.device.device_info)
-
-        self.device.go_state_connected()
-
         self.indications = self.stub.EnableIndication(openolt_pb2.Empty())
 
         while True:
