personam-solis / geigershow

Connect to a local GQ GMC Geiger counter and display in Grafana
MIT License
0 stars 0 forks source link

Connect to Geiger counter #1

Open personam-solis opened 7 months ago

personam-solis commented 7 months ago

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

personam-solis commented 7 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)
personam-solis commented 6 months ago

this person's code is VERY useful

DEFAULT_BAUD_RATE = 115200

m_device.write('<GETSERIAL>>')
serial_number = m_device.read(7)