Project

General

Profile

Actions

Bug #10787

closed

Retevis RB15/RB615 use all 99 Memory Slots and use 400 to 480 mhz / Update retevis_rb15.py

Added by M B 9 months ago. Updated 9 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Start date:
08/14/2023
Due date:
% Done:

100%

Estimated time:
Chirp Version:
next
Model affected:
Retevis RB15/RB615
Platform:
MacOS
Debug Log:
I read the instructions above:

Description

Retevis RB15/RB615 does have 99 Memory Slots. The Driver limits CHIRP to read/write only 16 and 21 Memory Slots. The official Retevis programming tool allows to Program 99 Slots on both models.

I can confirm that the Radios transmit and receive on channel 99. As well as they do on 400 to 480 mhz.

The bandwith restriction is only in the Retevis PC software, that doesn't allow anything outside PMR(RB615) respectively FRS(RB15) to be copied to the radios memory. The radio itself is works with programmed channels between 400 and 480 mhz on high an low settings. There is a workaround to deactivate the limitation in the retevis software, so they can be programmed freely. But the software itself is a pain in the ass, so it would be a huge plus to use CHIRP for programming.

See pictures: Transmitting/receiving on Channels 98 and 99 on 400 and 480 mhz. On the Quasheng on the right you can see the receiving frequency.


Files

1692044657085.jpg (350 KB) 1692044657085.jpg M B, 08/14/2023 02:37 PM
1692044616445.jpg (354 KB) 1692044616445.jpg M B, 08/14/2023 02:37 PM
VirtualBox_Windows XP_14_08_2023_22_24_57.png (70.9 KB) VirtualBox_Windows XP_14_08_2023_22_24_57.png M B, 08/14/2023 02:37 PM
VirtualBox_Windows XP_14_08_2023_22_38_12.png (43.5 KB) VirtualBox_Windows XP_14_08_2023_22_38_12.png M B, 08/14/2023 02:37 PM
retevis_rb15_full_band.py (24.8 KB) retevis_rb15_full_band.py Jim Unroe, 08/14/2023 04:48 PM
chirp_debug-xnmsqgnu.txt (57.8 KB) chirp_debug-xnmsqgnu.txt M B, 08/14/2023 05:30 PM
Screenshot 2023-08-15 at 02.24.10.png (311 KB) Screenshot 2023-08-15 at 02.24.10.png M B, 08/14/2023 05:31 PM
Retevis_RB15_20230815.img (2.19 KB) Retevis_RB15_20230815.img M B, 08/14/2023 05:31 PM
retevis_rb15_full_band_2.py (24.9 KB) retevis_rb15_full_band_2.py Jim Unroe, 08/14/2023 08:07 PM
retevis_rb15_full_band_3.py (24.9 KB) retevis_rb15_full_band_3.py M B, 08/15/2023 12:06 AM
Retevis_RB15_20230815.img (2.19 KB) Retevis_RB15_20230815.img M B, 08/15/2023 12:07 AM
Screenshot 2023-08-15 at 08.57.36.png (224 KB) Screenshot 2023-08-15 at 08.57.36.png M B, 08/15/2023 12:07 AM
Screenshot 2023-08-15 at 08.57.19.png (218 KB) Screenshot 2023-08-15 at 08.57.19.png M B, 08/15/2023 12:07 AM
emptyvalues_Retevis_RB15_20230815.img (2.09 KB) emptyvalues_Retevis_RB15_20230815.img M B, 08/15/2023 12:12 AM
Screenshot 2023-08-15 at 19.35.32.png (180 KB) Screenshot 2023-08-15 at 19.35.32.png retevis programmed channel 89 M B, 08/15/2023 10:36 AM
Screenshot 2023-08-15 at 19.35.24.png (181 KB) Screenshot 2023-08-15 at 19.35.24.png chirp programmed channel 90 M B, 08/15/2023 10:36 AM
channelvalues_Retevis_RB15_20230815.img (4.33 KB) channelvalues_Retevis_RB15_20230815.img M B, 08/15/2023 10:37 AM
retevis_rb15_full_band_4.py (24.9 KB) retevis_rb15_full_band_4.py Jim Unroe, 08/15/2023 11:33 AM
retevis_rb15_full_band_5.py (25 KB) retevis_rb15_full_band_5.py M B, 08/15/2023 11:52 AM
Screenshot 2023-08-15 at 20.51.12.png (171 KB) Screenshot 2023-08-15 at 20.51.12.png M B, 08/15/2023 11:52 AM
Screenshot 2023-08-15 at 20.51.21.png (173 KB) Screenshot 2023-08-15 at 20.51.21.png M B, 08/15/2023 11:52 AM
VirtualBox_Windows XP_14_08_2023_22_44_14.png (58.4 KB) VirtualBox_Windows XP_14_08_2023_22_44_14.png M B, 08/15/2023 12:25 PM
retevis_rb15_full_band_6.py (25 KB) retevis_rb15_full_band_6.py Jim Unroe, 08/15/2023 12:38 PM
dtcs_Retevis_RB15_20230815.img (2.09 KB) dtcs_Retevis_RB15_20230815.img M B, 08/15/2023 01:16 PM
Screenshot 2023-08-15 at 22.02.16.png (237 KB) Screenshot 2023-08-15 at 22.02.16.png M B, 08/15/2023 01:16 PM
Screenshot 2023-08-15 at 22.02.50.png (168 KB) Screenshot 2023-08-15 at 22.02.50.png M B, 08/15/2023 01:16 PM
Screenshot 2023-08-15 at 22.02.38.png (167 KB) Screenshot 2023-08-15 at 22.02.38.png M B, 08/15/2023 01:16 PM
Actions #1

Updated by Jim Unroe 9 months ago

  • Status changed from New to In Progress
  • Assignee set to Jim Unroe
  • Target version set to chirp-py3
Actions #2

Updated by Jim Unroe 9 months ago

I have the driver updated and passing all tests. It has been attached to this issue so you can give it a quick test before I submit it. If you have not loaded a test driver module using CHIRP-next before, this page explains how it is done: LoadingTestModules

Actions #3

Updated by M B 9 months ago

I tried it. It does actually download all memory slots. So yeah!

But the editing is kinda broken.
I can copy a whole line and then edit the frequency, but if i try to make a new entry on a new line (or copy in a standard configuration such as pmr channels) it throws an error (list index out of range).
It was the same thing with the old driver, so I dont think it is your changes that are responsible for that.

Log, img and screenshots attatched.
FYI. I copied the line 89 to 92, that worked. And then tried to create a line from scratch by setting a frequency in lines 93 to 95.

No clue what the problem is here.
I can do further testing tomorrow, its 02:30 am here now.

Actions #4

Updated by M B 9 months ago

You can actually reproduce the issue yourself if you open the attached .img file and try to edit it in the way described.

Actions #5

Updated by Jim Unroe 9 months ago

M B wrote in #note-4:

You can actually reproduce the issue yourself if you open the attached .img file and try to edit it in the way described.

Perfect. If I can solve it quickly, I will submit it tonight. If I can't, we can work on it tomorrow. Thanks.

Actions #6

Updated by Jim Unroe 9 months ago

Found the problem. Just made a pull request.

Actions #7

Updated by M B 9 months ago

Thank you so much!

I tested it, the editing works now.

Two last things:
The programmable frequency range with the new driver is now 400 to 519 mhz. But every value above 480 channel does not show up in the radio. Did you set it to 400-519mhz instead of 400-480mhz on purpose?
I changed the "VALID_BANDS" value in line 308 to "VALID_BANDS = [(400000000, 480000001)]" reloaded the module an now everything works fine.

Second, the value for empty slots differs from the stock one.
See img and files attatched, channels 17 to 20 have been programmed empty with retevis software. Channel 90 to 99 have been programmed with chirp and then deleted with chirp and reuploaded. They still show up in the radio and when selected the radio flashes green and red.

I guess that has something to do with that:
# if empty memory
if mem.empty:
_mem.set_raw("\xFF" * 8 + "\x00" * 5 + "\xFF" * 3)
return
in lines 538 - 541

I changed it to
# if empty memory
if mem.empty:
_mem.set_raw("\xFF" * 8 + "\xFF" * 5 + "\xFF" * 3)
return
and now it works.

Do you commit those changes as well?

Updated module is attached btw.

Actions #8

Updated by M B 9 months ago

M B wrote in #note-7:

Second, the value for empty slots differs from the stock one.
See img and files attatched, channels 17 to 20 have been programmed empty with retevis software. Channel 90 to 99 have been programmed with chirp and then deleted with chirp and reuploaded. They still show up in the radio and when selected the radio flashes green and red.

Wrong img in the post above sorry, this one is the one I mean.

Actions #9

Updated by Jim Unroe 9 months ago

M B wrote in #note-7:

Two last things:
The programmable frequency range with the new driver is now 400 to 519 mhz. But every value above 480 channel does not show up in the radio. Did you set it to 400-519mhz instead of 400-480mhz on purpose?

This is the why it has always been. Since the channels were restricted to 462 MHz (FRS) and 446 MHz (PMR), the issue was never discovered.

Second, the value for empty slots differs from the stock one.
See img and files attatched, channels 17 to 20 have been programmed empty with retevis software. Channel 90 to 99 have been programmed with chirp and then deleted with chirp and reuploaded. They still show up in the radio and when selected the radio flashes green and red.

I guess that has something to do with that:
# if empty memory
if mem.empty:
_mem.set_raw("\xFF" * 8 + "\x00" * 5 + "\xFF" * 3)
return
in lines 538 - 541

I changed it to
# if empty memory
if mem.empty:
_mem.set_raw("\xFF" * 8 + "\xFF" * 5 + "\xFF" * 3)
return
and now it works.

I didn't think that this looked right last night and almost changed it. Then I thought that is has been that way for a year with no complaints, maybe I better leave it along. But again, since the 22 (FRS) and 16 (PMR) channels were fixed and could not be (easily) deleted, the bug was never experienced.

I am working on getting the changes committed. Thank you for the testing. I haven't located my RB15/RB615 radios yet.

Actions #10

Updated by M B 9 months ago

Nice! Thank you.
I loaded the new module once more from your githup repo and tested it and it seems to work. It just needs to get merged now.

Actions #11

Updated by Jim Unroe 9 months ago

M B wrote in #note-10:

Nice! Thank you.
I loaded the new module once more from your githup repo and tested it and it seems to work. It just needs to get merged now.

Thank you for the great testing. The clear explanations and photos were very helpful. I didn't attach a "_4.py" since it would have been basically the same as the "_3.py" that you attached.

I did finally find my RB15 and RB615 radios and their programming cable. That allowed me to fully understand what you were describing about frequencies above 480 MHz.

Jim KC9HI

Actions #12

Updated by M B 9 months ago

Ah maybe I called it too early. Can you program new channels from scratch, as in picking a empty slot setting frequency and other values and uploading it. Since I cant, i guess i overlooked that.

Turns out the Retevis Software programmed Channels and the Chirp programmed Channels differ in the Values "unknown1" and "unknown2". Chirp puts a 1 there, it should be a 0 though.

See Images and img file. The channel 89 was programmed with retevis, the channel 90 with chirp. In the Chirp Spreadsheet they show the exact same values.

Actions #13

Updated by M B 9 months ago

I can up and download the channels from the memory, but the radio doesnt show them.

Actions #14

Updated by Jim Unroe 9 months ago

M B wrote in #note-13:

I can up and download the channels from the memory, but the radio doesnt show them.

I see what the problem is. I'm on it.

Actions #15

Updated by M B 9 months ago

While you are at it. Can you set the default value for "encode:1, // Encode" to "0" as well? It doesnt make any difference whether encryption is set or not since the radio doesnt support it.
But it may be confusing for other users to have it activated by default on every newly setup channel.

Actions #16

Updated by M B 9 months ago

M B wrote in #note-15:

While you are at it. Can you set the default value for "encode:1, // Encode" to "0" as well? It doesnt make any difference whether encryption is set or not since the radio doesnt support it.
But it may be confusing for other users to have it activated by default on every newly setup channel.

Nevermind. Doesnt work that easy. When changing the value to 0 it gives a syntax error when reading memory.

Actions #17

Updated by Jim Unroe 9 months ago

M B wrote in #note-13:

I can up and download the channels from the memory, but the radio doesnt show them.

An 'unknown' bit in the memory structure is now known. It indicated if a memory us used (0x00) or not used (0x00). Previously when a memor was deleted all but 3 of the bytes were being set to 0x00 so this bit was 0x00 and all was good. Now when a memory is deleted all bytes are set to 0xFF so all bits are set to 0x01 effectively turning off any newly programmed channels.

There was nothing in set_memory() to set this bit to 0x00 when the memory was programmed so newly programmed channels would remain turned off.

Give this a try before I commit it.

Actions #18

Updated by M B 9 months ago

I can create new channels now.

But the "unknown1" is still 1 in chirp vs 0 in official retevis software. I have no clue what it does but wouldnt it be best to just go along with the official software just to avoid any possible bugs?

Actions #19

Updated by M B 9 months ago

And just for my understanding: To set unkonwn1 and encode both to 0 by default I would just add

    _mem.unknown1 = False
    _mem.encode = False

In the " set_memory() " section?
Does Order matter here?

Actions #20

Updated by M B 9 months ago

M B wrote in #note-19:

And just for my understanding: To set unkonwn1 and encode both to 0 by default I would just add

    _mem.unknown1 = False
    _mem.encode = False

In the " set_memory() " section?
Does Order matter here?

Yes it does.
Now the values are the exact same as with the retevis software.

Actions #21

Updated by M B 9 months ago

Yes it does as in one would just add the values not as in order does matter.

Actions #22

Updated by Jim Unroe 9 months ago

M B wrote in #note-19:

And just for my understanding: To set unkonwn1 and encode both to 0 by default I would just add

    _mem.unknown1 = False
    _mem.encode = False

In the " set_memory() " section?
Does Order matter here?

Well it would depend on what you are trying to do.

False = 0 and True = 1 so you could also use _mem.encode = 0

What are you trying to accomplish? When I create a new channel, Encode defaults to Disabled.

And if you force Encode = 0 in set_memory(), then you basically disabled the Encode setting. Setting Encode to Enabled would never work.

I can do this with mem.isused because there is no setting exposed to the user. It just needs to be set to 0 for every programmed channel. But if someone wanted to, there could be a setting added so you could program 99 channels and turn them off individually without deleting them and then be able to turn them back on again later. Kind of like skipping a channel when scanning.

Actions #23

Updated by M B 9 months ago

You are right. Encode is off by default. I clould swear the default setting for encode with the initial driver was activated. But maybe it was just something odd on my side.
Ah ok. Now I understand what that section does. Thanks.

So what about the unkonw1?
Set the "_mem.unknown1 = False" to be parallel with official software or leave it as it is?

I tested it, it works with "_mem.unknown1 = False" and produces then the exact same memory blocks as the retevis software.

Actions #24

Updated by Jim Unroe 9 months ago

What are you trying to do? There is probably a better way to do it. Which factory software are you using?

Actions #25

Updated by M B 9 months ago

I just thought since we dont know what it does it would be best to have the unknown1 set to 0 as it is the same value as the official software sets it to. Just in case.

But what works works on the other hand. If youre saying its unescessary then it probably is. You for sure know better than I do.

Regarding the software. See image attatched. It was the one that could be downloaded from the website when the radios first entered market. But it seems it is not available anymore.

Actions #26

Updated by Jim Unroe 9 months ago

M B wrote in #note-25:

I just thought since we dont know what it does it would be best to have the unknown1 set to 0 as it is the same value as the official software sets it to. Just in case.

OK. I am on the same wavelength now. That makes sense.

I have included it. I am ready to commit once you give the OK.

Actions #27

Updated by M B 9 months ago

You can download the software here if you want. Link is valid for 7 days.
This software is locked to pmr/frs frequencies.

https://nextcloud.mxbchr.duckdns.org/index.php/s/WE8LfXiwPAnmy5W

Actions #28

Updated by M B 9 months ago

Copy channels, create from scratch, 400 to 479 mhz works now. Radio shows all those channels an tx/rx on them.
Memory blocks are exactly the same as when programmed with tool mentioned above.
Anything else you want me to check?

Actions #29

Updated by Jim Unroe 9 months ago

M B wrote in #note-27:

You can download the software here if you want. Link is valid for 7 days.
This software is locked to pmr/frs frequencies.

https://nextcloud.mxbchr.duckdns.org/index.php/s/WE8LfXiwPAnmy5W

Got it. Thanks

Actions #30

Updated by Jim Unroe 9 months ago

M B wrote in #note-28:

Copy channels, create from scratch, 400 to 479 mhz works now. Radio shows all those channels an tx/rx on them.
Memory blocks are exactly the same as when programmed with tool mentioned above.
Anything else you want me to check?

I think we have it. Unless you disagree, I will commit what we have now. If something else is discovered, we can open a new ticket to cover it separately.

Actions #31

Updated by Jim Unroe 9 months ago

The latest changes have been force-pushed. All tests passed. Just need to patiently wait for it to be merged.

Actions #32

Updated by M B 9 months ago

I think you can commit.

And actually I did discover something else while cross checking with the quansheng.
When no dtcs is chosen CHIRP sets the values "decQT" and "encQT" to "0000". When this is uploaded to the Radio the Radio has selected Ct05 as CTS? Tone. I did not notice because it was the same both rb615 so they could still hear each other. But the rb615 couldnt hear the quansheng withiot any tones set on the same channel.

When I deactivate the CTS/DTCS Tones in the RB615 on a Channel and re-download the memory into chirp then the "decQT" and "encQT" values turn out to be "C000".
This equals no user selectable setting in CHIRP. So its actually impossible to create new channels without CTS/DTCS.

Images and img attached.
98 is chirp default new channel setting, 99 is after deselecting CTS/DTCS on the radio an re-downloading memory.

But although thats a real issue, thats far away from the original topic. So I guess I open a new one?

Actions #34

Updated by Anonymous 9 months ago

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

Also available in: Atom PDF