Tuesday, February 18, 2020

Anytone DMR - Resolving Type Mismatch Errors

Note, the following post references the Anytone AT-D868UV handheld radio, but I imagine the information applies to the AT-D878UV and other similar models from Anytone.

-----

tl;dr - The virtual com ports created by the com0com software package are incompatible with Anytone QXCodePro and D868UV (used for updating and configuring Anytone DMR radios), causing those programs to crash when they try to start up and enumerate the com ports in the system.  The error presented to the user is "Run-time error '13': Type mismatch".  The fix is to (temporarily) uninstall com0com prior to using the Anytone programs.

-----

I have an Anytone DMR handheld radio, model AT-D868UV.  Anytone makes several models of handheld and mobile radios and their DMR radios have become quite popular in the ham radio community, due to a combination of low price and extensive feature set.  As with all DMR radios, the Anytone radios have to be connected to a computer for programming, both for updating the firmware to fix bugs and enable features, and for configuring the radio itself including features and frequencies.

There are two software packages for Anytone radios that must be installed to do these tasks - a firmware update tool called QXCodePro, and a program for creating and maintaining the "codeplug" (just a fancy name for "the configuration file for the radio") called D868UV.  The Anytone radio connects to a PC using a custom USB cable.  Special driver software allows this to be seen by the computer as a "com" port, like an old-fashioned serial port.  Both the QXCodePro and D868UV programs connect to the radio through this serial com port to read and write firmware and configurations.

The software is updated on a somewhat irregular basis - downloaded either direct from Anytone or from a radio vendor.

Recently after not using my DMR radio for some time I decided to pick it back up and work with it.  My first goal was to download the newest software package which would include new versions of QXCodePro, D868UV, and a firmware file.  After installing the new program executables, I tried firing up QXCodePro and ran into this error - "Run-time error '13': Type mismatch".

Trying to load the D868UV software which manages codeplugs gave the same error.  I tried uninstalling the software and reinstalling, no luck.  I tried installing an older version, didn't work.  I did some Googling around for the error message - it is real common with some Visual Basic stuff plugged into Excel spreadsheets, none of which helped me.  After trying everything under the sun that I could think up, I gave in and posted questions all over a variety of Reddit and Facebook groups.

As sometimes happens, after I posted all those queries, I found my answer buried deep in the comments on a Facebook post.  I'm sharing it here for others who may have the same issue.

In addition to my Anytone radio I have a Software Defined Radio (SDR) - an RSP1A from SDRPlay.  I use a piece of software called CSV User Browser to import shortwave schedule and frequency lists, and one of the things CSVUB can do is control the SDR.  It works by sending commands to the SDRUno control software that comes with the radio. That communication is accomplished through... wait for it... com ports.  I have installed a program called "com0com" which creates two virtual com ports which are connected to one another.  I program CSVUB to grab one of the com ports, and SDRUno to grab the other, and the virtual com port pair pass messages between the two pieces of software.

The issue seems to be some characteristic of these virtual com ports created by com0com.  Remember that BOTH the QXCodePro and D868UV programs start by enumerating the com ports in the system upon startup.  Apparently there's something about these virtual com ports created by com0com that the Anytone programs can't handle - thus the "type mismatch" error.

The only solution I have found is to uninstall com0com temporarily when I need to use the Anytone programs, then reinstall it when I'm done messing with the DMR firmware or configuration changes.  It's sort of a pain in the butt, but it doesn't take terribly long.  There may be a way to configure the com0com ports so they don't trigger the type-mismatch in the Anytone programs, but I haven't found one.  I am toying with opening a bug report to Anytone, but they're a Chinese company and I don't think they are going to be very responsive.

73 -
James

3 comments:

  1. Thanks for this post. It really helped me zero in on the issue. I was able to get it to work by deleting the first virtual pair that the software seems to install. (They were called CNCA0 and CNCB0 on my system). I verified that the SDRUno communication to other apps on the normal virtual ports 3 and 4 worked as normal. Then tried the AnyTone software and it seems to work. I never understood those two weird com ports either... and evidently the software couldn't either.

    ReplyDelete
  2. I agree. Looked at my com0com and sure enough, there was a CNC pair in there. As soon as I deleted it, the program booted up. I did not have to remove the program. Just the pair that was CNC**. Thanks for the tip.

    John

    ReplyDelete
  3. Thank you, I would have never guess they are incompatible. The Anytone software should really be open souce. I will never buy a proprietary ham radio again where I am at the mercy of the manufacturer's buggy software.

    ReplyDelete

Taking the Acer Spin 714 Chromebook for a spin (ouch)

 For nearly a decade now I've been a Chromebook convert.  I don't try to use a Chromebook as a complete desktop replacement, but for...