Project

General

Profile

Actions

New Model #1343

closed

Polmar DB-50M (Anytone AT-5888UV clone)

Added by Robert Elsinga over 10 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Start date:
01/02/2014
Due date:
% Done:

0%

Estimated time:
Equipment Loan/Gift Offered:
No
I read the instructions above:

Description

Hi, I purchased a Polmar DB-50M, which is a clone of the Anytone AT-5888UV, with minor differences. The most important difference is that it supports 7 character channel names.

I read the model name from the debug file:
User selected AnyTone 5888UV on port COM9
Clone thread started
000: 49 44 42 2d 35 30 4d 00 IDB-50M.
008: 00 56 31 30 30 e4 00 06 .V100...

I also read the Intek 2040 issue and tried to create a polmar-db50m.py file based on the intek.py file (changed the vendor, model and classname), but loading the module seems to time-out when reading the radio:

@directory.register
class PolmarDB50Madio(chirp_common.CloneModeRadio,
chirp_common.ExperimentalRadio):
"""Polmar DB-50M"""
VENDOR = "Polmar"
MODEL = "DB-50M"

Is there a FAQ on how to create a *.py file yourself? I don;t mind tinkering a py file and I'm not scared of programming.


Files

debug.log (4.77 KB) debug.log Debug.log, after reading DB50M as an Anytone AT-5888UV Robert Elsinga, 01/02/2014 04:52 AM
polmar-db50m.py (12.1 KB) polmar-db50m.py Not working Polmar DB50M *.py file Robert Elsinga, 01/02/2014 04:52 AM
Portmon_read_5888UV_hex.log.txt (2.22 MB) Portmon_read_5888UV_hex.log.txt Dan Smith, 01/04/2014 07:14 AM
Actions #1

Updated by Tom Hayward over 10 years ago

  • Status changed from New to Feedback

A timeout when reading the radio indicates Chirp doesn't understand the radio's protocol or the cable isn't working. Maybe it isn't a clone after all. You may need to sniff the protocol and compare to the Anytone code.

Check Developers for more information. The mailing list or IRC would be a good place to ask your questions.

Actions #2

Updated by Robert Elsinga over 10 years ago

I will ask in the developer mailing list, if I can sniff the protocol without any additional hardware I will gladly do so. I can upload and download using the official software without any problems.

