Spurious bled112 device adapter error on asyncio
- Dominant language
- Python
- Stars
- 14
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
Using virtual_device to serve bled112 access, I connected from a remote host. After "quitting", it seems to identify that the connection dropped, but when reconnecting there is an error message suggesting that the adapter didn't fully disconnect. The connection does get made successfully, though, and the conn_id increments properly:
```
19-04-30 21:14:41.632 DEB iotile_transport_bled112.server_bled112 Received disconnect event
19-04-30 21:14:41.633 DEB iotile_transport_bled112.server_bled112 Reenabling advertisements after disconnection
19-04-30 21:14:53.734 DEB iotile_transport_bled112.server_bled112 Received connect event
19-04-30 21:14:53.735 ERR asyncio Task exception was never retrieved
future: exception=DeviceAdapterError()>
Traceback (most recent call last):
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/home/pi/coretools/transport_plugins/bled112/iotile_transport_bled112/server_bled112.py", line 245, in on_connect
await self.connect(self.CLIENT_ID, str(self.device.iotile_id))
File "/home/pi/coretools/iotilecore/iotile/core/hw/transport/server/standard.py", line 262, in connect
await self.adapter.connect(conn_id, conn_string)
File "/home/pi/coretools/iotilecore/iotile/core/hw/transport/virtualadapter.py", line 235, in connect
raise DeviceAdapterError(conn_id, 'connect', 'device already connected')
iotile.core.hw.exceptions.DeviceAdapterError: DeviceAdapterError: Operation connect on conn 3 failed because device already connected
Additional Information:
conn_id: 3
reason: device already connected
operation: connect
19-04-30 21:14:54.203 DEB iotile_transport_bled112.server_bled112 Opening rpc interface
```
Contributor guide
Assessment
This issue has not been assessed yet.