Skip to content

Commit a62d535

Browse files
committed
samples: cellular: lwm2m_client: Support Thingy91X on provisioning script
Provisioning script is searching for connected COM ports, but only filtered DK boards. Signed-off-by: Seppo Takalo <[email protected]>
1 parent f4e470d commit a62d535

File tree

1 file changed

+5
-2
lines changed
  • samples/cellular/lwm2m_client/scripts

1 file changed

+5
-2
lines changed

samples/cellular/lwm2m_client/scripts/device.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from serial.tools.list_ports import comports
1919

2020
NRF91_VID = 4966
21+
THINGY91_VID = 6421
2122
SEGGER_HEADER_9161 = "10"
2223

2324
class Device:
@@ -110,7 +111,7 @@ def store_psk(self, tag, identity, psk):
110111
logging.info('PSK credentials stored to sec_tag %d', int(tag))
111112

112113
def select_device(self):
113-
sids = self.get_devices(NRF91_VID)
114+
sids = self.get_devices(NRF91_VID) + self.get_devices(THINGY91_VID)
114115

115116
# No connected devices, abort
116117
if len(sids) == 0:
@@ -149,7 +150,9 @@ def get_devices(cls, vid):
149150
def get_com_ports(cls, sid):
150151
com_ports = []
151152
for item in comports():
152-
if item.manufacturer == "SEGGER" and item.serial_number.lstrip("0") == sid:
153+
manufacturer_match = item.manufacturer in ('SEGGER', 'Nordic Semiconductor')
154+
serial_match = item.serial_number.lstrip("0") == sid
155+
if manufacturer_match and serial_match:
153156
com_ports.append(item.device)
154157
# Sort com ports on their integer identifiers, which takes care of corner case
155158
# where we have a cross-over from N digit to N + 1 digit identifiers

0 commit comments

Comments
 (0)