I know what the (binary) frequency file which is used by the official software is made up of and I can create one from Excel through a hexeditor (to convert the hex-string to actual binary data, something Excel can't create). So maybe that will help too.

Actions #3

Updated by Dan Smith over 10 years ago

IMHO, the timeout is likely just because the proper ident string isn't being sent and the radio never responds, so CHIRP times out.

If you see the new model in your model drop-down during clone, then it's loading it properly. I expect messing around in _ident will yield some progress.

Actions #4

Updated by Robert Elsinga over 10 years ago

It is in the dropdown list after loading the py module. I noticed that I didn't change the response in _ident, now it is IDB-50M, like it is in the debug file. Still no joy though, load from radio does nothing.

From the debug log:

NOTE: driver re-registration enabled
Registered Polmar_IDB-50M = PolmarDB50Madio
Traceback (most recent call last):
File "chirpui\mainapp.pyo", line 1357, in mh
File "chirpui\mainapp.pyo", line 615, in do_download
File "chirpui\mainapp.pyo", line 573, in _confirm_experimental
File "chirpui\common.pyo", line 348, in show_warning
File "chirpui\common.pyo", line 308, in _add_text
TypeError: GtkTextBuffer.set_text() argument 1 must be string or read-only buffer, not None
Traceback (most recent call last):
File "chirpui\mainapp.pyo", line 1357, in mh
File "chirpui\mainapp.pyo", line 615, in do_download
File "chirpui\mainapp.pyo", line 573, in _confirm_experimental
File "chirpui\common.pyo", line 348, in show_warning
File "chirpui\common.pyo", line 308, in _add_text
TypeError: GtkTextBuffer.set_text() argument 1 must be string or read-only buffer, not None

But it didn;t even display the Experimental radio popup, which does show when querying the DB50M as a AT-5888UV. But the trackback suggests there is some sort of argument problem, but I didn't change any argument, only the class and response in _ident.

I asked for a capture tool in the developers mailinglist, hope I get a response so I can start debugging.

Actions #5

Updated by Dan Smith over 10 years ago

The string in the image file is not the same as what the radio expects to start the clone, IIRC. Get Portmon and you can watch exactly what the OEM software is doing.

Actions #6

Updated by Robert Elsinga over 10 years ago

My changes to the intek.py file (now saved as polmar_db50.py):

def _ident(radio):
radio.pipe.setTimeout(1)
_echo_write(radio, "PROGRAM")
response = radio.pipe.read(3)
if response != "QX\x06":
print "Response was:\n%s" % util.hexprint(response)
raise errors.RadioError("Unsupported model")
_echo_write(radio, "\x02")
response = radio.pipe.read(16)
_debug(util.hexprint(response))
if response[1:8] != "IDB-50M": <-------------- only this line
print "Response was:\n%s" % util.hexprint(response)
raise errors.RadioError("Unsupported model")

And:

@directory.register
class PolmarDB50Mradio(chirp_common.CloneModeRadio,
chirp_common.ExperimentalRadio):
"""Polmar DB-50M"""
VENDOR = "Polmar"
MODEL = "IDB-50M"
BAUD_RATE = 9600

(all except first and last line)

So no arguments changed. Must be somthing in the data, I guess.

Actions #7

Updated by Robert Elsinga over 10 years ago

Dan Smith wrote:

The string in the image file is not the same as what the radio expects to start the clone, IIRC. Get Portmon and you can watch exactly what the OEM software is doing.

Okay. I thought the string in the debug logfile would be what I needed to change in the py file. Couldn't find the debug.log from the intek to compare. :)

I will download portmon and check what the official software sends and receives. Will post the result here.

Actions #8

Updated by Robert Elsinga over 10 years ago

Portmon is not supported on x64 systems and I'm running Win7 x64... Will try to locate another tool to monitor the serial comms...

Actions #9

Updated by Dan Smith over 10 years ago

It works fine on x64 Windows 7.

Actions #10

Updated by Robert Elsinga over 10 years ago

Strange, I downloaded version 3.03 which seems the latest. It shows Error 2 and quits or does not show any serial ports. The Serialcomms registry hyve only shows the 3 commports I have (one physical, 2 USB2serial Prolific ones).

Do you have a link to the working one?

Actions #11

Updated by Dan Smith over 10 years ago

See this (the first hit on google for "portmon windows 64"):

http://stackoverflow.com/questions/1356470/sysinternals-portmon-error-2

There are answers below about how to make it run.

Actions #12

Updated by Robert Elsinga over 10 years ago

Already found that one and tried all suggestions. Doesn't work. Every 2000/XP compatibility mode still shows error 2. Also copied from USB disk to fixed D: drive and still no joy. Ran from CMD box and/or as admin, nothing. :(

Problem is, all my other machines are Win7 x64 or Windows Server 2008 x64. And i doubt it runs from VMware Workstation, but I might just install a Windows 7 x86 VM just to try... But that mght have to wait until next week. ;)

Since I can export from my massive (18.000+ frequencies) Excel file to Chirp CSV format, I rather use Chirp than input the channels by hand (even if it's "only" about 300). I tried to hack the binary *.fre file together and it loads fine in the official software, but it won't upload. :(

So I really want to get Chirp to work... Then I can upload the channels with Chirp, read from the radio and then alter all settings and upload the complete file to the radio.

So any suggestion on how to get Portmon to work or an alternative is appreciated. Tried Api Monitor v2, but couldn't find the right calls to monitor for the serial data yet.

Actions #13

Updated by Dan Smith over 10 years ago

Why wouldn't it work in VMware? It just hooks into Windows APIs, so I don't see why it would be specific to any hardware (or lack thereof). It works in virtualbox and KVM for me. I sure as hell don't have windows installed on any real hardware here :)

Actions #14

Updated by Robert Elsinga over 10 years ago

Okay, will install Win7 x86 real soon and monitor from within the VM. Only thing I need is get the USB serial cable to work, but it is a generic Prolific one, so hope that works. If I can read the radio then I wil monitor the serial data and log it.

Will report back when I have something to show. ;)

Thanks for the support so far. :)

