mirror of
https://github.com/meshtastic/python.git
synced 2026-01-21 14:18:05 -05:00
Compare commits
3 Commits
1.3alpha.1
...
1.3alpha.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0ef62d1b3 | ||
|
|
02e8467fdd | ||
|
|
48e7f8c755 |
@@ -72,11 +72,11 @@ techo_1 = SupportedDevice(name="T-Echo", version="1", for_firmware="t-echo-1", d
|
|||||||
rak4631_5005 = SupportedDevice(name="RAK 4631 5005", version="", for_firmware="rak4631_5005",
|
rak4631_5005 = SupportedDevice(name="RAK 4631 5005", version="", for_firmware="rak4631_5005",
|
||||||
device_class="nrf52",
|
device_class="nrf52",
|
||||||
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
||||||
usb_vendor_id_in_hex="239a", usb_product_id_in_hex="8029")
|
usb_vendor_id_in_hex="239a", usb_product_id_in_hex="0029")
|
||||||
rak4631_5005_epaper = SupportedDevice(name="RAK 4631 5005 14000 epaper", version="", for_firmware="rak4631_5005_epaper",
|
rak4631_5005_epaper = SupportedDevice(name="RAK 4631 5005 14000 epaper", version="", for_firmware="rak4631_5005_epaper",
|
||||||
device_class="nrf52",
|
device_class="nrf52",
|
||||||
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
baseport_on_linux="ttyACM", baseport_on_mac="cu.usbmodem",
|
||||||
usb_vendor_id_in_hex="239a", usb_product_id_in_hex="8029")
|
usb_vendor_id_in_hex="239a", usb_product_id_in_hex="0029")
|
||||||
# Note: The 19003 reports same product id as 5005 in boot mode
|
# Note: The 19003 reports same product id as 5005 in boot mode
|
||||||
rak4631_19003 = SupportedDevice(name="RAK 4631 19003", version="", for_firmware="rak4631_19003",
|
rak4631_19003 = SupportedDevice(name="RAK 4631 19003", version="", for_firmware="rak4631_19003",
|
||||||
device_class="nrf52",
|
device_class="nrf52",
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ def camel_to_snake(a_string):
|
|||||||
|
|
||||||
|
|
||||||
def detect_supported_devices():
|
def detect_supported_devices():
|
||||||
"""detect supported devices"""
|
"""detect supported devices based on vendor id"""
|
||||||
system = platform.system()
|
system = platform.system()
|
||||||
#print(f'system:{system}')
|
#print(f'system:{system}')
|
||||||
|
|
||||||
@@ -285,19 +285,8 @@ def detect_supported_devices():
|
|||||||
if re.search(search, lsusb_output, re.MULTILINE):
|
if re.search(search, lsusb_output, re.MULTILINE):
|
||||||
#print(f'Found vendor id that matches')
|
#print(f'Found vendor id that matches')
|
||||||
devices = get_devices_with_vendor_id(vid)
|
devices = get_devices_with_vendor_id(vid)
|
||||||
# check device id
|
|
||||||
for device in devices:
|
for device in devices:
|
||||||
#print(f'device:{device} device.usb_product_id_in_hex:{device.usb_product_id_in_hex}')
|
possible_devices.add(device)
|
||||||
if device.usb_product_id_in_hex:
|
|
||||||
search = f' {vid}:{device.usb_product_id_in_hex} '
|
|
||||||
#print(f'search:"{search}"')
|
|
||||||
if re.search(search, lsusb_output, re.MULTILINE):
|
|
||||||
# concatenate the devices with vendor id to possibles
|
|
||||||
possible_devices.add(device)
|
|
||||||
else:
|
|
||||||
# if there is a supported device witout a product id, then it
|
|
||||||
# might be a match... so, concatenate
|
|
||||||
possible_devices.add(device)
|
|
||||||
|
|
||||||
elif system == "Windows":
|
elif system == "Windows":
|
||||||
# if windows, run Get-PnpDevice
|
# if windows, run Get-PnpDevice
|
||||||
@@ -313,22 +302,8 @@ def detect_supported_devices():
|
|||||||
if re.search(search, sp_output, re.MULTILINE):
|
if re.search(search, sp_output, re.MULTILINE):
|
||||||
#print(f'Found vendor id that matches')
|
#print(f'Found vendor id that matches')
|
||||||
devices = get_devices_with_vendor_id(vid)
|
devices = get_devices_with_vendor_id(vid)
|
||||||
# check device id
|
|
||||||
for device in devices:
|
for device in devices:
|
||||||
#print(f'device:{device} device.usb_product_id_in_hex:{device.usb_product_id_in_hex}')
|
possible_devices.add(device)
|
||||||
if device.usb_product_id_in_hex:
|
|
||||||
search = f'DeviceID.*{vid.upper()}&PID_{device.usb_product_id_in_hex.upper()}'
|
|
||||||
#print(f'search:"{search}"')
|
|
||||||
if re.search(search, sp_output, re.MULTILINE):
|
|
||||||
# concatenate the devices with vendor id to possibles
|
|
||||||
possible_devices.add(device)
|
|
||||||
# do a check to see if there is a Windows driver issue
|
|
||||||
if detect_windows_needs_driver(device, False):
|
|
||||||
print("WARNING: Need to install driver.")
|
|
||||||
else:
|
|
||||||
# if there is a supported device witout a product id, then it
|
|
||||||
# might be a match... so, concatenate
|
|
||||||
possible_devices.add(device)
|
|
||||||
|
|
||||||
elif system == "Darwin":
|
elif system == "Darwin":
|
||||||
# run: system_profiler SPUSBDataType
|
# run: system_profiler SPUSBDataType
|
||||||
@@ -343,19 +318,8 @@ def detect_supported_devices():
|
|||||||
if re.search(search, sp_output, re.MULTILINE):
|
if re.search(search, sp_output, re.MULTILINE):
|
||||||
#print(f'Found vendor id that matches')
|
#print(f'Found vendor id that matches')
|
||||||
devices = get_devices_with_vendor_id(vid)
|
devices = get_devices_with_vendor_id(vid)
|
||||||
# check device id
|
|
||||||
for device in devices:
|
for device in devices:
|
||||||
#print(f'device:{device} device.usb_product_id_in_hex:{device.usb_product_id_in_hex}')
|
possible_devices.add(device)
|
||||||
if device.usb_product_id_in_hex:
|
|
||||||
search = f'Product ID: 0x{device.usb_product_id_in_hex}'
|
|
||||||
#print(f'search:"{search}"')
|
|
||||||
if re.search(search, sp_output, re.MULTILINE):
|
|
||||||
# concatenate the devices with vendor id to possibles
|
|
||||||
possible_devices.add(device)
|
|
||||||
else:
|
|
||||||
# if there is a supported device witout a product id, then it
|
|
||||||
# might be a match... so, concatenate
|
|
||||||
possible_devices.add(device)
|
|
||||||
return possible_devices
|
return possible_devices
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -12,7 +12,7 @@ with open("README.md", "r") as fh:
|
|||||||
# This call to setup() does all the work
|
# This call to setup() does all the work
|
||||||
setup(
|
setup(
|
||||||
name="meshtastic",
|
name="meshtastic",
|
||||||
version="1.3alpha.9",
|
version="1.3alpha.10",
|
||||||
description="Python API & client shell for talking to Meshtastic devices",
|
description="Python API & client shell for talking to Meshtastic devices",
|
||||||
long_description=long_description,
|
long_description=long_description,
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|||||||
Reference in New Issue
Block a user