Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic support for Baofeng BF-T20D and W31D - closes #11671 #1207

Merged
merged 1 commit into from
Dec 27, 2024

Conversation

socram8888
Copy link
Contributor

@socram8888 socram8888 commented Dec 19, 2024

WIP attempt to add support for those two walkies. More MIGHT actually work but those are the ones I can personally try.

Missing:

  • Setting walkie talkie settings (already identified the location and settings, just not done yet)
  • Round TX/RX frequency based on firmware version. Some older are only able to use frequencies rounded to the nearest 5KHz, instead of 2.5KHz and 6.25KHz like the v1.05 I have.

Working:

  • Edit all channel settings

@socram8888 socram8888 force-pushed the bfdigital branch 6 times, most recently from 1544280 to 5b49839 Compare December 19, 2024 23:39
rf.memory_bounds = (1, self._proto.chan_count)
rf.valid_bands = self.VALID_BANDS
rf.valid_duplexes = ["", "+", "-", "split"]
rf.valid_modes = ['FM', 'NFM', 'DIG', 'DN']
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DN means Yaesu system fusion, so unless this radio implements that, you may not use DN here. Also DIG is reserved for the digital setting in HF radios. It's not a good use of the mode, but that's what it has meant in CHIRP in the past, so it needs to remain.

CHIRP needs a consistent view of the world in terms of what modes mean, so that you copy a memory from one radio to another, we can select the proper mode or reject it if it's not compatible. For example, if you open an FT3DR image and copy a DN memory out of it and paste into this radio, CHIRP should reject that paste because your radio doesn't support actual YSF DN mode (assuming the above).

What digital mode is this actually?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have absolutely no idea. Their sales pitch says it's GMSK, and that is all the information I have.

It supports 25KHz and 12.5KHz using the same modulation, and I don't know any standard mode that uses that modulation with variable width?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah there has to be more than just GMSK. Also I doubt it's 25kHz or 12.5kHz wide, but rather those are the channel spacing recommendations, but who knows for sure I guess.

How about we just support FM,NFM and make the digital mode a .extra toggle for now (i.e. FM+extra['digital'] means "25kHz wide in digital mode" ? Sort of like we do for radios with the "scrambler" modules - we don't consider that a different mode, just a flag on an existing one. If we figure out that it is actually something else (or a second radio starts supporting it) we can add it into the mode list?

@kk7ds
Copy link
Owner

kk7ds commented Dec 20, 2024

Other than the DIG/DN thing, this looks good now I think. What was the answer on the commented-out second model? Did you get it tested or was I not clear about what I was suggesting?

For the module, if you leave it out of this file and we commit it, then you can attach a copy of the file with the second radio definition (or with only that) to an issue and people can use Help->Load from issue to try it out. If you're not sure that it works, the module route would be safer.

@socram8888
Copy link
Contributor Author

Not sure if you'd agree but regarding the mode, I think it would make sense to actually add a new one, as there's already a myriad of other Baofeng walkies using it (see that linked Wiki page where they've certified seven, and they actually had even more listed in the CPS source code which might be for either domestic use or non-US).

I'll try to figure out looking through the documentation if they've given it any particular name, other than a generic "GMSK mode". I might also try contacting the email on the back of the manual (wangjianhui(a)baofengradio.com) to see if they can clarify a bit.

Regarding the BF-T20D I thought you meant I should create a new issue and did it: https://chirpmyradio.com/issues/11742

@kk7ds
Copy link
Owner

kk7ds commented Dec 20, 2024

Not sure if you'd agree but regarding the mode, I think it would make sense to actually add a new one, as there's already a myriad of other Baofeng walkies using it (see that linked Wiki page where they've certified seven, and they actually had even more listed in the CPS source code which might be for either domestic use or non-US).

I'll try to figure out looking through the documentation if they've given it any particular name, other than a generic "GMSK mode". I might also try contacting the email on the back of the manual (wangjianhui(a)baofengradio.com) to see if they can clarify a bit.

I'd really prefer we not add a mode until we have some strong indication. The chinese manufacturers tend to just go in a thousand directions at once and have created a huge mess with all the duplicated/cloned models, and even radios with identical model numbers as others despite being totally different radios.

If we limit it to just FM/NFM with a digital flag for the moment, we can get this merged sooner while we figure out what the digital mode actually is and what to call it.

I'm not sure what wiki page you're referencing, but post a link and I'll have a look.

Regarding the BF-T20D I thought you meant I should create a new issue and did it: https://chirpmyradio.com/issues/11742

That's fine, just snip out the radio class you're not sure about from this one for us to merge, but add it back to a temporary file and attach that to the issue. Then someone can test it in isolation using this procedure before we merge it.

@socram8888
Copy link
Contributor Author

The page I'm mentioning is https://www.sigidwiki.com/wiki/Baofeng_GMSK, which also lists all the FCC reports for the different models that share the same digital mode.

I'll replace it for now with a digital flag, but I really think that should have its own mode given they're different models that are interoperable between them.

@kk7ds
Copy link
Owner

kk7ds commented Dec 20, 2024

The page I'm mentioning is https://www.sigidwiki.com/wiki/Baofeng_GMSK, which also lists all the FCC reports for the different models that share the same digital mode.

Ack, thanks, I was just reading the FCC report on the W31D. Even that wiki page says it's not clear what exactly is going on.

I'll replace it for now with a digital flag, but I really think that should have its own mode given they're different models that are interoperable between them.

Thanks, I'll do some thinking about how we might make it easier to support some bespoke modes like this without having to enum everything. I'm sure the future will bring more of this than less :/

@socram8888
Copy link
Contributor Author

Just to be 100% sure - you'd prefer to wait until there's a better way to add new modes, yes? Or add that digital switch in the extras?

@kk7ds
Copy link
Owner

kk7ds commented Dec 27, 2024

Sorry, no, I'd rather add it with the digital extra toggle now and ponder the other mode thing after we merge. I've spent a little time thinking about it so I have some ideas but with the holidays I haven't tried to implement anything. We should get this merged with just the extra toggle if you're willing though.

I was going to push to the build queue tonight for a build tomorrow, FYI.

@socram8888
Copy link
Contributor Author

Alright. I've made a change and now the same "encryption key" setting is now used to select either analog (default) or digital, by setting any of the 32 possible keys.

@kk7ds
Copy link
Owner

kk7ds commented Dec 27, 2024

Okay, cool. Also you still have the other BaofengBFT20D model in there. If you're not sure about it, I can snip that out before I merge and attach as a module to the other bug to avoid advertising that it's fully supported. Should I remove it?

@kk7ds
Copy link
Owner

kk7ds commented Dec 27, 2024

Okay, well, I assume that's the plan for the moment anyway. So I pushed to snip that off and rebase so I can merge this for tomorrow.

@kk7ds kk7ds merged commit 4344962 into kk7ds:master Dec 27, 2024
6 checks passed
@kokroo
Copy link

kokroo commented Jan 6, 2025

@socram8888 I can help you test the Baofeng T20D.
Is there any way I can read the data from the Radio and send it to you?
I checked the FCC reports and it seems like the internals on the T20D and W31D are probably the same.

@kk7ds
Copy link
Owner

kk7ds commented Jan 6, 2025

@kokroo Instructions and a module to try here: https://www.chirpmyradio.com/issues/11742

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants