-
Notifications
You must be signed in to change notification settings - Fork 417
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
M17 packet mode needs an update #1826
Comments
|
Since SDRangel is the most convenient way to send M17 packets, could we have this update? |
SDRangel m17 modem is based on this https://github.com/mobilinkd/m17-cxx-demod/commits/master/include/m17cxx - which doesn't seem to have had any changes since it was forked. In M17Modulator.h make_lsf, there is:
And make_packet_frame:
Which looks the opposite way around. If we reverse it, in m17demodprocessor.cpp, we'd then also need to reverse:
|
m17-cxx-demod software is not maintained anymore, we have a fork named m17-tools. Packet mode is present only in the reference implementation and the specification, of course :) Can you take a look? |
I don't have a radio that works with m17-tools in order to test - but the above patch should reverse the CRC byte ordering in packet mode, so hopefully you can test it? I just made sure it still worked SDRangel to SDRangel. |
Oh, just re-read your second comment, and it seems there may be another change needed. Can you clarify what you think is wrong? (I don't actually use it...) |
You can TX M17 using rpitx if you have a Raspberry Pi around. We need to compare what SDRangel expects in a packet (what is extracted from it per frame) and what the reference code actually puts there. |
Added a hex dump to m17-packet-encode, gives the following: ./m17-packet-encode -S M7RCE1 -D M7RCE2 -n 6 -C 0 -o out.raw < packet.bin
SDRangel modulator (with flipped CRC gives)
So it doesn't look like the CRC needed to be flipped! I think you'll need to give an example of what is wrong or not working (an IQ file, for example) |
I do see above that there isn't a null terminator between the text and CRC. But I don't see that in the M17 spec either. Where does it come from? |
Ok, I'm going to take this step by step. |
I use this script to generate baseband. It properly adds |
Spec fixed. It now defines SMS content as null terminated, UTF-8 encoded string. |
Code for that is:
I guess the first change is:
to set Data type to data rather than voice. This:
appears to set the encryption subtype to reserved - Perhaps this was set to reserved to indicate that the META field doesn't contain text or GNSS position? |
Does any part of the spec suggest that? If subtype=reserved then META field carries no GNSS data. |
I'm just guessing what the author has tried to do. In the spec you have: m17-packet-encode appears to set subtype to Text, with META data being a null string. I suspect that isn't a good idea, in case the value of 11 is actually used for something else later on. Can't think what else it might be, unless it was defined differently in an earlier spec - but as far as I can see, it wasn't. |
Ah, yes, I see now. I found it at the same time :) I'd leave subtype at |
Yeah - CRC calculation itself was fine - it's just that it doesn't null terminate the string. If we add the null, and fix LSF as above, it matches:
|
I presume that is setting datatype to voice, when streaming. |
I edited that line. |
Yep, I think it should be 5 : 2. |
Don't forget to remove
|
Yep - have removed that. In the demod, we have: m_typeInfo = "PKT:"; // Packet mode For packet, should data type only ever be 1? Any idea what the difference between RAW and ENC is meant to be? |
No idea what the difference is. I would set these to |
The true content is encoded in the first bytes of the payload, anyway. |
It seems in M17DemodProcessor::decode_lsf:
The LSF is included in what is passed up the stack. |
We have recently updated the M17 protocol's specification document. SDRangel has issues with decoding packets. Could you apply a few minor adjustments to the code to accommodate for that?
The SMS should have the following structure (packet data contents):
0x05 (text message designator), text message (UTF-8 encoded), 0x00 (null-termination), 2-byte CRC (same as for the rest of the protocol).
The message is segmented into 25-byte chunks. If there's not enough data left, the rest is zero-padded. We kept the bit order for the Packet Metadata Field you used before - EOT bit is
1<<7
and the data byte counter goes to<<2
. I believe the CRC has wrong endianness though. Most significant byte should be at position[0]
of the byte array.The text was updated successfully, but these errors were encountered: