goesrecv-monitor icon indicating copy to clipboard operation
goesrecv-monitor copied to clipboard

Parse goesrecv symbols to remove stray nanomsg headers

Open JVital2013 opened this issue 2 years ago • 1 comments

First off, I want to say a big THANK YOU for writing this program! Its code helped me understand how nanomsg works "on the wire", and I've written a number of goesrecv-related programs thanks to it. So, I wanted to give back.

In goesrecv-monitor v1.3, Symbols.cs is treating the nanomsg TCP stream as a stream of raw symbols. Unfortunately, nanomsg isn't quite that simple. It has 64-bit unsigned integer "headers" throughout the data stream that announce how many bytes are coming next. See section 3 at https://github.com/nanomsg/nanomsg/blob/master/rfc/sp-tcp-mapping-01.txt for more info.

To fix the problem, this PR reads the 64-bit integer (8 bytes), then only draws as many bytes as nanomsg announced is coming. Afterwards, it reads the next 8 bytes as another header (since it must be), and repeats the process.

Admittedly, the constellation diagram does not look that much different on my system, but if others reference your project like I did, this code is a more accurate starting point.

The code for this is essentially copied and pasted from my own goesbetween project - it's much more necessary to strip out the nanomsg headers when you're pulling the baseband iq samples!

JVital2013 avatar Nov 05 '22 01:11 JVital2013

Hi Jamie, good find! I probably should have read the nanomsg spec more carefully when implementing this. I am quite busy at the moment but I will come back to this PR soon and test it out.

Thanks, Sam.

sam210723 avatar Nov 07 '22 23:11 sam210723