Skip to content

Commit fb0b226

Browse files
committed
Serial is_reachable fix
1 parent 2c99492 commit fb0b226

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ from upydevice.phantom import IMU_STREAMER
325325
imu_st = IMU_STREAMER(esp32, name='imu_st', init_soc=True)
326326
192.168.1.43 # (This prints host ip)
327327
328-
# SIMPLE SAMPLE (this use upydevice.cmd)
328+
# SIMPLE SAMPLE (this uses upydevice.cmd)
329329
imu_st.read_data()
330330
array('f', [-0.4462279975414276, -0.12023930251598358, -0.9497069716453552])
331331
imu_st.setup_mode('gyro')

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)
66

77
## [0.2.3] [Github repo]
8+
### Fix
9+
- Serial device `is_reachable` method fix
10+
### Added
11+
- NEW BLE_DEVICE
812
## [0.2.2] - 2020-02-24
913
### Fix
1014
- WS_DEVICE cmd_nb fix for cmd method

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def readme():
1313

1414

1515
setup(name='upydevice',
16-
version='0.2.2',
16+
version='0.2.3',
1717
description='Python library to interface with wireless/serial MicroPython devices',
1818
long_description=readme(),
1919
long_description_content_type='text/markdown',
@@ -42,4 +42,4 @@ def readme():
4242
zip_safe=False,
4343
include_package_data=True,
4444
scripts=['upydevice_dir/bin/web_repl_conn'],
45-
install_requires=['upydev>=0.2.9', 'pyserial', 'dill', 'pexpect'])
45+
install_requires=['upydev>=0.3.1', 'pyserial', 'dill', 'pexpect'])

upydevice/upydevice.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import shlex
1010
import time
1111
import serial
12+
import serial.tools.list_ports
1213
import struct
1314
import socket
1415
import multiprocessing
@@ -2355,7 +2356,9 @@ def follow_output(self, inp, pipe=None, multiline=False, silent=False):
23552356
self.paste_cmd = ''
23562357

23572358
def is_reachable(self):
2358-
if self.serial.writable() and self.serial_port in glob.glob('/dev/*'):
2359+
portlist = [p.device for p in
2360+
serial.tools.list_ports.comports()] + glob.glob('/dev/*')
2361+
if self.serial.writable() and self.serial_port in portlist:
23592362
return True
23602363
else:
23612364
return False

0 commit comments

Comments
 (0)