Pi-Star_DV_Dash icon indicating copy to clipboard operation
Pi-Star_DV_Dash copied to clipboard

preserve dmr extended id when applying changes with dmr mode disabled

Open narspt opened this issue 4 years ago • 8 comments

Currently DMR extended id is discarded every time we apply changes with DMR mode disabled but either YSF or P25 modes enabled (so that the main id field shows and is posted), it's annoying to always lose DMR extended id when switching modes :)

narspt avatar May 13 '20 07:05 narspt

The DMR ID is used for P25, it can also be used for YSF2DMR and YSF2P25 also. Where the main ID is set, it should only ever be 7 digits long, and not extended.

AndyTaylorTweet avatar May 13 '20 09:05 AndyTaylorTweet

Yes, I know it. My patch doesn't touch main id at all or changes any behavior, it is intended to just fix DMR id losing extended id when you Apply Changes with DMR mode disabled (and either YSF or P25 modes enabled).

If you see it with care, the line I changed (967) is actually executed when either DMR, YSF or P25 modes are enabled (the only cases where $_POST['dmrId'] is posted), and on that line without my small change $configmmdvm['DMR']['Id'] always loses extended id, but if DMR mode is enabled then ID is "recovered" just below at line 977, the problem happens if DMR mode is disabled and YSF/P25 enabled then it loses extended id at line 967 and doesn't recover at line 977, you see what I mean? To reproduce it you just need to disable DMR mode and enable YSF/P25 then Apply Changes, then when you re-enable DMR and Apply Changes again the DMR extended id will be missing. After my patch it always preserves current extended id at line 967, but still updates main part of DMR id if main id is changed, then extended id is still updated at line 977 if it is posted else we keep existing one...

narspt avatar May 13 '20 13:05 narspt

Let me test that out - I am sure you are correct, but I want to see it before I pull this in... thank you :)

AndyTaylorTweet avatar May 13 '20 13:05 AndyTaylorTweet

Sure, thank you :)

narspt avatar May 13 '20 15:05 narspt

@AndyTaylorTweet: sorry to persist but please don't forget to look at this, it's really annoying to always lose the extended id when switching modes from DMR to YSF and then back to DMR...

narspt avatar Feb 04 '21 16:02 narspt

I've tested this, but I dont see how this is supposed to work, the DMR ID field should only have a 7 digit (or maybe 6 digit if its a repeater) ID in it, the service should contain the SSID - what am I missing?

AndyTaylorTweet avatar Feb 04 '21 17:02 AndyTaylorTweet

Read my 2nd comment with care where I tried to explain how the id is lost on the code and what is the idea of my fix to preserve it https://github.com/AndyTaylorTweet/Pi-Star_DV_Dash/pull/103#issuecomment-627977299

And you can test it easy, for eg. you have extended id set to 02, then you disable DMR and enable YSF, then switch it back by disabling YSF and re-enabling DMR (you will be applying settings with DMR option currently disabled, this is when the problem happens) and you will see extended id is lost and now set to None instead of 02 as it should.

narspt avatar Feb 04 '21 17:02 narspt

dmrextid.zip I'm probably not being able to explain the issue correctly, please look at the video and the image attached and I'm sure you will then understand what I mean. (I had to zip them as github doesn't accept the video file)

narspt avatar Jun 07 '21 07:06 narspt