darrylb123 / usbrelay

Control usb relay - based on hidapi
GNU General Public License v2.0
316 stars 98 forks source link

libusb is not usable for 2 Ucreatefun relay boards #50

Closed sebbonnaire closed 4 years ago

sebbonnaire commented 4 years ago

hi Darryl

as requested, here is the case with the libusb... here is the output of the command usbrelay-d with libusb, on a Rpi, with 2 x 8 relay boards attached :

./usbrelay -d
enumerate_relay_boards()Found 1 devices
Device Found
  type: 0519 2018
  path: 0001:0006:00
  serial_number: A0001
Manufacturer: Ucreatefun.com
  Product:      HIDRelay
  Release:      1
  Interface:    0
  Number of Relays = 9
  Module_type = 2
A0001_1=-1
A0001_2=-1
A0001_3=-1
A0001_4=-1
A0001_5=-1
A0001_6=-1
A0001_7=-1
A0001_8=-1
A0001_9=-1
double free or corruption (out)
Aborted
darrylb123 commented 4 years ago

I tested with an 8 relay DCCTECH module. No issues like you have seen. I may need to log into your rPi unless you are familiar with gdb. Send an email to xxxx@xxxx and we will organise some keys. sudo usbrelay -d enumerate_relay_boards()Found 1 devices Device Found type: 16c0 05df path: 0003:0009:00 serial_number: HW554 Manufacturer: www.dcttech.com Product: USBRelay8 Release: 100 Interface: 0 Number of Relays = 8 Module_type = 1 HW554_1=0 HW554_2=0 HW554_3=1 HW554_4=0 HW554_5=0 HW554_6=0 HW554_7=0 HW554_8=0

On Fri, Apr 24, 2020 at 5:28 PM sebbonnaire notifications@github.com wrote:

hi Darryl

as requested, here is the case with the libusb... here is the output of the command usbrelay-d with libusb, on a Rpi, with 2 x 8 relay boards attached :

./usbrelay -d enumerate_relay_boards()Found 1 devices Device Found type: 0519 2018 path: 0001:0006:00 serial_number: A0001 Manufacturer: Ucreatefun.com Product: HIDRelay Release: 1 Interface: 0 Number of Relays = 9 Module_type = 2 A0001_1=-1 A0001_2=-1 A0001_3=-1 A0001_4=-1 A0001_5=-1 A0001_6=-1 A0001_7=-1 A0001_8=-1 A0001_9=-1 double free or corruption (out) Aborted

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/darrylb123/usbrelay/issues/50, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTSUVPLFD4DDTOZFM7WTBLROE5RFANCNFSM4MP3O3LA .

darrylb123 commented 4 years ago

Diagnosis showed that there was a /usr/sbin/usbrelay that was an old version and the subsequent calls to the new libusbrelay.so caused wierdness. Deleted /usr/sbin/usbrelay and pulled the very latest version and rebuilt and reinstalled. Now

usbrelay -d

enumerate_relay_boards()Found 2 devices Device Found type: 0519 2018 path: 0001:0006:00 serial_number: A0001 Manufacturer: Ucreatefun.com Product: HIDRelay Release: 1 Interface: 0 Number of Relays = 9 Module_type = 2 A0001_1=-1 A0001_2=-1 A0001_3=-1 A0001_4=-1 A0001_5=-1 A0001_6=-1 A0001_7=-1 A0001_8=-1 A0001_9=-1 Device Found type: 0519 2018 path: 0001:0005:00 serial_number: A0001 Manufacturer: Ucreatefun.com Product: HIDRelay Release: 1 Interface: 0 Number of Relays = 9 Module_type = 2 A0001_1=-1 A0001_2=-1 A0001_3=-1 A0001_4=-1 A0001_5=-1 A0001_6=-1 A0001_7=-1 A0001_8=-1 A0001_9=-1

darrylb123 commented 4 years ago

Added git version numbers to the executable and library that is printed out in debug mode. The versions can be easily compared.# usbrelay -d Version: 0175305e57f3ae0a193df2edb894f343dda90702 Library Version: 0175305e57f3ae0a193df2edb894f343dda90702 enumerate_relay_boards()Found 2 devices Device Found type: 0519 2018 path: 0001:0006:00 serial_number: A0001 Manufacturer: Ucreatefun.com Product: HIDRelay Release: 1 Interface: 0 Number of Relays = 9 Module_type = 2 A0001_1=-1 A0001_2=-1 A0001_3=-1 A0001_4=-1 A0001_5=-1 A0001_6=-1 A0001_7=-1 A0001_8=-1 A0001_9=-1 Device Found type: 0519 2018 path: 0001:0005:00 serial_number: A0001 Manufacturer: Ucreatefun.com Product: HIDRelay Release: 1 Interface: 0 Number of Relays = 9 Module_type = 2 A0001_1=-1 A0001_2=-1 A0001_3=-1 A0001_4=-1 A0001_5=-1 A0001_6=-1 A0001_7=-1 A0001_8=-1 A0001_9=-1

sebbonnaire commented 4 years ago

Thanks you Darryl, this version information was missing. You are right