OpenHantek / openhantek

OpenHantek is a DSO software for Hantek (Voltcraft/Darkwire/Protek/Acetech) USB digital signal oscilloscopes
http://openhantek.org/
GNU General Public License v3.0
763 stars 199 forks source link

Failure to load firmware to DSO-5200A in Ubuntu 18.04.1 LTS #281

Open YanekJ opened 5 years ago

YanekJ commented 5 years ago

Hi, After successfully building and installing OpenHantek from both: git trunk, or 'OpenHantek-openhantek-eb33325.tar.gz' package it seems that GUI hangs with 'Upload in progress...' message waiting for a long time. Red led on the DSO-5200A keeps flashing but nothing happens then.

dmesg output: [ 1059.412541] usb 2-1: new high-speed USB device number 6 using ehci-pci [ 1059.568873] usb 2-1: New USB device found, idVendor=04b4, idProduct=520a [ 1059.568876] usb 2-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 1059.654225] [UFW BLOCK] IN=eth0 OUT= MAC= SRC=fdf0:0fec:9d90:7a00:0223:aeff:fe77:132a DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=458165 PROTO=UDP SPT=8612 DPT=8612 LEN=24 [ 1059.654243] [UFW BLOCK] IN=eth0 OUT= MAC= SRC=fdf0:0fec:9d90:7a00:0223:aeff:fe77:132a DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=635215 PROTO=UDP SPT=8612 DPT=8610 LEN=24 [ 1059.654259] [UFW BLOCK] IN=eth0 OUT= MAC= SRC=fe80:0000:0000:0000:0223:aeff:fe77:132a DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=296501 PROTO=UDP SPT=8612 DPT=8612 LEN=24 [ 1066.654516] usb 2-1: USB disconnect, device number 6 [ 1066.725344] [UFW BLOCK] IN=eth0 OUT= MAC= SRC=fdf0:0fec:9d90:7a00:0223:aeff:fe77:132a DST=ff02:0000:0000:0000:0000:0000:0000:0001 LEN=64 TC=0 HOPLIMIT=1 FLOWLBL=458165 PROTO=UDP SPT=8612 DPT=8612 LEN=24 [ 1068.425107] usb 2-1: new high-speed USB device number 7 using ehci-pci [ 1068.581839] usb 2-1: New USB device found, idVendor=04b5, idProduct=520a [ 1068.581842] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 [ 1068.581844] usb 2-1: Product: DSO-5200A [ 1068.581846] usb 2-1: Manufacturer: ODM

Thanks!

YanekJ commented 5 years ago

I may have found a problem - but it seems this may only be reproducible in my system. Basically it looks like USBDevice::computeUSBdeviceID() function returns the same ID for two different USB devices: one for my DSO-5200A, and another one for my optical mouse.

After modifying that function to look like below (not sure if that'd work for everybody), I got the next GUI (window with black scope background). Not saying that everything works on that new GUI yet though.

UniqueUSBid USBDevice::computeUSBdeviceID(libusb_device device) { UniqueUSBid v = 0; libusb_get_port_numbers(device, (uint8_t )&v, sizeof(v)); struct libusb_device_descriptor tmpDesc; libusb_get_device_descriptor(device, &tmpDesc); v = v ^ (tmpDesc.idProduct << 16); return v; }