Skip to content
This repository has been archived by the owner on May 6, 2024. It is now read-only.

Parse goesrecv symbols to remove stray nanomsg headers #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JVital2013
Copy link

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!

@sam210723 sam210723 self-assigned this Nov 7, 2022
@sam210723 sam210723 added the bug Something isn't working label Nov 7, 2022
@sam210723
Copy link
Owner

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants