On 4-1-2014 16:57, Dan Smith wrote:
Okay, sorry, I forgot this was started here since the discussion ended up all in the issue.
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:
If you create a new .py file there and change the VENDOR and MODEL strings as you have, then CHIRP will register it and make it available for selection in the UI. If you see the right vendor/model in the drop-downs during the download part, you can be sure that you're running the code in that file.
This works. I see it enabled in the debug.log also: Registered Polmar_DB-50M = PolmarDB50MRadio
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.
Probably the best thing to do to get bootstrapped is start dropping print statements into your module to help you understand where exactly it's getting stuck, and confirm what you're getting back from the radio in each step. Looking at the other code will help, but this should be most of what you want:
print util.hexprint(foo)
where "foo" is some string variable of data you just read from the radio.
I think you're doing your development in Windows, right? Did you get a full development environment setup or are you trying to shove your .py into the frozen zip each time you make a change?
I am just editing the .py file at the moment. I'm not a developer, but seeing how easy it was for an Intek HR-2040 owner to edit the .py file I just dived in. Attached is the .py file I eneded up with, but after only changing any accurrence of Intek to Polmar and HR-2040 to DB-50M, I do not even get the experimental warning. And if I try to read the DB-50M as an Intek HR-2040 I do get that (but also get an unsupported model just after that).
This baffles me... I see the class PolmarDB50MRadio getting registered in the debug logfile, can pick the model for a read and then nothing. I expected at least the experimental warning and an error, but get some cryptic log statements instead:
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
I compared the Portmon logs from a Anytone AT-5888UV to my DB-50M and the commands are the same and the only thing different at the start is the model name, but it is in the same format...