Actions #15

Updated by Robert Elsinga over 10 years ago

Okay, fired my XP SP3 x86 VM, installed the serial driver and the programming software and ran Portmon. I attached the logfiles (both captures in ASCII and HEX, without all status calls so only the read/written data). <edit, can't submit with the 4 logfiles attached, I placed them here for download: http://download.elsinga.net/chirp-db50m/.

Is there anyone who has a similar capture of a AT-5888UV or Intek HR-2040? Then I could compare the way they read/write to the DB50M

Actions #16

Updated by Dan Smith over 10 years ago

Here is a hex read from my Anytone. I think that from looking at your own log and the code, you should be able to suss out the differences pretty easily, but hopefully this will help.

Actions #17

Updated by Robert Elsinga over 10 years ago

Okay, I have compared the two files and they start of exactly the same with the sending PROGRAM and receiving PROGRAMSQ Ox06. Then the command sent is the same every time (0x52 00 20 10, at least for the first couple of times I compred them), but the answer is different. Not a surprise, since it starts with a query for the model number. However, the length of the answer is the same (26). And later in the log, when querying the channels, the command seems to be the same for both models and theanswer is the same length.

I cannot find any fundamental differences, which is not a surprise since both radio's share the same body.

That could mean I can just change the intek.py file, but that didn't work... But I now know for sure the DB50M returns "DB-50M" as the model name (omitting the 0x0249 which is returned for both radios). Assuming the DB50M is behaving the same as the 5888UV or Intek HR2040, do I just need to change the model name and the class definition?

Actions #18

Updated by Dan Smith over 10 years ago

This sort of back-and-forth development discussion is much easier on the dev mailing list. Can you start a thread there and we'll pick up? Thanks!

Actions #20

Updated by Robert Elsinga over 10 years ago

Changed all occurrences of Intek to Polmar and HR-2040 to DB-50M the intek.py file, but reading the radio does nothing and the logfile starts this:

NOTE: driver re-registration enabled
Registered Polmar_DB-50M = PolmarDB50MRadio
Traceback (most recent call last):
File "chirpui\mainapp.pyo", line 1357, in mh
File "chirpui\mainapp.pyo", line 615, in do_download
File "chirpui\mainapp.pyo", line 573, in _confirm_experimental
File "chirpui\common.pyo", line 348, in show_warning
File "chirpui\common.pyo", line 308, in _add_text
TypeError: GtkTextBuffer.set_text() argument 1 must be string or read-only buffer, not None

Since the communication is exactly the same until the radio responds with the model name and I have the correct model name, it should at least get that. But I don;t even get the experimental warning, which is the first call in the class:

@directory.register
class PolmarDB50MRadio(chirp_common.CloneModeRadio,
chirp_common.ExperimentalRadio):
"""Polmar DB-50M"""
VENDOR = "Polmar"
MODEL = "DB-50M"
BAUD_RATE = 9600

# May try to mirror the OEM behavior later
_ranges = [
    (0x0000, 0x8000),
    ]

@classmethod
def get_experimental_warning(cls):
    return "FOO"

What is next? I am no Python programmer, so real debugging is not a viable option for me at the moment...

Actions #21

Updated by Robert Elsinga over 10 years ago

Dan Smith wrote:

This sort of back-and-forth development discussion is much easier on the dev mailing list. Can you start a thread there and we'll pick up? Thanks!

As Tom responded, I already posted there, but no reply since then. And, as any user, I'm impatient. ;)

Actions #22

Updated by Dan Smith over 10 years ago

Sorry, I missed that you had done that. I just replied there, please, lets take the discussion to the list.

Actions #23

Updated by Robert Elsinga over 10 years ago

Check, responded there. Tnx!

Actions #24

Updated by Robert Elsinga over 10 years ago

Dan was a great help and added Polmar DB-50M support in the nightly build. Thanks!

Actions #25

Updated by Dan Smith over 10 years ago

  • Status changed from Feedback to Closed
  • Target version set to 0.4.0

Fixed in r2169

Actions

Also available in: Atom PDF