Background: I have built a conventional demodulator in gnuradio and am trying to send payload data out of the flowgraph to an external Python script. I'm using gnuradio v3.7.12.
It seems to me that the optimal method would be to use the flowgraph to:
- find the preamble and tag it
- convert the data following the payload to a pdu
- send the pdu as a message to the external Python code
I've built a flowgraph that successfully does this using the following blocks: input bitstream->"Correlate Access Code - Tag Stream"->"Repack Bits"->"Tagged Stream to PDU"->"ZMQ PUSH Message Sink".
The problem is that the "Correlate Access Code - Tag Stream" block expects a very specific header between the preamble and the payload: 32 bits containing the payload size (16 bits repeated twice). This is fine if I am the one controlling the input signal. Any other signal I try to receive, however, is not going to have this header field.
So instead of the "Correlate Access Code - Tag Stream" block, I tried to use the "Correlate Access Code - Tag" block, but this block sets the length tag value to 0, which prevents the rest of the signal chain from working correctly. It seems like all I need to do is change the value of the length tag to my expected payload length, but unfortunately, after many hours of scouring the documentation regarding tags, messages and pdus, I have been unable to figure out how to do this.
Am I on the right track? I've attached my working flowgraph (with the "Tag Stream" block) as well as the non-working flowgraph (with the "Tag" block). I tried a number of things (Tagged Stream Align, Stream to Tagged Stream), but I couldn't get anything to work.
Non-working GRC (can't set length tag!): https://www.dropbox.com/s/aoueiovuvj9ss8z/tag_test.grc?dl=0
Thanks for any help you can provide. PC