Open ken-clifton opened 9 months ago
Possible solution to above changes to support old Anytone VID/PID as well as new Anytone VID/PID:
1) In /lib/anytone_interface.cc Changed #define USB_VID and USB_PID to: // original anytone vid & pid
And Added following two defines: // next are vid/pid for d578uv2
Added a declaration for static variables above all methods near top: uint16_t AnytoneInterface::_at_vid = 0x0000; uint16_t AnytoneInterface::_at_pid = 0x0000;
Modified AnytoneInterface::InterfaceInfo() and AnytoneInterface::detect() to USBDeviceInfo AnytoneInterface::interfaceInfo() { return USBDeviceInfo(USBDeviceInfo::Class::Serial, _at_vid, _at_pid); }
QList
Also in /lib/anytone_interface.cc Added line below: } else if ("D578UV" == _info.name) { return RadioInfo::byID(RadioInfo::D578UV); }
As: else if ("D578UV2" == _info.name) { return RadioInfo::byID(RadioInfo::D578UVII); }
2) in /lib/anytone_interface.hh near bottom of code in protected section just below RadioVariant _info; added static uint16_t _at_vid; static uint16_t _at_pid;
This kind of bug is present on all radios where serial communication is used, why qdmr is masking this with USB ids is beyond me.
@ken-clifton , @galagithub : Is this related to #196 and/or #370?
@allesand Yes, related to #196, but the code in the development branch does not handle the different USB VID and PID as mentioned in the title of this issue.
@ken-clifton : which of the models in https://www.wouxun.us/images/D578UV-Family.jpg is your radio? Or yet a different one?
@allesand in the image link you provided the radio is D578UVIII Plus. However if you read through both issue #196 and #415 it identifies itself in anytone_interface.cc code as "D578UV2". This is documented in the information I provided at the top of this issue as item 1 on Feb 14, 2024.
@ken-clifton : since the title of this issue reads "AnyTone D578UVII Uses Different USB VID and PID, Following Changes Read Radio" and also "I noticed my AnyTone D578UVII uses different a different USB VID and PID than those defined near the top of anytone_interface.cc" I just wanted to confirm that it is indeed a "D578UVIII Plus" according to that table and not yet another model Anytone came up with - since there is a "D578UVII" mentioned in https://www.wouxun.us/Software/AnyTone-Software/AT-D578UVII-PLUS-v2.06.2-Changelog.pdf ..
@allesand I appreciate you checking. Several of the AnyTone D578 series report as "D578UV2" in the USB information.
@allesand I appreciate you checking. Several of the AnyTone D578 series report as "D578UV2" in the USB information.
If different models with different options in the codeplug report the same model via USB, @hmatuschek will not be happy, since from what I understood Anytone does not encode the model in the data read from the radio. But I will leave that up to @hmatuschek, just wanted to gather as much info as possible.
@allesand so the whole smart detection logic is actually flawed?
How dare You!!!
LMAO.
Re: https://github.com/hmatuschek/qdmr/issues/285 and https://github.com/hmatuschek/qdmr/discussions/389, end of discussion for me. @galagithub : good to read that you got a good laugh, maybe that will make your discussion more ham-spirit like. Side note: your "!" seems to be stuck.
allesand
This would do well to explain why I received the "No radio found: No matching device was found" information dialog upon attempting to detect my product in v0.11.2
I am using Distributor ID: Pop Description: Pop!_OS 22.04 LTS Release: 22.04 Codename: jammy
2e3c:5740 Artery AT32 Virtual Com Port
My Anytone AT-D578UV III Pro usually shows up around /dev/ttyACM0: USB ACM device
Probe in syslog New USB device found, idVendor=2e3c, idProduct=5740, bcdDevice= 2.00 New USB device strings: Mfr=1, Product=2, SerialNumber=3
I would be more than happy to assist where I can with this issue. Would there be anything additional you need?
FYI, I am pretty sure the model I have uses the D578UV1.20(AT) firmware. I am unsure how this will impact the complexity of the issue at hand but you may benefit from a file that was was included "Which firmware to use for D578UV.txt"_ of which the content below could be highly relevant:
Hope this helps,
Chris WRUH997
I noticed my AnyTone D578UVII uses different a different USB VID and PID than those defined near the top of anytone_interface.cc Not sure of the best approach should you want to get QDMR working for both the "old" and "new" VID and PID ?
Here are the changes I implemented in 0.11 to successfully read from the radio:
1) In /lib/anytone_interface.cc changed VID/PID to - VID: 2e3c PID: 5740
Also in /lib/anytone_interface.cc Added line below: } else if ("D578UV" == _info.name) { return RadioInfo::byID(RadioInfo::D578UV); }
As: else if ("D578UV2" == _info.name) { return RadioInfo::byID(RadioInfo::D578UVII); }
2) In /lib/radioinfo.hh Below D878UVII, Added D578UVII,
Also in /lib/radioinfo.hh below D578UVII, Added D578UV = D578UVII, // Actually a different device, Implement!
3) In /lib/radioinfo.cc Below line: {"d578uv", RadioInfo::D578UV} Added: a comma ( , ) then on next line {"d578uv2", RadioInfo::D578UVII}
Also in /lib/radioinfo.cc Below line: {RadioInfo::D578UV, D578UV::defaultRadioInfo()}, Added: {RadioInfo::D578UVII, D578UV::defaultRadioInfo()},
4) In /lib/radio.cc Below line: return new D578UV(anytone); Added: } else if ((id.isValid() && (RadioInfo::D578UVII == id.id())) || (force.isValid() && (RadioInfo::D578UVII == force.id()))) { return new D578UV(anytone);
5) In /lib/d578uv.cc Changed the lines at the bottom below: RadioInfo D578UV::defaultRadioInfo() { return RadioInfo(
To: RadioInfo::D578UVII, "d578uv2", "AT-D578UVII", "AnyTone", AnytoneInterface::interfaceInfo(),{
QList
RadioInfo(RadioInfo::D578UV, "d578uv", "AT-D578UV", "AnyTone", AnytoneInterface::interfaceInfo()) });