Skip to content
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

updated to add dcs and decoding some Sutron types, still todo type C & D. #139

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

twcutter
Copy link

I've got dcs working for type B and human readable types via Pseudo-Binary additons. The dcs/sutron.cc is a work in progress to add the less common type C and type D formats of GOES DCS/DCP data. It is described in pdf documents in Sutron, now ott.com products. I'd like to also add CRC-16 and CRC-32 to work like Taylor's Python setup. For check summing the File Header (32) and Block Headers (16). There is a dcs_handler added from work of others, also.

@twcutter
Copy link
Author

twcutter commented May 6, 2022

I've updated the sutron.cc decoder to include Sutron type B,C,D. This completes the decoder. There are other types that are present and unknown how to decode generically. All the documented "Sutron" stuff is done for the decoder.

I considered previously in adding a CRC check which would need CRC16 and CRC32. I believe that what is sent as CRC from the DCP Stations is Diagnostic for the Station maintainer and the serial UART of the sending devices. The DCP station maintainers may be interested in the CRC values sent from the station? The values for hobbyists, I'll just report in output.

src/dcs/dcs.cc Outdated

// Skip over Missed Messages Blocks (blockID == 2 as of January 21, 2021)
if (blocks[pos].blockID != 1) {
nread += 28; // Size of Missed Message Block (2(blocks len) + 24(header) + 2(CRC16))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skipping over 28 bytes is correct for messages with blockID=2, but it would be better to read the next 2 bytes to calculate the block length in order to figure out exactly how many bytes to skip

@twcutter
Copy link
Author

twcutter commented May 7, 2022 via email

@eminence
Copy link
Contributor

eminence commented May 7, 2022

Hi Tom,

I've personally never seen any blocks other than 1 and 2, but the HRIT_DCS_File_Format_Rev1 pdf explicitly recomments checking the block length (section 3.2)

To support future enhancements while maintaining backward compatibility, this proposed HRIT file format utilizes a
block identifier (BLK_ID) immediately followed by a block length (BLK_LNG) field. When implementing the file
processing code, systems should be designed to look at the block identifier to determine the type of data in the
block and the appropriate handling. If the BLK_ID is not a value the code recognizes or supports, the code should
then use the length field to skip over this data.

… type D is only suppose to be 1,2,3,4 .. but then there is real data .. showing other characters sent with type D. I've also commited @eminence suggested change of missed blocks in dcs.cc.  It makes sense to do so.
@twcutter
Copy link
Author

twcutter commented May 7, 2022

I've added a few type D hash checks which look like data to sutron.cc. The type B,C & D is only suppose to be 1,2,3,4 for the second digit of data. But then there is real data showing other characters sent with type D. I've also commited @eminence suggested change of missed blocks in dcs.cc. It makes sense to do so.

@eminence
Copy link
Contributor

eminence commented May 9, 2022

The PDF files should probably be added in the docs/files/ folder instead of being in the same folder as the source files

@@ -87,7 +88,9 @@ int main(int argc, char** argv) {
std::unique_ptr<Handler>(
new EMWINHandler(handler, fileWriter)));
} else if (handler.type == "dcs") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be useful to also update etc/goesproc.conf to add an example DCS handler entry in the file.

@elafargue
Copy link
Contributor

It would be worth squashing all of these commits into one larger commit once this is ready for merge, this will be a lot cleaner.

@twcutter
Copy link
Author

twcutter commented May 11, 2022 via email

…gn position) and move it to the 32'nd bit when converting back to signed 32 bit numbers, from 18 bit.
@twcutter
Copy link
Author

I didn't convert a missing value which is designated in GOES data as three slashes /// . This will turn into some form of negative number. At least through observation. Big negative numbers are either a test sent, or I'm not familiar with a sensor which would provide a hugh negative number? I'd expect negative numbers to be small. Large negative shows a conversion problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants