Project

General

Profile

Actions

New Model #3363

closed

Kenwood TK-790 Single Head

Added by Pavel Milanes almost 9 years ago. Updated 6 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
02/20/2016
Due date:
% Done:

100%

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

Description

I got a Kenwood TK-790 with a single head borrowed from a friend for a week or more, with a homebrew interface that has it's tricks... more on this later

I'm tainting it and found it use a single wire bus at TTL levels and the interface talks DIRECTLY to this "TRD" bus.

It has Three blocks of memory, corresponding (as per my assumptions) to the main three IC that connect to the bus:

  • The main CPU
  • The Head CPU
  • Other undetermined now.

I see a checksum on just one of the three blocks, I will check if it's a classic checksum, more on this later.

73


Files

o.img (24.1 KB) o.img First image of the Sample TK-790 radio I have here. Pavel Milanes, 02/20/2016 02:21 PM
tk790.py (16.5 KB) tk790.py Tom Hayward, 02/20/2016 07:58 PM
tk790.py (30.8 KB) tk790.py draft [I think] Pavel Milanes, 12/06/2024 10:13 PM
tk790_(new).py (35.9 KB) tk790_(new).py latest [I think] Pavel Milanes, 12/06/2024 10:13 PM
tkX90.py (37.1 KB) tkX90.py Fixes to TK-790, and preliminary adjustments to handle TK-690, untested on real hardware Patrick Leiser, 12/10/2024 02:42 AM
tkX90.py (42 KB) tkX90.py Today's update, lots of improvements as described in my comment Patrick Leiser, 12/11/2024 12:58 AM
tkX90.py (42.2 KB) tkX90.py Now downloads well from the radio Patrick Leiser, 12/11/2024 02:15 AM
tkX90.py (43.6 KB) tkX90.py Fully usable version, with upload, download, and a few settings Patrick Leiser, 12/12/2024 03:27 AM

Related issues 3 (0 open3 closed)

Related to New Model #2835: Kenwood TK Commercial seriesClosed08/26/2015

Actions
Has duplicate New Model #2345: SGC SC-2020Closed02/23/2015

Actions
Has duplicate New Model #3307: Would like to pay to have models added to CHIRPClosed02/10/2016

Actions
Actions #1

Updated by Pavel Milanes almost 9 years ago

  • Assignee set to Pavel Milanes
  • Chirp Version changed from 0.4.0 to daily
Actions #2

Updated by Pavel Milanes almost 9 years ago

  • File o.img o.img added
  • Status changed from New to In Progress
  • % Done changed from 0 to 10

Progress people !!!

I have now a working download/upload helper script, I have figured out the mem layout and Checksum. I will be now get busy creating the skeleton of the driver and starting to map the mem.

Attached is the first memory image

Happy weekend.

Actions #3

Updated by Mike Maynard almost 9 years ago

Awesome!! Keep me posted on this

I have not been able to get anywhere with the TK-780 but maybe the more you get going, I may be able to make more sense of it!

Actions #4

Updated by Pavel Milanes almost 9 years ago

The radio has 3 main block of memory that get read independently by different algorithms, for Chirps engine I will concatenate it as follows:

Low memory (Apparently Main CPU data & settings)
0x0000 to 0x4000
Mid memory (Unknown yet)
0x4000 to 0x4090
High memory (Apparently Head memory with channel data)
0x4090 to 0x6090

Data in the mem is at a glance, 73 I get back to work on it.

Actions #5

Updated by Tom Hayward almost 9 years ago

I started on the TK-790H a few years ago. I'm not sure how useful it will be, but here is my work-in-progress. I don't recall how much of this is complete vs copied from another driver and unmodified (for instance, I know I never tried an upload, so the upload code is probably wrong). Hopefully it will save you a little time.

Actions #6

Updated by Pavel Milanes almost 9 years ago

Interesting, I will review it a few minutes.

I'm giving the final touch to the set_channel now, and the download/upload is working well.

The channel management by it self is working fine, but I need so analyze more closely the other areas in which banks vs. channels are arranged, it's at a glance much similar to the TK-760G one.

I will end the set_channel and give a look to you code, I will call it a good night.

Thanks for sharing it.

73

Actions #7

Updated by Pavel Milanes almost 9 years ago

Just an update, I have completed the download/upload, channel management and bank management.

I have a few kirks to resolve with the offset=off and some banks layouts from real radios not working, this is interesting...

This radio has a bank limit and bank belongings section in the memmap, if you start with a clean program with the KPG44D software my driver works fine, but I have found that the former programming from the radio as it get borrowed to me is a kind of corrupted.

It has 9 channels in 3 banks, banks 1, 2 and 160, hum 160... this is weird...

When you looks to the banks limits you see that only 5 channels are covered and in the bank belongings area there are 9 channels; then the radio display the 5 correct channels in banks 1 & 2 where you expect and the other 4 channels are assigned to banks 160...

I have tried to replicate this from a clean KPG44D software layout and it has been impossible to end with a layout like the described (broken) one...

I think it's the result of mixing a radio body with other radio head, as this radio store data in this two places separately...

We are close... 73

Actions #8

Updated by Pavel Milanes almost 9 years ago

Ha !!!

The driver is capable of recognize the band segment of the radio (K 148-174, K2 136-156) automatically and will refuse to program a radio that is not in the same sub band.

Also I need users of this radios with the complex front (a lot of buttons and no front speaker) to contact me, I need an image of this exact model to compare and mod the driver as needed (if needed).

Actions #9

Updated by Pavel Milanes almost 9 years ago

Good news, with the Help of Tom Hayward we tested the two possible front heads for this radio, and I can tell that at a first look they are the same in the memory business.

That's a good news because I don't have to program separate functions to manage two kinds of front heads and that's saved time & efforts.

The first driver is almost done, I have to polish some issues and validate it against Chirp's test bed... I think that for the weekend we will have a patch for it on the "to release" queue.

This first driver will have only channel & banks management, no settings and no buttons; that will be in a second round.

73.

Actions #10

Updated by Pavel Milanes almost 9 years ago

A pre-release version with full channel support and basic banks management is available for who wants to try it; if you like to try please click on my to see my email and drop me an email for driver + instructions.

73

Actions #11

Updated by Pavel Milanes almost 9 years ago

  • % Done changed from 10 to 90
Actions #12

Updated by Pavel Milanes about 8 years ago

Hi people, I'm dropping the development for this kind of radio.

I don't have access to any of this radios anymore, I have made a few attempts with the new fleet owner to borrow one of them again and no joy. The other in possession of a ham friend of mine was QRT (actually fried beyond repair) by a lightning stroke.

The partially working driver is available on request to a willing developer to finish the job. Tom Hayward was the leading person on this radios and I know he can follow the development if he have the spare time required.

73 Pavel CO7WT.

Actions #13

Updated by Tom Hayward about 8 years ago

What work is remaining? I thought it was complete.

By the way, I tried opening the Kenwood .dat file with this driver and a header offset provided by my FileWrapper patch. It mostly works! The only problem is that your upper memory block starts 16 bytes earlier than in the .dat.

Actions #14

Updated by Pavel Milanes about 8 years ago

Hi Tom,

You have in your inbox the latest version from my side (past eamils), fell free to update it with your patch and publish at your will, I can't get one of these on my hands any more to test/play/fix/etc (at least in the foreseeable future).

All the basic features are in the driver I sent you in the past, so after tour tweaks/test it can go public.

73 Pavel CO7WT.

Actions #15

Updated by Bernhard Hailer over 4 years ago

Keeping open until somebody can walk it the final mile.

Actions #16

Updated by Steve Foley 8 months ago

I have a small stack of some TK-790s, I might have a little bit of time to tinker with this code a bit to get it over the line, but I'm new to the CHIRP codebase. Are people still interested in TK-790 programming?

Actions #17

Updated by John Kreno 4 months ago

Yes, At least I am interested. I think there are a lot of these in use in the Amateur community and folks are just getting their hands on the Kenwood software, but Chirp support would be great

Actions #18

Updated by Patrick Leiser 15 days ago

I'd also be interested in further progress on the TK-790 radios. I've been working with the closely related TK-690 radios recently, and would also be interested in working on modifications to the TK-790 software to handle them as well. Is the tk790.py file from Tom Hayward in 2016 still the latest version of the code? Or is a more up-to-date implementation available somewhere?

Updated by Pavel Milanes 15 days ago ยท Edited

Patrick Leiser wrote in #note-18:

I'd also be interested in further progress on the TK-790 radios. I've been working with the closely related TK-690 radios recently, and would also be interested in working on modifications to the TK-790 software to handle them as well. Is the tk790.py file from Tom Hayward in 2016 still the latest version of the code? Or is a more up-to-date implementation available somewhere?

Hi Patrick.

Thanks for your interest on this driver, I'm searching right now for my latest file on this radio. I realized that I never uploaded the changes to this page, let me try to find it...

Bingo!

I found two versions of the files, not knowing what of them is the correct one... I will upload both. Please review it and decide yourself, code is heavily commented for the future me, I think the correct one is the new one; I think...

Knowing that Kenwood loves to make radio families I would bet that the 690 is the same model, just changing the ident; take a peek on the tk-760 & tk-760g family's drivers [yes, they are two different radios] to check how the differentiation and ID works, I just borrowed the schema and I think it's spot on for this models.

Glad to have you on board, don't hesitate to ask anything.

PS: Forgive my python, it was 9 years ago and I was learning it then ;)

Actions #20

Updated by Patrick Leiser 12 days ago

Thanks for the source files Pavel, the tk790_(new) file was a great starting point for my adjustments!

I've got a basic implementation working (based on exported .dat files from KPG-44, I haven't tried programming or reading from the radio directly yet). You were right that the memory layout was basically identical, though I spent a long time digging through it and shifting memory addresses around at first before realizing that the first 64 bytes were presumably just a header used for KPG-44, and not uploaded to the radio itself, and therefore most of the memory rearrangements I'd written were unnecessary. I pushed the code I have so far to my fork of chirp's git repo (https://github.com/Patronics/chirp/blob/master/chirp/drivers/tkX90.py).

Even after truncating the first 64 bytes of the file, my exported file still seems to be 16 bytes longer than the image that was uploaded here originally, I still need to trace down the cause of that discrepancy (it's seemingly not just a direct truncation of the final bytes, since both files end the last block of 0xff with a single 0x13). For now there's a lazy workaround so chirp will open the file. It's 2:30AM here so I'm going to call it a night, but hopefully once I get a chance to import from the radio through chirp directly, that'll be easy to track down.

Actions #21

Updated by Patrick Leiser 12 days ago

Oh also I wonder if it's worth preserving compatibility for existing .dat files from KPG-44D? Since some of the earlier discussion indicates that the 3 blocks of memory each get read and written separately anyway, perhaps it makes sense to keep that 64 byte header, if it's present? This would make it easier to open files from KPG-44D in chirp, then export them back for modifications (perhaps for settings not yet implemented in the chirp driver), rather than deleting the metadata that KPG-44D expects.

I'm not sure if there's any precedent in chirp drivers for keeping data for compatibility with other tools, even if not written to the radio itself, or if that's generally discouraged? It would be a pretty simple modification to make, and I already implemented most of it before realizing that that data was just a header.

Actions #22

Updated by Dan Smith 12 days ago

Patrick, note that the driver you attached appears to be something that won't work in the current version of chirp. It needs to use bytes communicating with the radio, MemoryMapBytes internally, etc. Just FYI in case you're loading and running it from the legacy build that it will take some work to get it into a format that can be acceptable.

Also, the current CHIRP has the ability to define and handle alternate file formats for your .dat case. Here is an example (see also the load_mmap() method).

Actions #23

Updated by Patrick Leiser 11 days ago

Thanks for the heads up Dan. I guess that makes a lot of sense since I've been working on modifying the driver that was originally written by Pavel and Tom in 2016.

Is there a reference document somewhere on the main changes needed for migrating to properly support chirp-next?

Also thanks for the example of the alternate format, that's exactly what I needed! It looks like that example assumes a constant header layout for all files, while in this case there seems to be more metadata in the header that's specific to a given device, but that's a good starting point to work off of anyway, thanks!

Actions #24

Updated by Dan Smith 11 days ago

There are other examples in the tree that stash the header so it can write them back if it just saves the existing file, but unless you know how to generate the header that's the best you can do.

As far as the conversions required, you can see lots of examples in the tree and git history. Getting a DevelopersPython3Environment environment installed, running tests, and the driver against the current version of CHIRP should make it clear.

Actions #25

Updated by Patrick Leiser 11 days ago

I've made quite a bit of progress with this driver, it now handles the header (both stashing it in memory as you describe to write back when possible, or generating it when not (the data in the header mostly matches some data later on in the file). I've also done several of the tweaks that I've been warned about by deprecationWarnings when experimenting with the driver, switching many instances of strings out for bytes, and generally fixing up other issues I found in the behavior, especially in terms of the handling of groups, which weren't quite usable with the previous implementation. It seems much more consistent at loading and properly displaying exported files from the original software, and saving changes to it. I've also started on adding a settings menu to allow reconfiguring the functionality of the configurable buttons (though so far I've just implemented get_settings, and not yet set_settings).

I should probably quit procrastinating on actually loading data to/from the radio, now that I've got the data structure handling more consistent and repeatable. As mentioned above I've pushed the changes to my git repo, but I'll also upload the file here for convenience/reference.

Actions #26

Updated by Patrick Leiser 11 days ago

Okay, loading from the radio now works great! Produces a byte-for-byte identical file to the one downloaded with KPG-44D, aside from a single byte in the model string, which could also be due to the version differences (2.10 is what I have installed vs 2.03 that originally programmed this radio).

Turns out the original script was neglecting to download a single block of the middle memory device, which explains the other offset I was dealing with between the .img file from the start of this thread, and the version KPG-44D was producing.

I'll try to get uploads to the radio implemented tomorrow!

Actions #27

Updated by Patrick Leiser 10 days ago

Okay, I'd say CHIRP is totally usable on my TK-690 now! Downloading and uploading both work great, produce files compatible with the original programming software, and I've started implementing the settings menu too, starting with the fully functional ability to reconfigure button functions. As before the latest code is in my git repo, and I'll upload a copy here too. If anyone has access to a TK-790 to test everything I've been working on with there that would be great, but I wouldn't expect there to be any issues.

I plan to add support for more settings, do a bit more testing and code cleanup, then open a pull request within the next few days or so to officially get support into chirp!

Actions #28

Updated by Dan Smith 10 days ago

That's great news, but I'd really encourage you to focus on getting it passing tests and acceptable in current chirp before expanding it further. I always prefer a minimal driver first, followed by iterative improvements.

Actions #29

Updated by Patrick Leiser 6 days ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100
Actions

Also available in: Atom PDF