Bug #10585
closedTYT 7800 communication error
100%
Description
I am trying to use CHIR to program a TYT 7800. I am using Mac OS Ventura 13.3.1 (a) (22E772610a). I am using a TYT branded CP-06 cable. The radio is on with the volume knobs all the way up and not on channels with traffic. I downloaded the latest version of CHIRP today.
When attempting to download the radio there is an error message, " Error communicating with radio. Failed to communicate with the radio: local variable "ack" referenced before assignment." I see a similar report that is still open from last year using Legacy software and a PC. I am successfully able to program my 5R handhelds. I am making this report both because I would like to be able to program my radio, but also this model is listed with a * asking for feedback on Next Model.
[2023-05-20 19:32:11,641] chirp.logger - DEBUG: CHIRP next-20230515 on Darwin John-MBP-16.local 22.4.0 Darwin Kernel Version 22.4.0: Mon Mar 6 21:00:17 PST 2023; root:xnu-8796.101.5~3/RELEASE_X86_64 x86_64 (Python 3.8.2)
[2023-05-20 19:32:11,971] chirp.wxui - DEBUG: Using locale: en_US (276)
[2023-05-20 19:32:11,982] chirp.wxui - DEBUG: Translation loaded=True for CHIRP: en_US (pl,uk_UA,en_US,pt_BR,el,it,ru,zh_CN,hu,nl,de,fr,es,tr_TR) from /private/var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/AppTranslocation/0BC4F4F0-9CCE-47C4-9A83-EFA8A34F852C/d/CHIRP-3.app/Contents/MacOS/chirp/locale
[2023-05-20 19:32:11,989] chirp.wxui - DEBUG: Translation loaded=False for wxstd: en_US (fa_IR,sl,sk,pl,vi,sq,sv,ms,da,gl_ES,pt_BR,ko_KR,ja,el,lv,co,it,ca,zh_TW,cs,ru,ro,zh_CN,pt,uk,an,ar,hr,hu,nl,ne,af,nb,hi,ka,de,ca@valencia,fi,id,fr,es,lt,eu,ta,tr)
[2023-05-20 19:32:12,359] main - INFO: Python/3.8.2 // Darwin/macOS-13.3.1-x86_64-i386-64bit // CHIRP/next-20230515 // wx/4.2.0 osx-cocoa (phoenix) wxWidgets 3.2.0
[2023-05-20 19:32:12,381] chirp.wxui.main - INFO: Ignoring dist stock conf DE Freenet Frequencies.csv because same name found in user dir
[2023-05-20 19:32:12,382] chirp.wxui.main - INFO: Ignoring dist stock conf EU LPD and PMR Channels.csv because same name found in user dir
[2023-05-20 19:32:12,382] chirp.wxui.main - INFO: Ignoring dist stock conf FR Marine VHF Channels.csv because same name found in user dir
[2023-05-20 19:32:12,382] chirp.wxui.main - INFO: Ignoring dist stock conf KDR444.csv because same name found in user dir
[2023-05-20 19:32:12,382] chirp.wxui.main - INFO: Ignoring dist stock conf NOAA Weather Alert.csv because same name found in user dir
[2023-05-20 19:32:12,382] chirp.wxui.main - INFO: Ignoring dist stock conf UK Business Radio Simple Light Frequencies.csv because same name found in user dir
[2023-05-20 19:32:12,382] chirp.wxui.main - INFO: Ignoring dist stock conf US 60 meter channels (Center).csv because same name found in user dir
[2023-05-20 19:32:12,382] chirp.wxui.main - INFO: Ignoring dist stock conf US 60 meter channels (Dial).csv because same name found in user dir
[2023-05-20 19:32:12,382] chirp.wxui.main - INFO: Ignoring dist stock conf US CA Railroad Channels.csv because same name found in user dir
[2023-05-20 19:32:12,382] chirp.wxui.main - INFO: Ignoring dist stock conf US Calling Frequencies.csv because same name found in user dir
[2023-05-20 19:32:12,382] chirp.wxui.main - INFO: Ignoring dist stock conf US FRS and GMRS Channels.csv because same name found in user dir
[2023-05-20 19:32:12,382] chirp.wxui.main - INFO: Ignoring dist stock conf US MURS Channels.csv because same name found in user dir
[2023-05-20 19:32:12,382] chirp.wxui.main - INFO: Ignoring dist stock conf US Marine VHF Channels.csv because same name found in user dir
[2023-05-20 19:32:12,893] chirp.wxui.main - INFO: Server reports next-20230515 is latest
[2023-05-20 19:33:46,819] chirp.wxui.clone - WARNING: Unable to select '/dev/cu.usbserial-1420'
[2023-05-20 19:33:51,145] chirp.wxui.clone - DEBUG: Using port '/dev/cu.usbserial-1410'
[2023-05-20 19:33:51,145] chirp.wxui.clone - DEBUG: Selected
[2023-05-20 19:33:51,151] chirp.wxui.clone - DEBUG: Serial opened: Serial
[2023-05-20 19:33:51,151] chirp.wxui.clone - ERROR: Failed to clone: Failed to communicate with the radio: local variable 'ack' referenced before assignment
Traceback (most recent call last):
File "chirp/drivers/th7800.py", line 576, in _identify
File "serial/serialposix.py", line 616, in write
File "serial/serialutil.py", line 65, in to_bytes
TypeError: unicode strings are not supported, please encode to bytes: '\x02SPECPR'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "chirp/drivers/th7800.py", line 728, in sync_in
File "chirp/drivers/th7800.py", line 597, in _download
File "chirp/drivers/th7800.py", line 583, in _identify
UnboundLocalError: local variable 'ack' referenced before assignment
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "chirp/wxui/clone.py", line 66, in run
File "chirp/drivers/th7800.py", line 730, in sync_in
chirp.errors.RadioError: Failed to communicate with the radio: local variable 'ack' referenced before assignment
[2023-05-20 19:34:15,177] chirp.wxui.clone - WARNING: Stopping clone thread
Files
Updated by John Nokes over 1 year ago
I went to my bothers house today and tried using the software on his PC, unknown OS.
Got the same ack message.
Updated by John Nokes over 1 year ago
I ordered an RT cable and tired again with both radios. No change.
I would consider using RT software but I run Mac.
Updated by Dan Smith over 1 year ago
- Tracker changed from CHIRP-next model report to Bug
- % Done set to 0
Updated by Dan Smith over 1 year ago
John, this radio is not converted for -next yet.
I'm attaching a module to try. Please load it via LoadingTestModules. It's likely this will get further but not work fully. Please try and capture a debug log afterwards and attach it here so I can look. If you succeed with a download, be sure to save that image somewhere safe before you attempt an upload.
Updated by John Nokes over 1 year ago
Dan Smith wrote in #note-4:
John, this radio is not converted for -next yet.
I'm attaching a module to try. Please load it via LoadingTestModules. It's likely this will get further but not work fully. Please try and capture a debug log afterwards and attach it here so I can look. If you succeed with a download, be sure to save that image somewhere safe before you attempt an upload.
Thank you. It might take me a few days to get to this. We just had a severe storm and trees landed on our house, one of our cars and took out our power.
-John
Updated by Dan Smith over 1 year ago
Any update on this? I'm still holding this fix for confirmation. Thanks!
Updated by John Nokes over 1 year ago
Dan Smith wrote in #note-6:
Any update on this? I'm still holding this fix for confirmation. Thanks!
Sorry for the delay. I ended up buying the RT systems and using my bothers computer to program. I would really prefer to use CHIRP and my own computer since we travel a lot.
Both of my radios are fully mounted at the moment and hard to access the USB connection. I have 2 separate RT cables that I left “permanently” plugged in. Do you know if the RT cables are compatible or will I need the TYT cable?
I have attached the log
[2023-07-04 08:07:49,687] chirp.logger - DEBUG: CHIRP next-20230627 on Darwin John-MBP-16.local 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 x86_64 (Python 3.8.2)
[2023-07-04 08:07:50,003] chirp.wxui - DEBUG: Using locale: en_US (276)
[2023-07-04 08:07:50,011] chirp.wxui - DEBUG: Translation loaded=True for CHIRP: en_US (pl,uk_UA,en_US,pt_BR,el,it,ru,zh_CN,hu,nl,de,fr,es,tr_TR) from /private/var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/AppTranslocation/22B2124D-2DA1-4CE3-BB17-F6A903B20C22/d/CHIRP-3.app/Contents/MacOS/chirp/locale
[2023-07-04 08:07:50,018] chirp.wxui - DEBUG: Translation loaded=False for wxstd: en_US (fa_IR,sl,sk,pl,vi,sq,sv,ms,da,gl_ES,pt_BR,ko_KR,ja,el,lv,co,it,ca,zh_TW,cs,ru,ro,zh_CN,pt,uk,an,ar,hr,hu,nl,ne,af,nb,hi,ka,de,ca@valencia,fi,id,fr,es,lt,eu,ta,tr)
[2023-07-04 08:07:50,455] main - INFO: Python/3.8.2 // Darwin/macOS-13.4.1-x86_64-i386-64bit // CHIRP/next-20230627 // wx/4.2.0 osx-cocoa (phoenix) wxWidgets 3.2.0
[2023-07-04 08:07:50,481] chirp.wxui.main - INFO: Ignoring dist stock conf DE Freenet Frequencies.csv because same name found in user dir
[2023-07-04 08:07:50,481] chirp.wxui.main - INFO: Ignoring dist stock conf EU LPD and PMR Channels.csv because same name found in user dir
[2023-07-04 08:07:50,482] chirp.wxui.main - INFO: Ignoring dist stock conf FR Marine VHF Channels.csv because same name found in user dir
[2023-07-04 08:07:50,482] chirp.wxui.main - INFO: Ignoring dist stock conf KDR444.csv because same name found in user dir
[2023-07-04 08:07:50,482] chirp.wxui.main - INFO: Ignoring dist stock conf NOAA Weather Alert.csv because same name found in user dir
[2023-07-04 08:07:50,482] chirp.wxui.main - INFO: Ignoring dist stock conf UK Business Radio Simple Light Frequencies.csv because same name found in user dir
[2023-07-04 08:07:50,482] chirp.wxui.main - INFO: Ignoring dist stock conf US 60 meter channels (Center).csv because same name found in user dir
[2023-07-04 08:07:50,482] chirp.wxui.main - INFO: Ignoring dist stock conf US 60 meter channels (Dial).csv because same name found in user dir
[2023-07-04 08:07:50,482] chirp.wxui.main - INFO: Ignoring dist stock conf US CA Railroad Channels.csv because same name found in user dir
[2023-07-04 08:07:50,482] chirp.wxui.main - INFO: Ignoring dist stock conf US Calling Frequencies.csv because same name found in user dir
[2023-07-04 08:07:50,482] chirp.wxui.main - INFO: Ignoring dist stock conf US FRS and GMRS Channels.csv because same name found in user dir
[2023-07-04 08:07:50,482] chirp.wxui.main - INFO: Ignoring dist stock conf US MURS Channels.csv because same name found in user dir
[2023-07-04 08:07:50,482] chirp.wxui.main - INFO: Ignoring dist stock conf US Marine VHF Channels.csv because same name found in user dir
[2023-07-04 08:07:50,841] chirp.wxui.main - INFO: Server reports next-20230703 is latest
[2023-07-04 08:08:36,677] chirp.wxui.developer - DEBUG: Fetched attachments for issue 10585 (status 200)
[2023-07-04 08:08:36,677] chirp.wxui.developer - DEBUG: Found 1 valid module attachments from issue 10585
[2023-07-04 08:08:40,840] chirp.wxui.developer - DEBUG: User chose attachment {'id': 9312, 'filename': 'th7800.py', 'filesize': 25147, 'content_type': 'text/x-python-script', 'description': 'cb0edbb5', 'content_url': 'https://chirp.danplanet.com/attachments/download/9312/th7800.py', 'author': {'id': 3, 'name': 'Dan Smith'}, 'created_on': '2023-06-09T01:44:41Z'}
[2023-07-04 08:08:40,841] chirp.wxui.developer - DEBUG: Fetching attachment URL https://chirp.danplanet.com/attachments/download/9312/th7800.py
[2023-07-04 08:08:41,908] chirp.wxui.developer - DEBUG: Wrote attachment to /var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/loaded-9312-s4r1uh8u.py
[2023-07-04 08:08:41,911] chirp.directory - INFO: driver re-registration enabled
[2023-07-04 08:08:41,912] chirp.wxui.main - INFO: Loading module /var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/loaded-9312-s4r1uh8u.py SHA256 5914402f3a2472cfd7587fcdda48ad25ebb575fe36e1f80e94a918f6fd887e0b
[2023-07-04 08:08:41,918] chirp.directory - WARNING: Replacing existing driver id TYT_TH-7800_File'
TYT_TH-7800'
[2023-07-04 08:08:41,918] chirp.directory - WARNING: Replacing existing driver id
[2023-07-04 09:04:16,273] chirp.wxui.clone - WARNING: Unable to select '/dev/cu.usbserial-1430'
[2023-07-04 09:04:28,471] chirp.wxui.clone - DEBUG: Selected
[2023-07-04 09:04:28,482] chirp.wxui.clone - DEBUG: Prompt experimental disabled for radio
[2023-07-04 09:05:09,398] chirp.wxui.clone - DEBUG: Using port '/dev/cu.BLTH'
[2023-07-04 09:05:09,398] chirp.wxui.clone - DEBUG: Selected
[2023-07-04 09:05:09,398] chirp.wxui.clone - ERROR: Failed to open serial: [Errno 16] could not open port /dev/cu.BLTH: [Errno 16] Resource busy: '/dev/cu.BLTH'
Traceback (most recent call last):
File "serial/serialposix.py", line 322, in open
OSError: [Errno 16] Resource busy: '/dev/cu.BLTH'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "chirp/wxui/clone.py", line 521, in action
File "chirp/wxui/clone.py", line 139, in open_serial
File "serial/serialposix.py", line 325, in open
serial.serialutil.SerialException: [Errno 16] could not open port /dev/cu.BLTH: [Errno 16] Resource busy: '/dev/cu.BLTH'
[2023-07-04 09:05:18,424] chirp.wxui.clone - DEBUG: Using port '/dev/cu.usbserial-RT8EOK4M'
[2023-07-04 09:05:18,424] chirp.wxui.clone - DEBUG: Selected
[2023-07-04 09:05:18,431] chirp.wxui.clone - DEBUG: Serial opened: Serial
--- Logging error ---
Traceback (most recent call last):
File "logging/
File "logging/init.py", line 925, in format
File "logging/init.py", line 664, in format
File "logging/init.py", line 369, in getMessage
TypeError: not all arguments converted during string formatting
Call stack:
File "threading.py", line 890, in _bootstrap
File "threading.py", line 932, in _bootstrap_inner
File "chirp/wxui/clone.py", line 68, in run
File "/var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/loaded-9312-s4r1uh8u.py", line 726, in sync_in
self._mmap = _download(self)
File "/var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/loaded-9312-s4r1uh8u.py", line 595, in _download
LOG.info("ident:", util.hexprint(data))
File "logging/init.py", line 1434, in info
File "logging/init.py", line 1577, in _log
File "logging/init.py", line 1587, in handle
File "logging/init.py", line 1649, in callHandlers
File "logging/init.py", line 950, in handle
File "logging/init_.py", line 1089, in emit
Message: 'ident:'
Arguments: ('000: 54 48 39 38 30 30 ff ff TH9800..\n008: 56 31 34 78 ff ff ff ff V14x....\n',)
[2023-07-04 09:05:18,739] chirp.wxui.clone - ERROR: Failed to clone: Failed to communicate with the radio: char format requires a bytes object of length 1
Traceback (most recent call last):
File "/var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/loaded-9312-s4r1uh8u.py", line 726, in sync_in
self._mmap = _download(self)
File "/var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/loaded-9312-s4r1uh8u.py", line 598, in _download
msg = struct.pack(">cHB", "R", addr, blocksize)
struct.error: char format requires a bytes object of length 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "chirp/wxui/clone.py", line 68, in run
File "/var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/loaded-9312-s4r1uh8u.py", line 728, in sync_in
raise errors.RadioError(
chirp.errors.RadioError: Failed to communicate with the radio: char format requires a bytes object of length 1
[2023-07-04 09:05:49,993] chirp.wxui.clone - DEBUG: Selected
[2023-07-04 09:05:50,001] chirp.wxui.clone - DEBUG: Prompt experimental disabled for radio
[2023-07-04 09:05:50,859] chirp.wxui.clone - DEBUG: Using port '/dev/cu.usbserial-RT8EOK4M'
[2023-07-04 09:05:50,859] chirp.wxui.clone - DEBUG: Selected
[2023-07-04 09:05:50,866] chirp.wxui.clone - DEBUG: Serial opened: Serial
--- Logging error ---
Traceback (most recent call last):
File "logging/init.py", line 1081, in emit
File "logging/init.py", line 925, in format
File "logging/init.py", line 664, in format
File "logging/init.py", line 369, in getMessage
TypeError: not all arguments converted during string formatting
Call stack:
File "threading.py", line 890, in bootstrap
File "threading.py", line 932, in _bootstrap_inner
File "chirp/wxui/clone.py", line 68, in run
File "/var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/loaded-9312-s4r1uh8u.py", line 726, in sync_in
self._mmap = _download(self)
File "/var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/loaded-9312-s4r1uh8u.py", line 595, in _download
LOG.info("ident:", util.hexprint(data))
File "logging/init.py", line 1434, in info
File "logging/init.py", line 1577, in _log
File "logging/init.py", line 1587, in handle
File "logging/init.py", line 1649, in callHandlers
File "logging/init.py", line 950, in handle
File "logging/init_.py", line 1089, in emit
Message: 'ident:'
Arguments: ('000: 54 48 39 38 30 30 ff ff TH9800..\n008: 56 31 34 78 ff ff ff ff V14x....\n',)
[2023-07-04 09:05:51,177] chirp.wxui.clone - ERROR: Failed to clone: Failed to communicate with the radio: char format requires a bytes object of length 1
Traceback (most recent call last):
File "/var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/loaded-9312-s4r1uh8u.py", line 726, in sync_in
self._mmap = _download(self)
File "/var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/loaded-9312-s4r1uh8u.py", line 598, in _download
msg = struct.pack(">cHB", "R", addr, blocksize)
struct.error: char format requires a bytes object of length 1
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "chirp/wxui/clone.py", line 68, in run
File "/var/folders/4x/6wfm6l651290qjj41g7rqv7c0000gn/T/loaded-9312-s4r1uh8u.py", line 728, in sync_in
raise errors.RadioError(
chirp.errors.RadioError: Failed to communicate with the radio: char format requires a bytes object of length 1
[2023-07-04 09:07:04,622] chirp.wxui.clone - WARNING: Stopping clone thread
Updated by Dan Smith over 1 year ago
Ah, dang I missed a conversion. Updated file to try please.
The cables might work yeah. If they show up as a /dev/ttySomething then they should. There was some generation of RTSystems cables that did not present regular asynchronous serial endpoints and those are not (without a firmware flash). If it show up, it should be okay.
Updated by John Nokes over 1 year ago
Dan Smith wrote in #note-8:
Ah, dang I missed a conversion. Updated file to try please.
The cables might work yeah. If they show up as a /dev/ttySomething then they should. There was some generation of RTSystems cables that did not present regular asynchronous serial endpoints and those are not (without a firmware flash). If it show up, it should be okay.
I just tried it on one of my radios, it worked. I was able to download the program.
On a quick review, the only thing that stands out to me is that under settings and model info it shows this is a 9800. I am sure this does not affect anything but I wanted to let you know.
Thank you for doing this. I did reply to your email this morning, but did not see the kick back until this evening.
Let me know if I need to do anything else or if you need anything. This has made things a lot simpler for me.
Thank you,
John
Updated by Dan Smith over 1 year ago
Thanks for the confirmation! Did you try an upload? That's a separate code path so I'd definitely like to make sure that works. Be sure to save an image in case it fails.
Updated by Dan Smith over 1 year ago
Also, there is a note in the code about the 7800 vs 9800 issue. Apparently TYT forgot to rename something in the firmware or some such thing. Anyway, expected as far as I can tell :)
Updated by John Nokes over 1 year ago
Dan Smith wrote in #note-10:
Thanks for the confirmation! Did you try an upload? That's a separate code path so I'd definitely like to make sure that works. Be sure to save an image in case it fails.
When I try and upload the vendor and model are "grayed" out.
I get the attached message.
Updated by Dan Smith over 1 year ago
Yeah, upload never lets you choose a vendor/model because the image dictates it.
Can I get the debug log for that? that's the only way I'll know where that comes from :)
Updated by John Nokes over 1 year ago
Dan Smith wrote in #note-14:
Ah I think I might have guessed it. Here's yet another to try. Thanks very much for your help and patience (the other TH-7800 users appreciate as well :)
I did not send a log since it gave me a log error......
Yes, whatever you guessed worked. I uploaded a test file and then reloaded my pervious file with no issue.
Awesome! We really do appreciated it!
Updated by Dan Smith over 1 year ago
- Assignee set to Dan Smith
- Target version set to chirp-py3
Excellent thanks, I'll push this for tomorrow.
Updated by Dan Smith over 1 year ago
- Status changed from New to Closed
- % Done changed from 0 to 100
Applied in changeset github|aacf79520fb31221660d2a60f9544808e97cde9a.
Updated by Frank Torontour over 1 year ago
- File DR235T_bug.jpg DR235T_bug.jpg added
I am getting the same error with my Alinco DR235T when I try and send to the radio.
I am using chirp version-20230706 Python-3.9.2
Updated by Dan Smith over 1 year ago
Frank, please attach your debug log so I can see the issue in more detail.