-
Notifications
You must be signed in to change notification settings - Fork 8
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
Help with embedded outbound Reverse Channel information #8
Comments
Hey @kantooon
https://github.com/OK-DMR/ok-dmrlib/blob/master/okdmr/dmrlib/etsi/crc/crc.py#L291
Not sure why you have final_xor_value=0x7A |
Hi, thanks for responding, answers below:
Unfortunately I don't. I'm writing this blind, and the only way of testing it is with my radios (Hytera HP785, manual says it supports transmit interrupt and power control).
ETSI TS 102 361-1, section B.3.12 Data Type CRC Mask, table B.21, reverse channel has a CRC mask of 0x7A. Isn't that the purpose of final_xor_value? Also, if you can, is it possible to add odd parity option to VBTC3211 as in B.2.2.2 Reverse Channel Single Burst BPTC? |
Ok, data type mask, i handle those differently since the CRC impl is typically not data-type-specific, indeed I think that's where your problem might be If you take a look for example in CRC9 ok-dmrlib/okdmr/dmrlib/etsi/crc/crc9.py Line 51 in fdb3fa7
I apply the mask to calculated and two-complement value of CRC, you can try similar flow, coding the crc's was the most tricky part for me as well :)) And last, how did you figure your payload is not taking effect because of invalid CRC ? Working with Hytera radios sometimes the reason is codeplug settings or licensing or just straight firmware bug. If you're able to capture full traffic with your MS as PCAP, we could maybe see more? I guess you're already aware of pcap tooling we have |
Thanks for the advice, I'll try this method as well, but for CRC9 the standard specifies an inversion polynomial, whereas for CRC7 it explicitly says there's no inversion polynomial.
I guess I will need to double check the codeplug, power control is explicitly enabled, but there's no setting for receiving TX interrupt, only for transmitting. As far as licenses, I'm covered, the tier III license has everything. |
Regarding the network, suffices to capture network traffic between mmdvmhost (i assume you have some rpi hotspot or similar) and your computer (hblink maybe?), pcap can then be filtered and data extracted using dmrlib-pcap-tool, usually simply running "dmrlib-pcap-tool PATH_TO_YOUR_CAPTURE.pcapng" shows you data and stats, then you can fiddle with cli switches, see help
|
Oh I see what you meant with pcap. The RC PDU is only trnsmitted via RF currently, but I can also add it to the network transmisssion so I can wireshark it. I don't have a classic hotspot, my setup is all SDR-based and running on x86_64 Linux. If you're curious, my test tier III system consists of a LimeSDR family device, qradiolink as lower PHY with 7 RF channels multiplexed in GNU radio flowgraphs, and some custom forks of MMDVM and MMDVMHost called MMDVM-SDR and MMDVMHost-SDR. The RC PDU transmit is initiated from the trunking controller (dmrtc) and sent on the alternate logical channel (it only works with aligned timing and not offset timing). |
very impressive, i've yet to work more with downlink and Tier-III PDUs, and the reason is i don't have them captured (i have SDR but it wasn't my priority so far to get it), if you could supply me with the on-air data, i would add a support for all these PDUs and routines to handle them. Regarding form of the data, you can take inspiration from our and lwvmobile's last-years adventure with dsd-fme "DSP structured output" lwvmobile/dsd-fme#94 (comment) And last I guess your note about aligned/offset timing is just the current state of implementation, not actual AI protocol limitation? |
Yes sure, I use dsd-fme as well to test PDUs. Let me know what PDU captures you need, I already asked lwvmobile for a few changes in the DMR decoder and supplied him with some captures off the air. The aligned timing limitation is specified in the standard at 5.1.1 Channel timing relationship. |
I'm going to close this now, as I haven't been able to find the solution yet, but I'm busy with other stuff. I'll come back to this later with a fresh perspective and if I find the right solution I'll also let you know. |
Keep it open, its bookmark for my brain as well, thanks and good luck 🤞 |
@kantooon and because I became interested, i made some progress, you can check it 1a00ff4 However yes, currently CRC7 does not seem to match the data (which was extracted from Hytera IPSC protocol, so it might not be valid in the original IPSC payload as well) Before the Single Burst RC BPTC encoder, the appropriate CRC Mask as defined in clause B.3.12 of the Few records from log c3520050d1f6000001000501010000001111cccc1111000040b80022040220024460220002000104808f6460b252602000650022040220024440b8020000000006010000ce432800 c3520050d7f6000001000501010000001111cccc1111000040b81d8ed769d5d5c5371f08b0c04113f9865321b58254a58012d5d5425f515188acb8c00000000006010000ce432800 |
I think this is great news, I'll go generate the RC PDU again and compare it with the previously generated one. I can test the channel pre-emption over RF as well, but it's a little more convoluted, requires some changes in the trunking controller as well. |
I just ran the new reverse_channel code on the PDU's I had already computed months ago. They are a a match bit for bit, so either the code is correct, or we both made the same mistake somewhere. These are also recognized by dsd-fme as such. From my previous testing, my Hytera radios don't respond to these reverse channel commands. It may be a CPS setting that I haven't found, or they might use some proprietary, non-ETSI PDU, not sure which. |
Ok, i'm truly sorry, this has been a rabbit hole for me, turns out the initial test data are not correct, and I wasted few more hours trying to get it working I need to get at least a single RC PDU (embedded or standalone) , which is verified to be complete and with valid CRC, please help me out if you can, @lwvmobile might have data maybe Thanks |
I cannot get it out of my head, few sanity checks, i think i'm going crazy 1a) Parity - odd (zeroes==ones), even = (both counters should be (%2==0)), right?
1b) Parity for all RC signalling should be "odd", so "even" should indicate "transmission bit-flip error", right? 1c) Parity should match, regardless of CRC Mask used, right? 2a) Distinguish embedded RC PDU (32bit) from LC fragment, these two conditions must be met, otherwise it's definitely not RC PDU, right? 3a) i've found lwvmobile/dsd-fme#187 which seems my and lwvmobile implementations now match, which is unfortunate 4a) All RC embedded pdus I have have "even parity", which means they are not suitable for implementation/testing, Also i found voice encryption by Chowdhary which places encryption params in the same places, but that should not be what i'm seeing in data captures, https://patentimages.storage.googleapis.com/df/89/8c/2b85c61f329b5b/US8422679.pdf |
lwvmobile's implementation was independent, and it decodes my PDUs which are based on your code, it seems unlikely we all made the same error. It's more likely Hytera uses some other proprietary signalling I think. |
Just for what its worth, I don't think I've ever seen an actual Reverse Channel burst in real-life application for a system I've decoded. I have only ever seen the Single Burst, and its always one of three values: 1. TXI. 2. Encryption Key/Alg. 3. All Zeroes/Null. All of the above are not per any sort of ETSI standard, aside from the BTPC encoding and parity. The CRC on the TXI pdu is different, and non-existent when it carries the Encryption info. TXI Patent: https://patents.google.com/patent/US8271009B2 Other than that, I have seen a variety of Tytera/Retevis radios signal something in the single burst that results in decoding errors from dsd-fme, so it is either random/garbage padding fill, or some other form of encoding scheme that isn't BPTC that only those CCR radios can interpret. |
Hi, im currently looking on that issue too. This is closest i came (one bit error OTA). i have an idea that there is something issue in vbptc3211. maybe double de/interleave or in algo. Lets see below. as example i generate reverse channel with command Cease Transmission Command (0100). File contents at the end of this comment. Im using your previous vbptc_32_11 version without odd parity.
just for sure here is deinterleaved all 32 bits from origin and from dsd-fme from that we can see there is difference in parity check bit PC[7]: just for checking if parity check is okay i will split both into two lines to see inverting 0->1 and 1->0: origin - here we are correct: dsd-fme - here is mismatch maybe caused by OTA: I captured it with SDR# with noise floor -45dB and signal close to 0dB, so maybe there can be reason for that bit mismatch. However interesting is that dsd-fme didn't output any RC information also no "99" lines in DSP file. Not sure why. In attachments there is DSP file for these data. all same bursts was sent to Hytera. (will be if i find working web browser) As frame_type and slot_type for Hytera i used slot_type_data_f and frame_type_data. I tried also for different type. if i put RC into CSBK Preambles, So now what is different? When i saw @smarek RC Info bitarray that i see that parity check is wrong calculated. So there from what i believe is issue in vbptc_32_11 file in interleaving. code at the end of comment. Unfortunately also in these transmitted bursts there is a lot FEC failures. not sure if it is because of signal or because of weaker protection. Dont know...
vbptc_32_11.py.new is latest from master 75d6f52. and left file is what im using from previous version.
|
In CPS v9 is in developer menu option to choose if radio will support only ETSI (v1.7.1) format for RC, or Hytera format plus ETSI same version. So only two options. According to ETSI docs v1.7.1 that means that V9 Hytera radios does not support Cease transmission request. However Cease transmission command they should support. No more switches i didnt find there. |
I looked over the code for DSP output on the SB/RC, and I've found a bug in DSD-FME that may produce invalid results on the 99 line (contained to just the DSP file itself, not the internal decoding of SB or RC). Also, it is currently only set to dump the RC with designation 99 if the p/pi indicator bit is set to 1, and its not all zeroes. I will change that to always dump, if either or. I do need to push an update to fix the array overflow for that output, but also need a bit of feedback first, and potentially a few .bin samples with RC information in it, either from a radio, or crafted, and you tell me what is supposed to be in said RC or SB so I can make sure that it is correct. Also, if desired, I can add an indication on the line to indicate whether the p/pi bit is on or off, or whether or not it is a single burst, or reverse channel burst by appending it to the hex output on that line. Just needed to check to make sure that doesn't break any import scheme or not first. |
Sure. here are files for you both. idle_rc.bin.txt Just as info i transmitted only F bursts with 360ms spacing, so other non-F bursts may be filled by repeater itself with something unknown. LCSS=0 (SingleFragmentLCorCSBK), PremeptionPowerIndicator=1. whole 48bits carries CC=1, PI=1, LCSS=0, EMB parity. inside 32bits RC is CeaseTransmissionCommand, CRC7, Hamming, parity check. |
I had a lot of errors in your capture, any chance you can clean up your reception by tweaking settings and so on with SDR#, making sure your radio isn't overloading the front end of your SDR, and so on? Watching the output of dsd-fme console log is a good indication. I couldn't do much with the first bin file, too many errors. |
Here are new files. i transmitted 12 bursts, but there is also repeater delay for transmittion. few more tests decoding in dmrlib tool. parity check correct: |
Alright, that one still had some errors in it, most likely from your radio overloading the front end of the SDR, but it was good enough to get a few good RC bursts out of it for testing. Did have a couple of random questions, though. Here is a snippet of output from DSD-FME.
Is your embedded signalling for VC B-E for link control broken? Every single instance all produced an FEC error. Speaking of which, didn't capture a single voice link control header not a termination link control header (VLC and TLC in DSD-FME vernacular). When the Reverse Channel hits, does it knock out both Voice in E and F? Both of those voice frames show errors, otherwise you get the standard silence vector from AMBE+2. Isn't it just supposed to drop F? When you are active, your activity update slow link control shows both timeslots are IDLE status with a 0 hash value. Shouldn't that have the 8-bit hash of your target or talkgroup value in it? When you stop transmitting, I noticed the slow link control goes to a NULL message with all zeroes in it. |
I didnt generate any A-E Voice bursts. Let's me explain little better that. Those generated F only bursts are instead of voice payload filled with Idle pattern and sent over IP network to repeater as it gives me better flexibility for experimenting. So repeater is filling those A-E bursts with something unknown to me for just keeping transmitting continuously (maybe with idle only for keep channel open before hangtime). That means in receipent handheld radio i listen just buzzing ticks every 360ms same as you can hear in dsd-fme. Edit: Also i looked on those 2 bursts which was decoded with dmrlib as in current master - dmrlib is not implemented RC decoding (its just mine modified version) gives me idea that it is from "10" lines in dsp file from latest idle_rc2.dsp. actualy is one closest "10" line after 99 line which means for what i assume that dsd-fme didn't decoded it. |
Oh, okay, I understand better now how the samples were generated and what ended up being decoded on them. As far as RC, from the appendix of 361-1 (Tables E.X), seems like they can be with voice, standalone without anything at all(dead air), NULL(zeroes), or be the same as a data sync burst but where the sync pattern for data is replaced by the RC channel data, which I assume also occurs on VC-F bursts. Those types can be encoded as BPTC or 3/4 Rate Trellis Data. Internally, I don't have a check down for looking to see what is in the VC-F location, whether it should be voice or data when the P/PI bit is set or anything, it just assumes voice and produces those errors in AMBE when played as such. May have to implement that one day in the future, but would require quite a bit of rewrites, which I had not planned on doing, so most likely won't be happening, but I may leave in a bit of test code to just push any potential RC data through both data and voice, and see if one or the other produces any actual results, such as decoding a single data burst, whatever kind usually may accompany a BPTC general data burst with RC, for example. On a related note, DSD-FME (when DSP output is fixed, anyways, for RC) will produce both a line for the RC data, and the complete VC frame, but is that really necessary. Reason I ask, we already have the RC data embedded in the middle of the VC frame where the sync pattern would be on VC-A, so, isn't it kind of redundant?
|
By me its already okay in dsd-fme as it seems working. Im here to just maybe help smarek and kantoon them in RC encoding implementation. About that 99 line i think its place here for answer from smarek. |
Hi, I'm trying to implement in MMDVMHost the DMR tier III reverse channel commands for MS de-key and MS power control.
I use ok-dmrlib to generate the 32 bit PDUs, but the radios do not respond to the commands so there seems to be some issue with my code.
I figured out by myself that in VBPTC3211 I have to invert the parity bits row to odd in the set_parity() method and changed it accordingly. I'm not so sure about CRC7 configuration.
I wonder if you could help me troubleshoot my ok-dmrlib code below. Otherwise, the EMB fields are set with LCSS 0, PI 1 and correct colour code. The PDU is only transmitted in voice burst F so that seems fine as well.
The text was updated successfully, but these errors were encountered: