I really have no idea how to debug past this. No knowing Python or this code, all I can do is capture the errors and pass along out.txt.
Okay, maybe there was some misunderstanding about the intentions here. I thought you were looking to learn enough Python to write the driver (several people have). If not, this may not be a very realistic endeavor (but read on).
I've tried commenting out the majority of the code and still get the same errors.
I commented out the majority of the code and it seems to get pretty far. Attached is an updated copy where I did the following:
- Spotted the rtone and ctone fields in your two memories and moved the appropriate bits in the structure definition to match - Guessed about where the dtcs code is stored - Spotted the "used" bits (which tell us which memories have valid data in them) and changed the structure definition to match - Commented out the code that looks for: - skip and pskip bits - tuning_step - mode - duplex - power - dtcs polarity - tone mode
With the attached code, I'm able to open your .img file and see your first two memories (frequency, tones, alpha labels, and offsets).
If you right-click on one of the memories and choose "Show Raw Memory" you can see how chirp has parsed the data into the structure definition. The "Diff Raw Memories" option is pretty handy for sussing out the differences between two almost-identical memories (and is how I typically most of my bit sniffing for these).
At a very minimum, the following needs to be done:
- Finding the tone mode bits (None, Tone, TSQL, DTCS, etc) - Finding the mode bits (FM and AM presumably?) - Changing set_memory() to match the changes in the structure as needed - Removing all the commented-out code that remains after finding this stuff - Test/fix uploading to the radio
Ideally we'd also find the remaining bits covered by the commented-out code, but even if we don't, I think it'd be usable with just the above.
I suppose if you're not interested in attempting any of the code stuff, I can make those changes if you're willing to sniff out the bits. I normally won't develop by proxy like this, but the radio appears pretty simplistic, and it's pretty close to usable right now.
I've attached the updated .py file, and included a diff of the changes I made below. How would you like to proceed? I sense your frustration with what I expect is a difference of expectations about what this process would be, but I appreciate the work you've done so far and I think we're pretty close to having something worth putting into the tree.
Thanks Drew!