[chirp_devel] New Driver Questions - New Dev
I've put together a driver for the TYT TH-8600 that's working for both read/write for memories and basic settings (I haven't yet reversed the 2tone/5tone/dtmf signalling settings). This my first attempt at a driver and I have a few questions:
1. Should I have beta testers of my driver test from my fork prior to submitting a PR, or is there a better/preferred approach to this? 2. The manufacturer's software saves the memory map in a pretty easy to read .icf format. I've noticed that some drivers have a "File" class in addition to the Radio class (for example TYTTH7800File). Is this the mechanism to use to implement the ability for CHIRP to read the manufacturer's memory map files in, if desired? 3. I'm having some issues with tests and am not confident that my driver is actually being tested. This is my first experience with tox, so I'm fumbling a bit. 1. When I run py -3.10-64 -m tox all tests pass, though it takes a really long time to complete. However, I see no mention of my driver in any of the printed output. 2. When I run py -3.10-64 -m tox -e fast-driver all tests pass and it seems to recognize my file as a "touched driver". However, I still see no mention of my driver in any of the tests being run, though I do see mention of some Baofeng models that I haven't touched. Not sure what's going on there. 1. The H777 driver was causing the fast-driver test to fail due to some Chinese characters in the code comments. I had to remove those characters from the H777 driver to get it to run to completion. Not sure how the H777 driver passed. 3. When I run py -3.10-64 -m tox -e driver -- -k th8600 it fails but I'm struggling to understand why: ================================================= test session starts ================================================= platform win32 -- Python 3.10.7, pytest-7.1.3, pluggy-1.2.0 -- C:\chirp.tox\driver\Scripts\python.EXE cachedir: .tox\driver.pytest_cache metadata: {'Python': '3.10.7', 'Platform': 'Windows-10-10.0.22621-SP0', 'Packages': {'pytest': '7.1.3', 'pluggy': '1.2.0'}, 'Plugins': {'html': '3.2.0', 'metadata': '3.0.0', 'xdist': '3.3.1'}} rootdir: C:\chirp, configfile: tox.ini plugins: html-3.2.0, metadata-3.0.0, xdist-3.3.1 created: 8/8 workers 8 workers [0 items]
scheduling tests via LoadScheduling
------------------------------ generated html file: file:///C:/chirp/driver_report.html ------------------------------- =============================================== 1056 warnings in 14.88s =============================================== driver: exit 5 (15.56 seconds) C:\chirp> pytest --disable-warnings --html=driver_report.html -v tests/test_drivers.py -n auto -k th8600 pid=50384 .pkg: _exit> python C:\Python_310_64\lib\site-packages\pyproject_api_backend.py True setuptools.build_meta __legacy__ driver: FAIL code 5 (33.72=setup[18.16]+cmd[15.56] seconds) evaluation failed :( (34.16 seconds)
Any advice is appreciated.
Thanks,
Andy
Hi Andy,
- Should I have beta testers of my driver test from my fork prior to submitting a PR, or is there a better/preferred approach to this?
I've done it both ways. It depends on if I know anyone that has the radio and is willing to provide reasonably good testing. It his case I have a TYT TH-8600 still in its factory state that I can use for testing.
- I'm having some issues with tests and am not confident that my driver is actually being tested. This is my first experience with tox, so I'm fumbling a bit.
I am assuming that you have added a properly named CHIRP Radio Images (*.img) file from the TH-8600 to the /tests/images folder?
It sounds like you may not have included match_model() in your driver so CHIRP is defaulting to an "old-school" detection method which is matching the H777. You need to have something like the following in your driver to tell CHIRP that it should only use the metadata blob attached to the end of the image to identify the correct model.
@classmethod def match_model(cls, filedata, filename): # This radio has always been post-metadata, so never do # old-school detection return False
Jim KC9HI
Thanks Jim, that got me going...I had neglected both the image file and the match_model().
I have a driver that seems to be working and is passing the tests here if you want to give it a try:
https://github.com/aaknitt/chirp/tree/th8600
I haven't done very extensive testing with the radio itself yet and there's some parts of the code I may refactor and clean up a bit. I'm guessing some bugs are still to be discovered.
Andy
Andy
On Fri, Aug 4, 2023 at 7:07 AM Jim Unroe rock.unroe@gmail.com wrote:
Hi Andy,
- Should I have beta testers of my driver test from my fork prior to
submitting a PR, or is there a better/preferred approach to this?
I've done it both ways. It depends on if I know anyone that has the radio and is willing to provide reasonably good testing. It his case I have a TYT TH-8600 still in its factory state that I can use for testing.
- I'm having some issues with tests and am not confident that my driver
is actually being tested. This is my first experience with tox, so I'm fumbling a bit.
I am assuming that you have added a properly named CHIRP Radio Images (*.img) file from the TH-8600 to the /tests/images folder?
It sounds like you may not have included match_model() in your driver so CHIRP is defaulting to an "old-school" detection method which is matching the H777. You need to have something like the following in your driver to tell CHIRP that it should only use the metadata blob attached to the end of the image to identify the correct model.
@classmethod def match_model(cls, filedata, filename): # This radio has always been post-metadata, so never do # old-school detection return False
Jim KC9HI
participants (2)
-
Andy Knitt
-
Jim Unroe