Open personam-solis opened 6 months ago
from ChatGPT for scanning devices:
import psutil
import usb.core
def scan_external_devices():
# Get all disk partitions
partitions = psutil.disk_partitions(all=True)
# Filter out only external devices
external_devices = [partition.mountpoint for partition in partitions if 'removable' in partition.opts]
# Get all USB devices
usb_devices = [f"USB: {dev.bus}:{dev.address}" for dev in usb.core.find(find_all=True)]
# Combine external and USB devices
all_devices = external_devices + usb_devices
return all_devices
if __name__ == "__main__":
all_devices = scan_external_devices()
print("External and USB Devices:")
for device in all_devices:
print(device)
this person's code is VERY useful
DEFAULT_BAUD_RATE = 115200
m_device.write('<GETSERIAL>>')
serial_number = m_device.read(7)
Via serial connection, connect to the GQ GMC-500 and get data in CPM in an interval or every second via heartbeat.
Python show USB
Python connect via serial
Interface with GMC-500