CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-pynmea2

tessl install tessl/pypi-pynmea2@1.19.0

Python library for parsing and generating NMEA 0183 protocol messages used in GPS and marine navigation systems

Agent Success

Agent success rate when using this tile

77%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.12x

Baseline

Agent success rate without this tile

69%

task.mdevals/scenario-3/

Marine Instrument Data Processor

Summary

Build a marine instrument data processor that decodes and analyzes proprietary SeaTalk protocol messages from Raymarine marine instruments. The processor should parse SeaTalk NMEA sentences, extract command types, and generate a summary report of instrument readings.

Background

Raymarine SeaTalk is a proprietary marine protocol that bridges SeaTalk data to NMEA 0183 format. SeaTalk messages contain various types of instrument data such as depth readings, wind measurements, GPS positions, speed, and heading information. Your task is to process these messages and extract meaningful information.

Requirements

Input

Your program should read SeaTalk sentences from a file named seatalk_data.txt. Each line in the file contains a single SeaTalk NMEA sentence string.

Example input file content:

$STALK,84,86,26,97,02,00,00,00,08*3D
$STALK,00,02,00,00,00,60*0F
$STALK,84,56,E2,00,00,00,00,08,DB*27

Processing

  1. Parse each SeaTalk sentence from the input file
  2. Extract the command type from each sentence
  3. Count the occurrences of each command type
  4. Handle any parsing errors gracefully (skip invalid sentences and continue processing)

Output

Generate a file named seatalk_report.txt containing:

  1. The total number of successfully parsed SeaTalk sentences
  2. A list of unique command types found, sorted alphabetically
  3. The count of sentences for each command type
  4. The total number of sentences that failed to parse (if any)

Example output format:

SeaTalk Message Analysis Report
================================

Total sentences parsed: 42
Total parsing errors: 1

Command Types Detected:
- Apparent Wind Angle: 8
- Compass Heading: 15
- Water Depth: 12
- Water Speed: 7

Dependencies { .dependencies }

pynmea2 { .dependency }

Provides NMEA 0183 protocol parsing with SeaTalk proprietary format support.

Test Cases

Test 1: Basic SeaTalk parsing { .test-case @test }

Create a test file test_processor.py that verifies basic SeaTalk parsing functionality.

Given an input file test_input_1.txt containing:

$STALK,84,86,26,97,02,00,00,00,08*3D
$STALK,00,02,00,00,00,60*0F
$STALK,10,01,00,00*58

When the processor runs on this input file

Then the output file should contain:

  • Total sentences parsed: 3
  • Total parsing errors: 0
  • Three distinct command types listed alphabetically
  • Each command type count: 1

Test 2: Handling multiple sentences of same type { .test-case @test }

Create a test in test_processor.py that verifies counting of repeated command types.

Given an input file test_input_2.txt containing:

$STALK,84,86,26,97,02,00,00,00,08*3D
$STALK,84,86,26,97,02,00,00,00,08*3D
$STALK,00,02,00,00,00,60*0F

When the processor runs on this input file

Then the output file should contain:

  • Total sentences parsed: 3
  • First command type (alphabetically): count of 2
  • Second command type: count of 1

Implementation Notes

  • Focus on SeaTalk sentence parsing and command type extraction
  • The program should handle file I/O for reading input and writing output
  • Use appropriate error handling for file operations and parsing
  • Command type names should be human-readable strings, not raw codes

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/pynmea2@1.19.x
tile.json