Project

General

Profile

Actions

New Model #1035

closed

TYT TH-9000 VHF

Added by David Fannin over 10 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
07/30/2013
Due date:
% Done:

0%

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

Description

support for the TYT TH-9000 VHF (and other) radios. I can support testing and development, as I have a model and build environment for Chirp.


Files

th9000.py (4.73 KB) th9000.py Draft version of the TYT TH9000 memory map David Fannin, 08/25/2013 10:24 AM
tytpatch9000-001.patch (17 KB) tytpatch9000-001.patch David Fannin, 09/28/2013 11:23 PM
th9000-002.patch (823 Bytes) th9000-002.patch Version 0.2 of the TYT TH9000 VHF patch file. David Fannin, 05/12/2014 10:11 AM
th9000-003.patch (26.9 KB) th9000-003.patch David Fannin, 05/14/2014 03:03 PM
tytth9000-004.patch (28.1 KB) tytth9000-004.patch David Fannin, 06/07/2014 02:53 PM
tytth9000.img (16 KB) tytth9000.img David Fannin, 06/07/2014 03:04 PM
th9000uhf.py (26.2 KB) th9000uhf.py for UHF version of radio mike 240, 03/10/2015 06:33 PM
th9000-v0.5.patch (29.5 KB) th9000-v0.5.patch hg patch file David Fannin, 04/18/2015 10:16 PM
th9000.py (27.7 KB) th9000.py source file David Fannin, 04/18/2015 10:16 PM
th9000-v0.6.patch (28.8 KB) th9000-v0.6.patch David Fannin, 04/27/2015 11:50 PM
th9000-v0.7.patch (28.8 KB) th9000-v0.7.patch David Fannin, 05/02/2015 01:08 PM
th9000-v0.8.patch (28.8 KB) th9000-v0.8.patch patch file David Fannin, 05/10/2015 06:16 PM
TYT_TH9000_144.img (16 KB) TYT_TH9000_144.img test image for 2 meter (144 Mhz) radio David Fannin, 05/10/2015 06:16 PM
TYT_TH9000_220.img (16 KB) TYT_TH9000_220.img test image for 1.25 meter (220 Mhz) radio David Fannin, 05/10/2015 06:16 PM

Related issues

Has duplicate New Model #2589: TYT TH-9000DClosed05/16/2015

Actions
Actions #1

Updated by David Fannin over 10 years ago

Progress so far:

  • Acquired a TYT TH9000 VHF Radio
  • Confirmed stock TYT 1.05 Windows Software and USB data cable work with the radio.
  • Installed Ubuntu 12.10 on kvm virtual machine, set up sw dev environment for Chirp
  • cloned the chrip.hg branch in the dev environment, ran unit tests (all passed).
  • created a new clone "chirp-def.hg" branch from chirp.hg

next steps:
do a serial port capture of the radio cloning (both read and write) exchange, and analyze.

Need Help:

Any suggestions for free Windows 7 serial port capture software? I am going to try portmon and usbsniffer, but also saw this:[[ http://desowin.org/usbpcap/]]
Also, once I have the capture, are there any other memory formats descriptions that I can review to understand how the radio manufactor's format their memory?

Actions #2

Updated by Tom Hayward over 10 years ago

  • Status changed from New to In Progress

Questions like this are best discussed in the chirp_devel mailing list.

I have used portmon in the past.

Once you are able to download an img cleanly from the radio, save it. Then change the first memory channel in the radio very slightly. Now download another img from the radio. Use hexdump and diff to compare the two imgs. You should be able to determine what changed when the memory was modified. This will help you determine the start of the channel list and maybe other details about the channel you programmed. Change the second channel and repeat the process to determine the length of each channel record.

Actions #3

Updated by David Fannin over 10 years ago

Initial decoding of the Channel Memory Map (see attached file). It appears that the memory map for the TH9000 is close to the Anytone 5888, so I'm using it as a guide. There are significant differences, however. The upload/download protocol looks the same. I have been able to confirm all the basic channel settings up to CTCSS. I have not started on the DCS or Cross mode settings yet, so that is not included. I'm including the file here, in case folks are interested, and I will create a patch for including this into source once I have a more complete file.

I'm proposing to use the file name "tyt_th9000_vhf.py" for the chirp/.py file, as the th9000 has several models for vhf, uhf and 6 meter bands. However, the model naming convention in chirp appears to use several different conventions. I would appreciate comments on that as well.

Actions #4

Updated by Dan Smith over 10 years ago

If it's really similar, I'd prefer a subclass of the Anytone with appropriate changes made. It may be easier to do it as a separate file first and then consult the differences before merging, but I'd really like to avoid two effectively identical drivers in the tree with different names. We have a bit too much of that right now, although some are very good about sharing code. See the Baofeng UV-5R driver for an example.

Thanks for your work on this!

Actions #5

Updated by David Fannin over 10 years ago

I've been using the anytone as a guide, so I'll get all the changes/differences together, to see if it warrants a submodel of the anytone, or a new model class. So far, it appears there are different data fields for the dcs coding, and a number of different options (those are less of an issue). I did review the baofeng approach, but my initial impression is that the Baofeng differences are different ident versions. The difference between Anytone and TYT appear to require different class structures, and different class methods. I'll have to see how the global settings map works, and see how close they are.

Who did the anytone decode? - it may be useful to compare notes with them.

Also, It would be nice to have a wiki page on getting started with a new model - things like suggestions on setting up the serial port monitoring, documentation on memory map conventions, documentation on the model classes, etc. I don't mind winging it, but it would may some me some time downstream. I can add some of this based on my recent experience with getting this set up. In particular, getting portmon working correctly took a couple a days because of a couple of non-intuitive options (setting hardware flow ctl for the usb serial port, setting the max length, and setting the filters so that it was less chatty.).

Actions #6

Updated by mike 240 over 10 years ago

Hi just wondering what the status was of this radio support? Is there a nightly build with it? Also, is there any way I can help?

Actions #7

Updated by David Fannin over 10 years ago

My latest updates is that I have more or less a complete memory map, and have created the memmap data structure. I will post the results here. I plan to get the basic upload/download working this weekend. If that all works, then I will ask to check in an initial version of these to the code base as work in progress.

Actions #8

Updated by mike 240 over 10 years ago

David Fannin wrote:

My latest updates is that I have more or less a complete memory map, and have created the memmap data structure. I will post the results here. I plan to get the basic upload/download working this weekend. If that all works, then I will ask to check in an initial version of these to the code base as work in progress.

Excellent, I have the UHF model but I assume the memory map is the same. I am willing to help test this, I only run linux and the TYT software doesnt work on linux and manual program is horrible. Let me know what you need.

Actions #9

Updated by David Fannin over 10 years ago

Here is the 1st patch for this model. It includes a base model skeleton and memory map for most of the radio options. It does not include working methods yet, but should give a good start for adding these. I compared this to the Anytone 5888 model; there are a number of similar memory map structures, but there are a number of significant differences, so it didn't make sense to try to overload the Anytone model ; however, there are a number of identical methods (like checksum) that are the same, so I'll look at creating a generic function file that the two can share.

Actions #10

Updated by mike 240 over 10 years ago

David Fannin wrote:

Here is the 1st patch for this model. It includes a base model skeleton and memory map for most of the radio options. It does not include working methods yet, but should give a good start for adding these. I compared this to the Anytone 5888 model; there are a number of similar memory map structures, but there are a number of significant differences, so it didn't make sense to try to overload the Anytone model ; however, there are a number of identical methods (like checksum) that are the same, so I'll look at creating a generic function file that the two can share.

Is there any info you need from me to confirm the UHF version I have is exactly the same? I am guessing it is.

Actions #11

Updated by mike 240 over 10 years ago

David, any update?

Actions #12

Updated by mike 240 over 10 years ago

Anyone willing to help me finish this work? I really would like to get this working, I have zero experience with this kind of stuff but I am a software developer of sorts, so at least I have that part down. I know some python.

Actions #13

Updated by Nor Idzuwan Mohammad over 10 years ago

Hi,

I have VHF model of the radio, I can help testing after I figure out how to setup and build environment for chirp, I'm no software programer so that could be challenging but I'm up for it

Actions #14

Updated by David Fannin almost 10 years ago

Here's a alpha version of the TH9000 driver. It's not ready for production. It will download and save a TYT-9000 VHF radio image, and will display the memories. The patch log contains a good view of what's working and not. The upload is not yet working.

I'm working on the memory channels to accept DCS and Cross modes, plus adding in a number of radio settings.

Actions #15

Updated by David Fannin almost 10 years ago

Alpha version 0.3 for the TYT TH9000 VHF driver. It was developed and tested on a 2 meter version, but should work (with the exception of the ident fields and frequency ranges, for the 200Mhz and UHF version of the TH9000 radio.

This version is still experimental, and may have data corruption bugs - use at your own risk! (Testing, however, would be appreciated.)

This version has:

Download and save image file
Upload an image file to the radio
Memory viewing and editing (for Simplex, Tone and TSQL modes - DCS not yet working)
Global Setting (missing a couple) - Squelch, Beep, Display Color and brightness, APO, Timeout Timer, etc.
Radio Frequency Range Setting (for TX/RX ranges)

The patch is designed to be applied to trunk.

Actions #16

Updated by David Fannin almost 10 years ago

Update for TYT TH9000 Radio (new model)

This patch is ready for other user to try out. Still marked as Alpha, but it appears to be fairly solid and stable.

Features working:
Download/Upload to radio
Display and Edit Memories
Save image file
Modes: None, Tone, TSQL
Global Setting
APO
BG Color and Brightness
Squelch Level
TOT
Radio Max Transmit Power
Startup/Welcome Message
TBST Freq
TX/RX Freq Range
Beep

Memory Setting
    Freq, Offset, Skip, Step, Ch Width, Name, Power, Mode, Tone-PL, TSQL-PL

Not Working
    DCS, Cross and Reverse Modes
    Display Mode (VFO/Mem)
    VFO MR
    Channel Lock
    Voice Prompt
    Tail Elim Type
    Bootup Password
    Memory: Reverse, TX Off, Compander, Talk Around, Scrambler

I executed the unit tests, and its failing on one test:
TYT TH9000 BruteForce FAILED: Field tmode' is', expected `TSQL-R'

Actions #17

Updated by David Fannin almost 10 years ago

The image file from the TYT TH9000 for unit testing.

Actions #18

Updated by mike 240 about 9 years ago

David Fannin wrote:

Update for TYT TH9000 Radio (new model)

This patch is ready for other user to try out. Still marked as Alpha, but it appears to be fairly solid and stable.

Features working:
Download/Upload to radio
Display and Edit Memories
Save image file
Modes: None, Tone, TSQL
Global Setting
APO
BG Color and Brightness
Squelch Level
TOT
Radio Max Transmit Power
Startup/Welcome Message
TBST Freq
TX/RX Freq Range
Beep

Memory Setting
    Freq, Offset, Skip, Step, Ch Width, Name, Power, Mode, Tone-PL, TSQL-PL

Not Working
    DCS, Cross and Reverse Modes
    Display Mode (VFO/Mem)
    VFO MR
    Channel Lock
    Voice Prompt
    Tail Elim Type
    Bootup Password
    Memory: Reverse, TX Off, Compander, Talk Around, Scrambler

I executed the unit tests, and its failing on one test:
TYT TH9000 BruteForce FAILED: Field tmode' is', expected `TSQL-R'

David, I tried to use your patch with my UHF model of the TYT-9000 but get the error when trying to download from the radio of: Unsupported Model

Do you have any idea what I might need to change in the patch file to make it let me use it with my UHF model?

Actions #19

Updated by mike 240 about 9 years ago

I modified the patch for the UHF version of the radio and it works well for me. I am able to download from radio and upload to radio. Use at your own risk though.

Actions #20

Updated by David Fannin about 9 years ago

This is the latest experimental version for the TYT-TH9000D radio driver.

This patch covers the 3 existing TH9000 models - 2meters, 220 and 440 radios in a single class file. The code is based with the latest dev branch of Chirp (a/o 4/18/2015), so this patch should only be applied to this branch.

I've tested it on both 2 meter and 220 models, so I would appreciate if someone could test on the UHF model.

All previous features are currently working for this patch, with the exception of automatic file identifcation. The TH radios do not have a identifer that can safely distingush between the radios, this feature is still TBD. You will need to manually select the correct model when you open a radio image file. You'll get a prompt when you open a image file, so select one of the three available models.

I am attaching both the patch file for those that are using hg and git. I've also included a copy of the plain source file, which can drop the "chirp/driver" directory of the source code to try it out.

I would also welcome feedback on what modifications are need for this to be checked into the main branch. It's ready to used by a wider audience.

Actions #21

Updated by David Fannin almost 9 years ago

latest version of the TYT-TH9000D driver.

this version removes the string literials, cleans up the copyright messages, and adds auto identification of file types.

Actions #22

Updated by David Fannin almost 9 years ago

latest patch with base class fixes.

Actions #23

Updated by David Fannin almost 9 years ago

Note on the auto identification feature for the image file.

the match_model() for this radio uses two sets of checks for matching up the correct model.
it first checks file size, and then reads four variables in the image file (tx max, tx min, rx min, and rx max), which control the tx/rx frequency range for the radio. If all four match are within range for a specific model, then it returns true. e.g. the 2 meter radio should have settings between 136 Mhz and 172 mhz. The three models freq range do not overlap, so this should be a reliable method to determine the correct model.

Actions #24

Updated by David Fannin almost 9 years ago

New patch - v0.8 for tyt th9000 radio driver

added correct modes (tone, tsql, dcts, and cross)

successfully ran unit tests (all passed) for 2 meter and 220 radios (new images attached):

$ ./run_tests -d TYT_TH9000_144
TYT TH9000_144 Detect PASSED: All tests
TYT TH9000_144 Settings PASSED: All tests
TYT TH9000_144 Clone PASSED: All tests
TYT TH9000_144 Edges PASSED: All tests
TYT TH9000_144 BruteForce PASSED: All tests
TYT TH9000_144 CopyAll PASSED: All tests

TYT TH9000_144 Banks SKIPPED: Banks not supported

Results:
TOTAL : 7
FAILED : 0
SKIPPED: 1
PASSED : 6
CRASHED: 0
./run_tests -d TYT_TH9000_220
TYT TH9000_220 Detect PASSED: All tests
TYT TH9000_220 Settings PASSED: All tests
TYT TH9000_220 Clone PASSED: All tests
TYT TH9000_220 Edges PASSED: All tests
TYT TH9000_220 BruteForce PASSED: All tests
TYT TH9000_220 CopyAll PASSED: All tests

TYT TH9000_220 Banks SKIPPED: Banks not supported

Results:
TOTAL : 7
FAILED : 0
SKIPPED: 1
PASSED : 6
CRASHED: 0
.

Actions #25

Updated by Bernhard Hailer about 4 years ago

  • Status changed from In Progress to Closed

This appears to be complete.

Actions

Also available in: Atom PDF