Messages

class n2k.messages.SystemTime(*, system_date: int | None, system_time: float | None, time_source: N2kTimeSource, sid: int | None = None) None[source]

Bases: object

Data for System Date/Time Message (PGN 126992)

System Time is in UTC.

system_date: int | None

Days since 1970-01-01

system_time: float | None

Seconds since midnight

time_source: N2kTimeSource

Time source, see n2k.types.N2kTimeSource

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_system_time_message(data: SystemTime) Message[source]

Generate NMEA2000 message containing specified System Date/Time (PGN 126992).

Parameters:

data (SystemTime) – See SystemTime

Return type:

Message

Returns:

NMEA2000 message ready to be sent.

n2k.messages.parse_n2k_system_time(msg: Message) SystemTime[source]

Parse System Time information from a PGN 126992 message.

Parameters:

msg (Message) – NMEA2000 Message with PGN 126992

Return type:

SystemTime

Returns:

Object containing the parsed information.

class n2k.messages.AISSafetyRelatedBroadcast(*, message_id: Literal[N2kAISMessageID.Safety_related_broadcast_message], repeat: N2kAISRepeat, source_id: int | None, ais_transceiver_information: N2kAISTransceiverInformation, safety_related_text: str | None) None[source]

Bases: object

Data for AIS Safety Related Broadcast Message (PGN 129802)

message_id: Literal[<N2kAISMessageID.Safety_related_broadcast_message: 14>]

Message Type. Identifier for AIS Safety Related Broadcast Message aka Message 14; always 14.

repeat: N2kAISRepeat

Repeat indicator. Used by the repeater to indicate how many times a message has been repeated.

0-3; 0 = default; 3 = do not repeat anymore

source_id: int | None

MMSI number of source station of message

ais_transceiver_information: N2kAISTransceiverInformation

see n2k.types.N2kAISTransceiverInformation

Maximum 121 bytes. Encoded as 6-bit ASCII (see ITU-R M.1371-1)

Generate NMEA2000 message containing AIS Safety Related Broadcast Message. (PGN 129802)

Parameters:

data (AISSafetyRelatedBroadcast) – See AISSafetyRelatedBroadcast

Return type:

Message

Returns:

NMEA2000 message ready to be sent.

Parse AIS Safety Related Broadcast Message from a PGN 129802 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129802

Return type:

AISSafetyRelatedBroadcast

Returns:

Object containing the parsed information.

class n2k.messages.MOBNotification(*, mob_emitter_id: int | None, mob_status: N2kMOBStatus, activation_time: float | None, position_source: N2kMOBPositionSource, position_date: int | None, position_time: float | None, latitude: float | None, longitude: float | None, cog_reference: N2kHeadingReference, cog: float | None, sog: float | None, mmsi: int | None, mob_emitter_battery_status: N2kMOBEmitterBatteryStatus, sid: int | None = None) None[source]

Bases: object

Data for Man Overboard Notification Message (PGN 127233)

mob_emitter_id: int | None

Identifier for each MOB emitter, unique to the vessel

mob_status: N2kMOBStatus

MOB Status, see n2k.types.N2kMOBStatus

activation_time: float | None

Time of day (UTC) in seconds when MOB was initially activated

position_source: N2kMOBPositionSource

Position Source, see n2k.types.N2kMOBPositionSource

position_date: int | None

Date of MOB position in days since 1970-01-01 (UTC)

position_time: float | None

Time of day of MOB position (UTC) in seconds

latitude: float | None

Latitude in degrees Positive values indicate north, negative indicate south.

longitude: float | None

Longitude in degrees Negative values indicate west, positive indicate east.

cog_reference: N2kHeadingReference

True or Magnetic

cog: float | None

Course Over Ground in radians with a resolution of 1x10E-4 rad

sog: float | None

Speed Over Ground in m/s with a resolution of 1x10E-2 m/s

mmsi: int | None

MMSI of vessel of Origin. Can be set to n2k.constants.N2K_INT32_NA if unknown

mob_emitter_battery_status: N2kMOBEmitterBatteryStatus

see n2k.types.N2kMOBEmitterBatteryStatus

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_mob_notification_message(data: MOBNotification) Message[source]

Generate NMEA2000 message containing Man Overboard Notification (PGN 127233)

Parameters:

data (MOBNotification) – See MOBNotification

Return type:

Message

Returns:

NMEA2000 message ready to be sent.

n2k.messages.parse_n2k_mob_notification(msg: Message) MOBNotification[source]

Parse Man Over Board Notification from a PGN 127233 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127233

Return type:

MOBNotification

Returns:

Object containing the parsed information.

class n2k.messages.HeadingTrackControl(*, rudder_limit_exceeded: N2kOnOff, off_heading_limit_exceeded: N2kOnOff, off_track_limit_exceeded: N2kOnOff, override: N2kOnOff, steering_mode: N2kSteeringMode, turn_mode: N2kTurnMode, heading_reference: N2kHeadingReference, commanded_rudder_direction: N2kRudderDirectionOrder, commanded_rudder_angle: float | None, heading_to_steer_course: float | None, track: float | None, rudder_limit: float | None, off_heading_limit: float | None, radius_of_turn_order: float | None, rate_of_turn_order: float | None, off_track_limit: float | None, vessel_heading: float | None) None[source]

Bases: object

Data for Heading/Track Control Message (PGN 127237)

rudder_limit_exceeded: N2kOnOff

Yes/No

off_heading_limit_exceeded: N2kOnOff

Yes/No

off_track_limit_exceeded: N2kOnOff

Yes/No

override: N2kOnOff

Yes/No

steering_mode: N2kSteeringMode

Steering Mode

turn_mode: N2kTurnMode

Turn Mode

heading_reference: N2kHeadingReference

True or Magnetic

commanded_rudder_direction: N2kRudderDirectionOrder

Port or Starboard

commanded_rudder_angle: float | None

In radians

heading_to_steer_course: float | None

In radians

track: float | None

In radians

rudder_limit: float | None

In radians

off_heading_limit: float | None

In radians

radius_of_turn_order: float | None

In meters

rate_of_turn_order: float | None

In radians/s

off_track_limit: float | None

In meters

vessel_heading: float | None

In radians

n2k.messages.create_n2k_heading_track_control_message(data: HeadingTrackControl) Message[source]

Generate NMEA2000 message containing Heading/Track Control information (PGN 127237)

Parameters:

data (HeadingTrackControl) – See HeadingTrackControl

Return type:

Message

Returns:

NMEA2000 message ready to be sent.

n2k.messages.parse_n2k_heading_track_control(msg: Message) HeadingTrackControl[source]

Parse heading/track control information from a PGN 127237 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127237

Return type:

HeadingTrackControl

Returns:

Object containing the parsed information.

class n2k.messages.Rudder(*, rudder_position: float | None, instance: int | None, rudder_direction_order: N2kRudderDirectionOrder, angle_order: float | None) None[source]

Bases: object

Data for Rudder Message (PGN 127245)

rudder_position: float | None

Current rudder position in radians.

instance: int | None

Rudder instance.

rudder_direction_order: N2kRudderDirectionOrder

Direction, where rudder should be turned.

angle_order: float | None

Angle where rudder should be turned in radians.

n2k.messages.create_n2k_rudder_message(data: Rudder) Message[source]

Generate NMEA2000 message containing Rudder information (PGN 127245)

Parameters:

data (Rudder) – See Rudder

Return type:

Message

Returns:

NMEA2000 Message ready to be sent.

n2k.messages.parse_n2k_rudder(msg: Message) Rudder[source]

Parse rudder control information from a PGN 127245 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127245

Return type:

Rudder

Returns:

Object containing the parsed information

class n2k.messages.Heading(*, heading: float | None, deviation: float | None, variation: float | None, ref: N2kHeadingReference, sid: int | None = None) None[source]

Bases: object

Data for Vessel Heading Message (PGN 127250)

heading: float | None

Heading in radians

deviation: float | None

Magnetic deviation in radians. Use N2K_DOUBLE_NA for undefined value.

variation: float | None

Magnetic variation in radians. Use N2K_DOUBLE_NA for undefined value.

ref: N2kHeadingReference

Heading reference. Can be true or magnetic.

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_heading_message(data: Heading) Message[source]

Vessel Heading (PGN 127250).

If the true heading is used, leave the deviation and variation undefined. Else, if the magnetic heading is sent, specify the magnetic deviation and variation.

Parameters:

data (Heading) – See Heading

Return type:

Message

Returns:

NMEA2000 message ready to be sent.

n2k.messages.parse_n2k_heading(msg: Message) Heading[source]

Parse heading information from a PGN 127250 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127250

Return type:

Heading

Returns:

Object containing the parsed information

class n2k.messages.RateOfTurn(*, rate_of_turn: float | None, sid: int | None = None) None[source]

Bases: object

Data for Rate of Turn Message (PGN 127251)

rate_of_turn: float | None

Rate of turn in radians per second

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_rate_of_turn_message(data: RateOfTurn) Message[source]

Rate of Turn (PGN 127251)

Parameters:

data (RateOfTurn) – See RateOfTurn

Return type:

Message

Returns:

n2k.messages.parse_n2k_rate_of_turn(msg: Message) RateOfTurn[source]

Parse rate of turn information from a PGN 127251 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127251

Return type:

RateOfTurn

Returns:

Object containing the parsed information

class n2k.messages.Heave(*, heave: float | None, delay: float | None, delay_source: N2kDD374, sid: int | None = None) None[source]

Bases: object

Data for Heave Message (PGN 127252)

heave: float | None

Vertical displacement perpendicular to the earth’s surface in meters

delay: float | None

Delay added by calculations in seconds

delay_source: N2kDD374

Delay Source, see type

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_heave_message(data: Heave) Message[source]

Heave (PGN 127252)

Parameters:

data (Heave) – See Heave

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_heave(msg: Message) Heave[source]

Parse heave information from a PGN 127252 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127252

Return type:

Heave

Returns:

Object containing the parsed information

class n2k.messages.Attitude(*, yaw: float | None, pitch: float | None, roll: float | None, sid: int | None = None) None[source]

Bases: object

Data for Attitude Message (PGN 127257)

yaw: float | None

Heading in radians

pitch: float | None

Pitch in radians. Positive, when your bow rises.

roll: float | None

Roll in radians. Positive, when tilted right.

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_attitude_message(data: Attitude) Message[source]

Attitude (PGN 127257)

Parameters:

data (Attitude) – See Attitude

Return type:

Message

Returns:

NMEA2000 message ready to be sent

n2k.messages.parse_n2k_attitude(msg: Message) Attitude[source]

Parse attitude information from a PGN 127257 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127257

Return type:

Attitude

Returns:

Object containing the parsed information

class n2k.messages.MagneticVariation(*, source: N2kMagneticVariation, days_since_1970: int | None, variation: float | None, sid: int | None = None) None[source]

Bases: object

Data for Magnetic Variation Message (PGN 127258)

source: N2kMagneticVariation

How the magnetic variation for the current location has been derived

days_since_1970: int | None

UTC Date in Days since 1970

variation: float | None

Variation in radians, positive values represent Easterly, negative values a Westerly variation.

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_magnetic_variation_message(data: MagneticVariation) Message[source]

Magnetic Variation (PGN 127258)

Parameters:

data (MagneticVariation) – See MagneticVariation

Return type:

Message

Returns:

NMEA2000 message ready to be sent

n2k.messages.parse_n2k_magnetic_variation(msg: Message) MagneticVariation[source]

Parse magnetic variation information from a PGN 127258 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127258

Return type:

MagneticVariation

Returns:

Object containing the parsed information

class n2k.messages.EngineParametersRapid(*, engine_instance: int | None, engine_speed: float | None, engine_boost_pressure: float | None, engine_tilt_trim: int | None) None[source]

Bases: object

Data for Engine Parameters Rapid Message (PGN 127488)

engine_instance: int | None

This field indicates the particular engine for which this data applies. A single engine will have an instance of 0. Engines in multi-engine boats will be numbered starting at 0 at the bow of the boat, incrementing to n going towards the stern of the boat. For engines at the same distance from the bow and the stern, the engines are numbered starting from the port side and proceeding towards the starboard side.

engine_speed: float | None

Rotational speed in RPM, stored at a precision of ¼ RPM

engine_boost_pressure: float | None

Turbocharger boost pressure in Pascal, stored at a precision of 100 Pa

engine_tilt_trim: int | None

Engine tilt or trim (positive or negative) in percent, stored as an integer.

0: full tilt down 50: neutral 100: full tilt up

n2k.messages.create_n2k_engine_parameters_rapid_message(data: EngineParametersRapid) Message[source]

Engine Parameters Rapid (PGN 127488)

Parameters:

data (EngineParametersRapid) – See EngineParametersRapid

Return type:

Message

Returns:

NMEA2000 message ready to be sent

n2k.messages.parse_n2k_engine_parameters_rapid(msg: Message) EngineParametersRapid[source]

Parse engine parameters rapid information from a PGN 127488 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127488

Return type:

EngineParametersRapid

Returns:

Object containing the parsed information

class n2k.messages.EngineParametersDynamic(*, engine_instance: int | None, engine_oil_press: float | None, engine_oil_temp: float | None, engine_coolant_temp: float | None, alternator_voltage: float | None, fuel_rate: float | None, engine_hours: float | None, engine_coolant_press: float | None, engine_fuel_press: float | None, engine_load: int | None, engine_torque: int | None, status1: N2kDD206, status2: N2kDD223) None[source]

Bases: object

Data for Engine Parameters Dynamic Message (PGN 127489)

engine_instance: int | None

This field indicates the particular engine for which this data applies. A single engine will have an instance of 0. Engines in multi-engine boats will be numbered starting at 0 at the bow of the boat, incrementing to n going towards the stern of the boat. For engines at the same distance from the bow and the stern, the engines are numbered starting from the port side and proceeding towards the starboard side.

engine_oil_press: float | None

Oil pressure of the engine in Pascal, precision 100Pa

engine_oil_temp: float | None

Oil temperature of the engine in degrees Kelvin, precision 0.1°K

engine_coolant_temp: float | None

Engine coolant temperature in degrees Kelvin, precision 0.1°K

alternator_voltage: float | None

Alternator voltage in Volt, precision 0.01V

fuel_rate: float | None

Fuel consumption rate in cubic meters per hour, precision 0.0001 m³/h

engine_hours: float | None

Cumulative runtime of the engine in seconds

engine_coolant_press: float | None

Engine coolant pressure in Pascal, precision 100 Pa

engine_fuel_press: float | None

Fuel pressure in Pascal, precision 1000 Pa

engine_load: int | None

Percent engine load, precision 1%

engine_torque: int | None

Percent engine torque, precision 1%

status1: N2kDD206

Warning conditions part 1

status2: N2kDD223

Warning conditions part 2

n2k.messages.create_n2k_engine_parameters_dynamic_message(data: EngineParametersDynamic) Message[source]

Engine Parameters Dynamic (PGN 127489)

Parameters:

data (EngineParametersDynamic) – See EngineParametersDynamic

Return type:

Message

Returns:

n2k.messages.parse_n2k_engine_parameters_dynamic(msg: Message) EngineParametersDynamic[source]

Parse engine parameters dynamic information from a PGN 127489 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127489

Return type:

EngineParametersDynamic

Returns:

Object containing the parsed information

class n2k.messages.TransmissionParametersDynamic(*, engine_instance: int | None, transmission_gear: N2kTransmissionGear, oil_pressure: float | None, oil_temperature: float | None, discrete_status1: N2kTransmissionDiscreteStatus1) None[source]

Bases: object

Data for Transmission Parameters Dynamic Message (PGN 127493)

engine_instance: int | None

This field indicates the particular engine for which this data applies. A single engine will have an instance of 0. Engines in multi-engine boats will be numbered starting at 0 at the bow of the boat, incrementing to n going towards the stern of the boat. For engines at the same distance from the bow and the stern, the engines are numbered starting from the port side and proceeding towards the starboard side.

transmission_gear: N2kTransmissionGear

The current gear the transmission is in

oil_pressure: float | None

Transmission oil pressure in Pascal, precision 100 Pa

oil_temperature: float | None

Transmission oil temperature in degrees Kelvin, precision 0.1°K

discrete_status1: N2kTransmissionDiscreteStatus1

Transmission warning conditions.

n2k.messages.create_n2k_transmission_parameters_dynamic_message(data: TransmissionParametersDynamic) Message[source]

Transmission Parameters, Dynamic (PGN 127493)

Parameters:

data (TransmissionParametersDynamic) – See TransmissionParametersDynamic

Return type:

Message

Returns:

n2k.messages.parse_n2k_transmission_parameters_dynamic(msg: Message) TransmissionParametersDynamic[source]

Parse transmission parameters dynamic information from a PGN 127493 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127493

Return type:

TransmissionParametersDynamic

Returns:

Object containing the parsed information

class n2k.messages.TripFuelConsumptionEngine(*, engine_instance: int | None, trip_fuel_used: float | None, fuel_rate_average: float | None, fuel_rate_economy: float | None, instantaneous_fuel_economy: float | None) None[source]

Bases: object

Data for Trip Fuel Consumption by Engine Message (PGN 127497)

engine_instance: int | None

This field indicates the particular engine for which this data applies. A single engine will have an instance of 0. Engines in multi-engine boats will be numbered starting at 0 at the bow of the boat, incrementing to n going towards the stern of the boat. For engines at the same distance from the bow and the stern, the engines are numbered starting from the port side and proceeding towards the starboard side.

trip_fuel_used: float | None

Fuel used by this engine during the trip in Litres, precision 1L

fuel_rate_average: float | None

Fuel used on average by this engine in Litres per hour, precision 0.1L/h

fuel_rate_economy: float | None

Unknown? Litres per hour, precision 0.1L/h

instantaneous_fuel_economy: float | None

Fuel used at this moment by this engine in Litres per hour, precision 0.1L/h

n2k.messages.create_n2k_trip_parameters_engine_message(data: TripFuelConsumptionEngine) Message[source]

Trip Fuel Consumption by Engine (PGN 127497)

Parameters:

data (TripFuelConsumptionEngine) – See TripFuelConsumptionEngine

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_trip_parameters_engine(msg: Message) TripFuelConsumptionEngine[source]

Parse trip fuel consumption by engine information from a PGN 127497 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127497

Return type:

TripFuelConsumptionEngine

Returns:

Object containing the parsed information

class n2k.messages.BinaryStatusReport(*, device_bank_instance: int, bank_status: int) None[source]

Bases: object

Data for Binary Status Report Message (PGN 127501)

device_bank_instance: int

Device or Bank Instance. This is the instance number of the device that is being reported on.

bank_status: int

Full bank status. Read single status by using n2k.utils.n2k_get_status_on_binary_status()

n2k.messages.create_n2k_binary_status_report_message(data: BinaryStatusReport) Message[source]

Binary Status Report (PGN 127501)

Parameters:

data (BinaryStatusReport) – See BinaryStatusReport

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_binary_status_report(msg: Message) BinaryStatusReport[source]

Parse binary status report information from a PGN 127501 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127501

Return type:

BinaryStatusReport

Returns:

Object containing the parsed information

class n2k.messages.SwitchBankControl(*, target_bank_instance: int, bank_status: int) None[source]

Bases: object

Data for Switch Bank Control Message (PGN 127502)

target_bank_instance: int

Instance number of the switch bank that was targeted by this switch bank control message.

bank_status: int

The binary status component of the switch bank control containing the commanded state of channels on the target switch bank

Use n2k.utils.n2k_get_status_on_binary_status() to get single status

n2k.messages.create_n2k_switch_bank_control_message(data: SwitchBankControl) Message[source]

Switch Bank Control (PGN 127502)

This PGN is deprecated by NMEA and modern switch bank devices may well not support it, favouring PGN 126208 Command Group Function.

Command channel states on a remote switch bank. Up to 28 remote binary states can be controlled.

When you create a tN2kBinaryStatus object for use with this function you should ensure that you only command (that is set ON or OFF) those channels which you intend to operate. Channels in which you have no interest should not be commanded but set not available.

Review n2k.utils.n2k_reset_binary_status(), n2k.utils.n2k_set_status_binary_on_status() and the documentation of n2k.types.N2kOnOff for information on how to set up bank status.

Remember as well, that transmission of a PGN 127502 message is equivalent to issuing a command, so do not send the same message repeatedly: once should be enough. You can always check that the target switch bank has responded by checking its PGN 127501 broadcasts.

Parameters:

data (SwitchBankControl) – See SwitchBankControl

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_switch_bank_control(msg: Message) SwitchBankControl[source]

Parse switch bank control information from a PGN 127502 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127502

Return type:

SwitchBankControl

Returns:

Object containing the parsed information

class n2k.messages.FluidLevel(*, instance: int, fluid_type: N2kFluidType, level: float | None, capacity: float | None) None[source]

Bases: object

Data for Fluid Level Message (PGN 127505)

instance: int

Tank instance. Different devices handles this a bit differently.

fluid_type: N2kFluidType

Type of fluid.

level: float | None

Tank level in % of full tank, precision 0.004%

capacity: float | None

Tank capacity in litres, precision 0.1L

n2k.messages.create_n2k_fluid_level_message(data: FluidLevel) Message[source]

Fluid Level (PGN 127505)

Parameters:

data (FluidLevel) – See FluidLevel

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_fluid_level(msg: Message) FluidLevel[source]

Parse fluid level information from a PGN 127505 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127505

Return type:

FluidLevel

Returns:

Object containing the parsed information

class n2k.messages.DCDetailedStatus(*, dc_instance: int | None, dc_type: N2kDCType, state_of_charge: int | None, state_of_health: int | None, time_remaining: float | None, ripple_voltage: float | None, capacity: float | None, sid: int | None = None) None[source]

Bases: object

Data for DC Detailed Status Message (PGN 127506)

dc_instance: int | None

DC Source Instance

dc_type: N2kDCType

Type of DC Source

state_of_charge: int | None

Percent of charge

state_of_health: int | None

Percent of health

time_remaining: float | None

Time remaining in seconds, precision 60s

ripple_voltage: float | None

DC output voltage ripple in Volt, precision 0.001V

capacity: float | None

Battery capacity in coulombs, precision 3600C (aka 1Ah)

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_dc_detailed_status_message(data: DCDetailedStatus) Message[source]

DC Detailed Status (PGN 127506)

Parameters:

data (DCDetailedStatus) – See DCDetailedStatus

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_dc_detailed_status(msg: Message) DCDetailedStatus[source]

Parse DC Detailed Status information from a PGN 127506 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127506

Return type:

DCDetailedStatus

Returns:

Object containing the parsed information

class n2k.messages.ChargerStatus(*, instance: int | None, battery_instance: int | None, charge_state: N2kChargeState, charger_mode: N2kChargerMode, enabled: N2kOnOff, equalization_pending: N2kOnOff, equalization_time_remaining: float | None) None[source]

Bases: object

Data for Charger Status Message (PGN 127507)

instance: int | None

Charger Instance

battery_instance: int | None

Battery Instance

charge_state: N2kChargeState

Operating State

charger_mode: N2kChargerMode

Charger Mode

enabled: N2kOnOff

Yes/No

equalization_pending: N2kOnOff

Yes/No

equalization_time_remaining: float | None

Time remaining in seconds, precision 1s

n2k.messages.create_n2k_charger_status_message(data: ChargerStatus) Message[source]

Charger Status (PGN 127507)

Parameters:

data (ChargerStatus) – See ChargerStatus

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_charger_status(msg: Message) ChargerStatus[source]

Parse charger status information from a PGN 127507 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127507

Return type:

ChargerStatus

Returns:

Object containing the parsed information

class n2k.messages.BatteryStatus(*, battery_instance: int | None, battery_voltage: float | None, battery_current: float | None, battery_temperature: float | None, sid: int | None = None) None[source]

Bases: object

Data for Battery Status Message (PGN 127508)

battery_instance: int | None

Battery Instance

battery_voltage: float | None

Battery Voltage in Volt, precision 0.01V

battery_current: float | None

Battery Current in Ampere, precision 0.1A

battery_temperature: float | None

Battery Temperature in Kelvin, precision 0.01K

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time

n2k.messages.create_n2k_battery_status_message(data: BatteryStatus) Message[source]

Battery Status (PGN 127508)

Parameters:

data (BatteryStatus) – See BatteryStatus

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_battery_status(msg: Message) BatteryStatus[source]

Parse battery status information from a PGN 127508 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127508

Return type:

BatteryStatus

Returns:

Object containing the parsed information

class n2k.messages.ChargerConfigurationStatus(*, charger_instance: int | None, battery_instance: int | None, enable: N2kOnOff, charge_current_limit: int | None, charging_algorithm: N2kChargingAlgorithm, charger_mode: N2kChargerMode, battery_temperature: N2kBattTempNoSensor, equalization_enabled: N2kOnOff, over_charge_enable: N2kOnOff, equalization_time_remaining: int | None) None[source]

Bases: object

Data for Charger Configuration Status Message (PGN 127510)

charger_instance: int | None

Charger Instance

battery_instance: int | None

Battery Instance

enable: N2kOnOff

Enable/Disable charger

charge_current_limit: int | None

Charge current limit in % range 0-252 resolution 1%

charging_algorithm: N2kChargingAlgorithm

Charging algorithm, see type

charger_mode: N2kChargerMode

Charger mode, see type

battery_temperature: N2kBattTempNoSensor

Battery temperature when no sensor

equalization_enabled: N2kOnOff

Equalize one time enable/disable

over_charge_enable: N2kOnOff

Enable/Disable over charge

equalization_time_remaining: int | None

Time remaining in seconds

n2k.messages.create_n2k_charger_configuration_status_message(data: ChargerConfigurationStatus) Message[source]

Charger Configuration Status (PGN 127510)

Any device capable of charging a battery can transmit this

Parameters:

data (ChargerConfigurationStatus) – See ChargerConfigurationStatus

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_charger_configuration_status(msg: Message) ChargerConfigurationStatus[source]

Parse charger configuration status information from a PGN 127510 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127510

Return type:

ChargerConfigurationStatus

Returns:

Object containing the parsed information

class n2k.messages.BatteryConfigurationStatus(*, battery_instance: int | None, battery_type: N2kBatType, supports_equal: N2kBatEqSupport, battery_nominal_voltage: N2kBatNomVolt, battery_chemistry: N2kBatChem, battery_capacity: float | None, battery_temperature_coefficient: int | None, peukert_exponent: float | None, charge_efficiency_factor: int | None) None[source]

Bases: object

Data for Battery Configuration Status Message (PGN 127513)

battery_instance: int | None

Battery Instance

battery_type: N2kBatType

Battery Type, see type

supports_equal: N2kBatEqSupport

Whether the battery supports equalization

battery_nominal_voltage: N2kBatNomVolt

Battery nominal voltage, see type

battery_chemistry: N2kBatChem

Battery chemistry, see type

battery_capacity: float | None

Battery capacity in Coulombs (aka Ampere Seconds), stored at a precision of 1Ah

battery_temperature_coefficient: int | None

Battery temperature coefficient in %

peukert_exponent: float | None

Peukert Exponent, describing the relation between discharge rate and effective capacity. Value between 1.0 and 1.504

charge_efficiency_factor: int | None

Charge efficiency factor

n2k.messages.create_n2k_battery_configuration_status_message(data: BatteryConfigurationStatus) Message[source]

Battery Configuration Status (PGN 127513)

Parameters:

data (BatteryConfigurationStatus) – See BatteryConfigurationStatus

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_battery_configuration_status(msg: Message) BatteryConfigurationStatus[source]

Parse battery configuration status information from a PGN 127513 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127513

Return type:

BatteryConfigurationStatus

Returns:

Object containing the parsed information

class n2k.messages.ConverterStatus(*, connection_number: int | None, operating_state: N2kConvMode, temperature_state: N2kTemperatureState, overload_state: N2kOverloadState, low_dc_voltage_state: N2kDCVoltageState, ripple_state: N2kRippleState, sid: int | None = None) None[source]

Bases: object

Data for Converter Status Message (PGN 127750)

connection_number: int | None

Connection number

operating_state: N2kConvMode

Operating state (see n2k.types.N2kConvMode)

temperature_state: N2kTemperatureState

Temperature state (see n2k.types.N2kTemperatureState)

overload_state: N2kOverloadState

Overload state (see n2k.types.N2kOverloadState)

low_dc_voltage_state: N2kDCVoltageState

Low DC voltage state (see n2k.types.N2kDCVoltageState)

ripple_state: N2kRippleState

Ripple state (see n2k.types.N2kRippleState)

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_converter_status_message(data: ConverterStatus) Message[source]

Converter (Inverter/Charger) Status (PGN 127750)

Replaces PGN 127507

Provides state and status information about charger/inverters

Parameters:

data (ConverterStatus) – See ConverterStatus

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_converter_status(msg: Message) ConverterStatus[source]

Parse converter status information from a PGN 127750 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127750

Return type:

ConverterStatus

Returns:

Object containing the parsed information

class n2k.messages.Leeway(*, leeway: float | None, sid: int | None = None) None[source]

Bases: object

Data for Leeway Message (PGN 128000)

leeway: float | None

Positive angles indicate slippage to starboard, that is, the vessel is tracking to the right of its heading, and negative angles indicate slippage to port. Angle in radians, stored at a precision of 0.0001rad

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_leeway_message(data: Leeway) Message[source]

Leeway (PGN 128000)

Parameters:

data (Leeway) – See Leeway

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_leeway(msg: Message) Leeway[source]

Parse leeway information from a PGN 128000 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 128000

Return type:

Leeway

Returns:

Object containing the parsed information

class n2k.messages.BoatSpeed(*, water_referenced: float | None, ground_referenced: float | None, swrt: N2kSpeedWaterReferenceType, sid: int | None = None) None[source]

Bases: object

Data for Boat Speed Message (PGN 128259)

water_referenced: float | None

Speed through the water in meters per second, precision 0.01m/s

ground_referenced: float | None

Speed over ground in meters per second, precision 0.01m/s

swrt: N2kSpeedWaterReferenceType

Type of transducer for the water referenced speed, see type

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_boat_speed_message(data: BoatSpeed) Message[source]

Boat Speed (PGN 128259)

Parameters:

data (BoatSpeed) – See BoatSpeed

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_boat_speed(msg: Message) BoatSpeed[source]

Parse boat speed information from a PGN 128259 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 128259

Return type:

BoatSpeed

Returns:

Object containing the parsed information

class n2k.messages.WaterDepth(*, depth_below_transducer: float | None, offset: float | None, max_range: float | None, sid: int | None = None) None[source]

Bases: object

Data for Water Depth Message (PGN 128267)

depth_below_transducer: float | None

Water depth below transducer in meters, precision 0.01m

offset: float | None

Distance in meters between transducer and water surface (positive) or transducer and keel (negative), precision 0.001m

max_range: float | None

Maximum depth that can be measured

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_water_depth_message(data: WaterDepth) Message[source]

Water Depth (PGN 128267)

Parameters:

data (WaterDepth) – See WaterDepth

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_water_depth(msg: Message) WaterDepth[source]

Parse water depth information from a PGN 128267 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 128267

Return type:

WaterDepth

Returns:

Object containing the parsed information

class n2k.messages.DistanceLog(*, days_since_1970: int | None, seconds_since_midnight: float | None, log: int | None, trip_log: int | None) None[source]

Bases: object

Data for Distance Log Message (PGN 128275)

days_since_1970: int | None

Days since 1.1.1970 UTC

seconds_since_midnight: float | None

Seconds since midnight, stored at a precision of 0.0001s

log: int | None

Total distance traveled through the water since the installation of the device in meters.

trip_log: int | None

Total distance traveled through the water since the last trip reset in meters.

n2k.messages.create_n2k_distance_log_message(data: DistanceLog) Message[source]

Distance Log (PGN 128275)

Parameters:

data (DistanceLog) – See DistanceLog

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_distance_log(msg: Message) DistanceLog[source]

Parse distance log information from a PGN 128275 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 128275

Return type:

DistanceLog

Returns:

Object containing the parsed information

class n2k.messages.AnchorWindlassControlStatus(*, windlass_identifier: int | None, windlass_direction_control: N2kDD484, speed_control: int | None, speed_control_type: N2kDD488, anchor_docking_control: N2kDD002, power_enable: N2kDD002, mechanical_lock: N2kDD002, deck_and_anchor_wash: N2kDD002, anchor_light: N2kDD002, command_timeout: float | None, windlass_control_events: N2kDD478, sid: int | None = None) None[source]

Bases: object

Data for Anchor Windlass Control Status Message (PGN 128776)

windlass_identifier: int | None

Windlass Identifier

windlass_direction_control: N2kDD484

Windlass Direction, see type

speed_control: int | None

Single Speed: 0=off, 1-100=on

Dual Speed: 0=0ff, 1-49=slow, 50-100=fast

Proportional speed: 0=off, 1-100=speed

speed_control_type: N2kDD488

Speed control type, Single, Dual or Proportional

anchor_docking_control: N2kDD002

Anchor Docking Control, Yes/No

power_enable: N2kDD002

Power Enable, Yes/No

mechanical_lock: N2kDD002

Mechanical Lock, Yes/No

deck_and_anchor_wash: N2kDD002

Deck and Anchor Wash, Yes/No

anchor_light: N2kDD002

Anchor Light, Yes/No

command_timeout: float | None

Command Timeout. Range 0.0 to 1.275 seconds, precision 0.005s

windlass_control_events: N2kDD478

Windlass Control Events, see type

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_anchor_windlass_control_status_message(data: AnchorWindlassControlStatus) Message[source]

Anchor Windlass Control Status (PGN 128776)

Parameters:

data (AnchorWindlassControlStatus) – See AnchorWindlassControlStatus

Return type:

Message

Returns:

n2k.messages.parse_n2k_anchor_windlass_control_status(msg: Message) AnchorWindlassControlStatus[source]

Parse anchor windlass control status information from a PGN 128776 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 128776

Return type:

AnchorWindlassControlStatus

Returns:

Object containing the parsed information

class n2k.messages.AnchorWindlassOperatingStatus(*, windlass_identifier: int | None, rode_counter_value: float | None, windlass_line_speed: float | None, windlass_motion_status: N2kDD480, rode_type_status: N2kDD481, anchor_docking_status: N2kDD482, windlass_operating_events: N2kDD483, sid: int | None = None) None[source]

Bases: object

Data for Anchor Windlass Operating Status Message (PGN 128777)

windlass_identifier: int | None

Identifier of the windlass instance

rode_counter_value: float | None

Amount of rode deployed, in metres

windlass_line_speed: float | None

Deployment speed in metres per second

windlass_motion_status: N2kDD480

Windlass Motion Status, see type

rode_type_status: N2kDD481

Rode Type Status, see type

anchor_docking_status: N2kDD482

Anchor Docking Status, see type

windlass_operating_events: N2kDD483

Windlass Operating Events, see type

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_anchor_windlass_operating_status_message(data: AnchorWindlassOperatingStatus) Message[source]

Anchor Windlass Operating Status (PGN 128777)

Parameters:

data (AnchorWindlassOperatingStatus) – See AnchorWindlassOperatingStatus

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_anchor_windlass_operating_status(msg: Message) AnchorWindlassOperatingStatus[source]

Parse anchor windlass operating status information from a PGN 128777 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 128777

Return type:

AnchorWindlassOperatingStatus

Returns:

Object containing the parsed information

class n2k.messages.AnchorWindlassMonitoringStatus(*, windlass_identifier: int | None, total_motor_time: float | None, controller_voltage: float | None, motor_current: float | None, windlass_monitoring_events: N2kDD477, sid: int | None = None) None[source]

Bases: object

Data for Anchor Windlass Monitoring Status Message (PGN 128778)

windlass_identifier: int | None

Identifier of the windlass instance

total_motor_time: float | None

Total runtime of the motor in seconds

controller_voltage: float | None

Voltage in Volts, precision 0.2V

motor_current: float | None

Current in Amperes, precision 1A

windlass_monitoring_events: N2kDD477

Windlass Monitoring Events, see type

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_anchor_windlass_monitoring_status_message(data: AnchorWindlassMonitoringStatus) Message[source]

Anchor Windlass Monitoring Status (PGN 128778)

Parameters:

data (AnchorWindlassMonitoringStatus) – See AnchorWindlassMonitoringStatus

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_anchor_windlass_monitoring_status(msg: Message) AnchorWindlassMonitoringStatus[source]

Parse anchor windlass monitoring status information from a PGN 128778 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 128778

Return type:

AnchorWindlassMonitoringStatus

Returns:

Object containing the parsed information

class n2k.messages.LatLonRapid(*, latitude: float | None, longitude: float | None) None[source]

Bases: object

Data for Lat/Lon Rapid Message (PGN 129025)

latitude: float | None

Latitude in degrees, precision approx 1.1cm (1e-7 deg) Positive values indicate north, negative indicate south.

longitude: float | None

Longitude in degrees, precision approx 1.1cm at the equator (1e-7 deg) Negative values indicate west, positive indicate east.

n2k.messages.create_n2k_lat_long_rapid_message(data: LatLonRapid) Message[source]

Position rapid update (PGN 129025)

Parameters:

data (LatLonRapid) – See LatLonRapid

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_lat_long_rapid(msg: Message) LatLonRapid[source]

Parse latitude and longitude from a PGN 129025 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129025

Return type:

LatLonRapid

Returns:

Object containing the parsed information

class n2k.messages.CogSogRapid(*, heading_reference: N2kHeadingReference, cog: float | None, sog: float | None, sid: int | None = None) None[source]

Bases: object

Data for COG/SOG Rapid Message (PGN 129026)

heading_reference: N2kHeadingReference

Course over Ground reference, see type

cog: float | None

Course over Ground in radians, precision 0.0001rad

sog: float | None

Speed over Ground in meters per second, precision 0.01m/s

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_cog_sog_rapid_message(data: CogSogRapid) Message[source]

Course and Speed over Ground, rapid update (PGN 129026)

Parameters:

data (CogSogRapid) – See CogSogRapid

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_cog_sog_rapid(msg: Message) CogSogRapid[source]

Parse course and speed over ground from a PGN 129026 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129026

Return type:

CogSogRapid

Returns:

Object containing the parsed information

class n2k.messages.GNSSPositionData(*, days_since_1970: int | None, seconds_since_midnight: float | None, latitude: float | None, longitude: float | None, altitude: float | None, gnss_type: N2kGNSSType, gnss_method: N2kGNSSMethod, n_satellites: int | None, hdop: float | None, pdop: float | None, geoidal_separation: float | None, n_reference_stations: int | None, reference_station_type: N2kGNSSType | None, reference_station_id: int | None, age_of_correction: float | None, sid: int | None = None) None[source]

Bases: object

Data for GNSS Position Data Message (PGN 129029)

days_since_1970: int | None

Days since 1.1.1970 UTC

seconds_since_midnight: float | None

Seconds since midnight, stored at a precision of 0.0001s

latitude: float | None

Latitude in degrees, precision approx 11 pico metre (a fifth of the diameter of a helium atom, 1e-16 deg). Positive values indicate north, negative indicate south.

longitude: float | None

Longitude in degrees, precision approx 11 pico metre at the equator (1e-16 deg) Negative values indicate west, positive indicate east.

altitude: float | None

Altitude in reference to the WGS-84 model in metres, precision 1 micrometer

gnss_type: N2kGNSSType

GNSS Type, see type

gnss_method: N2kGNSSMethod

GNSS Method type, see type

n_satellites: int | None

Number of satellites used for the provided data

hdop: float | None

Horizontal Dilution Of Precision in meters, precision 0.01m

pdop: float | None

Positional Dilution Of Precision in meters, precision 0.01m

geoidal_separation: float | None

Geoidal separation in meters, precision 0.01m

n_reference_stations: int | None

Number of Reference Stations

reference_station_type: N2kGNSSType | None

Reference Station type, see type

reference_station_id: int | None

Reference Station ID

age_of_correction: float | None

Age of DGNSS Correction

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_gnss_data_message(data: GNSSPositionData) Message[source]

GNSS Position Data (PGN 129029)

Parameters:

data (GNSSPositionData) – See GNSSPositionData

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_gnss_data(msg: Message) GNSSPositionData[source]

Parse GNSS Position Data information from a PGN 129029 message

The parameters passed to ReferenceStationType, ReferenceStationID and AgeOfCorrection are set to n2k.constants.N2kGNSSType.GPS, n2k.constants.N2K_INT16_NA and n2k.constants.N2K_DOUBLE_NA respectively, when there are no reference stations present in the message.

Parameters:

msg (Message) – NMEA2000 Message with PGN 129029

Return type:

GNSSPositionData

Returns:

Object containing the parsed information

class n2k.messages.DateTimeLocalOffset(*, days_since_1970: int | None, seconds_since_midnight: float | None, local_offset: int | None, sid: int | None = None) None[source]

Bases: object

Data for Date, Time & Local offset Message (PGN 129033)

See also PGN 126992 (SystemTime).

days_since_1970: int | None

Days since 1.1.1970 UTC

seconds_since_midnight: float | None

Seconds since midnight, stored at a precision of 0.0001s

local_offset: int | None

Local offset in minutes

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time

n2k.messages.create_n2k_date_time_local_offset_message(data: DateTimeLocalOffset) Message[source]

Date, Time & Local offset (PGN 129033), see also PGN 126992 (SystemTime)

Parameters:

data (DateTimeLocalOffset) – See DateTimeLocalOffset

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_date_time_local_offset(msg: Message) DateTimeLocalOffset[source]

Parse date, time and local offset information from a PGN 129033 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129033

Return type:

DateTimeLocalOffset

Returns:

Object containing the parsed information

class n2k.messages.AISClassAPositionReport(*, message_id: N2kAISMessageID, repeat: N2kAISRepeat, user_id: int | None, latitude: float | None, longitude: float | None, accuracy: bool, raim: bool, seconds: int, cog: float | None, sog: float | None, ais_transceiver_information: N2kAISTransceiverInformation, heading: float | None, rot: float | None, nav_status: N2kAISNavStatus, sid: int | None = None) None[source]

Bases: object

Data for AIS Class A Position Report Message (PGN 129038)

message_id: N2kAISMessageID

Message Type ID according to https://www.itu.int/rec/R-REC-M.1371

repeat: N2kAISRepeat

Repeat indicator, Used by the repeater to indicate how many times a message has been repeated.

user_id: int | None

MMSI Number (Maritime Mobile Service Identity, 9 digits)

latitude: float | None

Latitude in degrees, precision approx 1.1cm (1e-7 deg) Positive values indicate north, negative indicate south.

longitude: float | None

Longitude in degrees, precision approx 1.1cm at the equator (1e-7 deg) Negative values indicate west, positive indicate east.

accuracy: bool

Position accuracy, 0 = low (> 10m), 1 = high (≤ 10m)

raim: bool

Receiver autonomous integrity monitoring (RAIM) flag of the electronic position fixing device.

seconds: int

UTC second when the report was generated by the EPFS (0-59).

60: timestamp not available, default

61: positioning system in manual input mode

62: electronic position fixing system operates in estimated (dead reckoning) mode

63: positioning system is inoperative

cog: float | None

Course over Ground in radians, precision 0.0001rad

sog: float | None

Speed over Ground in meters per second, precision 0.01m/s

ais_transceiver_information: N2kAISTransceiverInformation

AIS Transceiver Information, see type

heading: float | None

Compass heading

rot: float | None

Rate of Turn

nav_status: N2kAISNavStatus

Navigational status, see type

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time

n2k.messages.create_n2k_ais_class_a_position_message(data: AISClassAPositionReport) Message[source]

AIS Position Reports for Class A (PGN 129038)

Parameters:

data (AISClassAPositionReport) – See AISClassAPositionReport

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_ais_class_a_position(msg: Message) AISClassAPositionReport[source]

Parse AIS Class A Position Report information from a PGN 129038 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129038

Return type:

AISClassAPositionReport

Returns:

Object containing the parsed information

class n2k.messages.AISClassBPositionReport(*, message_id: N2kAISMessageID, repeat: N2kAISRepeat, user_id: int | None, latitude: float | None, longitude: float | None, accuracy: bool, raim: bool, seconds: int, cog: float | None, sog: float | None, ais_transceiver_information: N2kAISTransceiverInformation, heading: float | None, unit: N2kAISUnit, display: bool, dsc: bool, band: bool, msg22: bool, mode: N2kAISMode, state: bool, sid: int | None = None) None[source]

Bases: object

Data for AIS Class B Position Report Message (PGN 129039)

message_id: N2kAISMessageID

Message Type ID according to https://www.itu.int/rec/R-REC-M.1371

repeat: N2kAISRepeat

Repeat indicator, Used by the repeater to indicate how many times a message has been repeated.

user_id: int | None

MMSI Number (Maritime Mobile Service Identity, 9 digits)

latitude: float | None

Latitude in degrees, precision approx 1.1cm (1e-7 deg) Positive values indicate north, negative indicate south.

longitude: float | None

Longitude in degrees, precision approx 1.1cm at the equator (1e-7 deg) Negative values indicate west, positive indicate east.

accuracy: bool

Position accuracy, 0 = low (> 10m), 1 = high (≤ 10m)

raim: bool

Receiver autonomous integrity monitoring (RAIM) flag of the electronic position fixing device.

seconds: int

UTC second when the report was generated by the EPFS (0-59).

60: timestamp not available, default

61: positioning system in manual input mode

62: electronic position fixing system operates in estimated (dead reckoning) mode

63: positioning system is inoperative

cog: float | None

Course over Ground in radians, precision 0.0001rad

sog: float | None

Speed over Ground in meters per second, precision 0.01m/s

ais_transceiver_information: N2kAISTransceiverInformation

AIS Transceiver Information, see type

heading: float | None

Compass heading

unit: N2kAISUnit

Class B unit flag, see type

display: bool

Class B display flag

dsc: bool

Class B DSC flag

band: bool

Class B band flag

msg22: bool

Class B Message22 flag

mode: N2kAISMode

Station Operating Mode flag, see type

state: bool

Communication State Selector flag

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time

n2k.messages.create_n2k_ais_class_b_position_message(data: AISClassBPositionReport) Message[source]

AIS Position Reports for Class B (PGN 129039)

Parameters:

data (AISClassBPositionReport) – See AISClassBPositionReport

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_ais_class_b_position(msg: Message) AISClassBPositionReport[source]

Parse AIS Class B Position Report information from a PGN 129039 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129039

Return type:

AISClassBPositionReport

Returns:

Object containing the parsed information

class n2k.messages.AISAtoNReportData(*, message_id: N2kAISMessageID, repeat: N2kAISRepeat, user_id: int | None, latitude: float | None, longitude: float | None, accuracy: bool, raim: bool, seconds: int, length: float | None, beam: float | None, position_reference_starboard: float | None, position_reference_true_north: float | None, a_to_n_type: N2kDD305, off_position_reference_indicator: bool, virtual_a_to_n_flag: bool, assigned_mode_flag: bool, gnss_type: N2kGNSSType, a_to_n_status: int | None, n2k_ais_transceiver_information: N2kAISTransceiverInformation, a_to_n_name: str | None) None[source]

Bases: object

Data for AIS Aids to Navigation (AtoN) Report Message (PGN 129041)

message_id: N2kAISMessageID

Message Type ID according to https://www.itu.int/rec/R-REC-M.1371

repeat: N2kAISRepeat

Repeat indicator, Used by the repeater to indicate how many times a message has been repeated.

user_id: int | None

MMSI Number (Maritime Mobile Service Identity, 9 digits)

latitude: float | None

Latitude in degrees, precision approx 1.1cm (1e-7 deg) Positive values indicate north, negative indicate south.

longitude: float | None

Longitude in degrees, precision approx 1.1cm at the equator (1e-7 deg) Negative values indicate west, positive indicate east.

accuracy: bool

Position accuracy, 0 = low (> 10m), 1 = high (≤ 10m)

raim: bool

Receiver autonomous integrity monitoring (RAIM) flag of the electronic position fixing device.

seconds: int

UTC second when the report was generated by the EPFS (0-59).

60: timestamp not available, default

61: positioning system in manual input mode

62: electronic position fixing system operates in estimated (dead reckoning) mode

63: positioning system is inoperative

length: float | None

Structure Length/Diameter in meters

beam: float | None

Structure Beam/Diameter in meters

position_reference_starboard: float | None

Position Reference Point from Starboard Structure Edge/Radius

position_reference_true_north: float | None

Position Reference Point from True North facing Structure Edge/Radius

a_to_n_type: N2kDD305

Aid to Navigation (AtoN) Type, see type

off_position_reference_indicator: bool

Off Position Indicator. For floating AtoN only

0: on position

1: off position

Note: This flag should only be considered valid by receiving station, if the AtoN is a floatation aid, and if the time since the report has been generated is <= 59.

virtual_a_to_n_flag: bool

Virtual AtoN Flag

0: default = real AtoN at indicated position

1: virtual AtoN, does not physically exist.

assigned_mode_flag: bool

Assigned Mode Flag

0: default = Station operating in autonomous and continuous mode

1: Station operating in assigned mode

gnss_type: N2kGNSSType

Type of electronic position fixing device, see type

a_to_n_status: int | None

AtoN Status byte. Reserved for the indication of the AtoN status.

n2k_ais_transceiver_information: N2kAISTransceiverInformation

AIS Transceiver Information, see type.

a_to_n_name: str | None

Name of the AtoN Object, according to https://www.itu.int/rec/R-REC-M.1371

n2k.messages.create_n2k_ais_aids_to_navigation_report_message(data: AISAtoNReportData) Message[source]

AIS Aids to Navigation (AtoN) Report (PGN 129041)

Parameters:

data (AISAtoNReportData) – See AISAtoNReportData

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_ais_aids_to_navigation_report(msg: Message) AISAtoNReportData[source]

Parse AIS Aids to Navigation (AtoN) Report information from a PGN 129041 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129041

Return type:

AISAtoNReportData

Returns:

Object containing the parsed information

class n2k.messages.CrossTrackError(*, xte_mode: N2kXTEMode, navigation_terminated: bool, xte: float | None, sid: int | None = None) None[source]

Bases: object

Data for Cross Track Error Message (PGN 129283)

xte_mode: N2kXTEMode

CrossTrackError Mode, see type

navigation_terminated: bool

Navigation has been terminated

xte: float | None

CrossTrackError in meters

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_cross_track_error_message(data: CrossTrackError) Message[source]

Cross Track Error (PGN 129283)

Parameters:

data (CrossTrackError) – See CrossTrackError

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_cross_track_error(msg: Message) CrossTrackError[source]

Parse Cross Track Error information from a PGN 129283 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129283

Return type:

CrossTrackError

Returns:

Object containing the parsed information

class n2k.messages.NavigationInfo(*, distance_to_waypoint: float | None, bearing_reference: N2kHeadingReference, perpendicular_crossed: bool, arrival_circle_entered: bool, calculation_type: N2kDistanceCalculationType, eta_time: float | None, eta_date: int | None, bearing_origin_to_destination_waypoint: float | None, bearing_position_to_destination_waypoint: float | None, origin_waypoint_number: int | None, destination_waypoint_number: int | None, destination_latitude: float | None, destination_longitude: float | None, waypoint_closing_velocity: float | None, sid: int | None = None) None[source]

Bases: object

Data for Navigation Info Message (PGN 129284)

distance_to_waypoint: float | None

Distance to Destination Waypoint in meters (precision 1cm)

bearing_reference: N2kHeadingReference

Course/Bearing Reference, see type

perpendicular_crossed: bool

Perpendicular Crossed

arrival_circle_entered: bool

Arrival Circle Entered

calculation_type: N2kDistanceCalculationType

Calculation Type, see type

eta_time: float | None

Time part of Estimated Time at Arrival in seconds since midnight

eta_date: int | None

Date part of Estimated Time at Arrival in Days since 1.1.1970 UTC

bearing_origin_to_destination_waypoint: float | None

Bearing, From Origin to Destination Waypoint

bearing_position_to_destination_waypoint: float | None

Bearing, From current Position to Destination Waypoint

origin_waypoint_number: int | None

Origin Waypoint Number

destination_waypoint_number: int | None

Destination Waypoint Number

destination_latitude: float | None

Destination Waypoint Latitude Positive values indicate north, negative indicate south.

destination_longitude: float | None

Destination Waypoint Longitude Negative values indicate west, positive indicate east.

waypoint_closing_velocity: float | None

Waypoint Closing Velocity

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_navigation_info_message(data: NavigationInfo) Message[source]

# Navigation Info (PGN 129284)

Parameters:

data (NavigationInfo) – See NavigationInfo

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_navigation_info(msg: Message) NavigationInfo[source]

Parse Navigation Info information from a PGN 129284 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129284

Return type:

NavigationInfo

Returns:

Object containing the parsed information

class n2k.messages.RouteWaypointInformation(*, start: int | None, database: int | None, route: int | None, nav_direction: N2kNavigationDirection, route_name: str | None, supplementary_data: N2kDD002, waypoints: list[Waypoint]) None[source]

Bases: object

Data for Route Waypoint Information Message (PGN 129285)

start: int | None

The ID of the first waypoint

database: int | None

Database ID

route: int | None

Route ID

nav_direction: N2kNavigationDirection

Navigation Direction in Route, see type

route_name: str | None

The name of the current route

supplementary_data: N2kDD002

Supplementary Route/WP data available

waypoints: list[Waypoint]

List of waypoints to be sent with the route. Each consisting of an ID, Name, Latitude and Longitude.

n2k.messages.create_n2k_route_waypoint_information_message(data: RouteWaypointInformation) Message[source]

Route Waypoint Information (PGN 129285)

Parameters:

data (RouteWaypointInformation) – See RouteWaypointInformation

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_route_waypoint_information(msg: Message) RouteWaypointInformation[source]

Parse Route Waypoint Information from a PGN 129285 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129285

Return type:

RouteWaypointInformation

Returns:

Object containing the parsed information

class n2k.messages.GNSSDOPData(*, desired_mode: N2kGNSSDOPmode, actual_mode: N2kGNSSDOPmode, hdop: float | None, vdop: float | None, tdop: float | None, sid: int | None = None) None[source]

Bases: object

Data for GNSS DOP Data Message (PGN 129539)

desired_mode: N2kGNSSDOPmode

Desired DOP Mode

actual_mode: N2kGNSSDOPmode

Actual DOP Mode

hdop: float | None

Horizontal Dilution of Precision in meters

vdop: float | None

Vertical Dilution of Precision in meters

tdop: float | None

Time Dilution of Precision

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_gnss_dop_message(data: GNSSDOPData) Message[source]

GNSS DOP Data (PGN 129539)

Parameters:

data (GNSSDOPData) – See GNSSDOPData

Return type:

Message

Returns:

NMEA2000 message, ready to be sent

n2k.messages.parse_n2k_gnss_dop(msg: Message) GNSSDOPData[source]

Parse GNSS DOP Data information from a PGN 129539 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129539

Return type:

GNSSDOPData

Returns:

Object containing the parsed information

class n2k.messages.GNSSSatellitesInView(*, mode: N2kDD072, satellites: list[SatelliteInfo], sid: int | None = None) None[source]

Bases: object

Data for GNSS Satellites in View Message (PGN 129540)

mode: N2kDD072

Range Residual Mode

satellites: list[SatelliteInfo]

List of the info of the satellites used

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_gnss_satellites_in_view_message(data: GNSSSatellitesInView) Message[source]

GNSS Satellites in View (PGN 129540)

Parameters:

data (GNSSSatellitesInView) – See GNSSSatellitesInView

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_gnss_satellites_in_view(msg: Message) GNSSSatellitesInView[source]

Parse GNSS Satellites in View information from a PGN 129540 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129540

Return type:

GNSSSatellitesInView

Returns:

Object containing the parsed information

class n2k.messages.AISClassAStaticData(*, message_id: N2kAISMessageID, repeat: N2kAISRepeat, user_id: int | None, imo_number: int | None, callsign: str | None, name: str | None, vessel_type: int | None, length: float | None, beam: float | None, pos_ref_stbd: float | None, pos_ref_bow: float | None, eta_date: int | None, eta_time: float | None, draught: float | None, destination: str | None, ais_version: N2kAISVersion, gnss_type: N2kGNSSType, dte: N2kAISDTE, ais_info: N2kAISTransceiverInformation, sid: int | None = None) None[source]

Bases: object

Data for AIS Class A Static Data Message (PGN 129794)

message_id: N2kAISMessageID

Message Type ID according to https://www.itu.int/rec/R-REC-M.1371

repeat: N2kAISRepeat

Repeat indicator. Used by the repeater to indicate how many times a message has been repeated.

0-3; 0 = default; 3 = do not repeat anymore

user_id: int | None

MMSI Number (Maritime Mobile Service Identity, 9 digits)

imo_number: int | None

Ship identification number by IMO. [1 .. 999999999]; 0: not available = default

callsign: str | None

Call Sign. Max. 7 chars will be used. Input string will be converted to contain only SixBit ASCII character set (see. ITU-R M.1371-1)

name: str | None

Name of the vessel

Maximum 20 * 6bit ASCII characters.

For SAR aircraft it should be set to “SAR AIRCRAFT NNNNNNN” where NNNNNNN” equals the aircraft registration number.

Input string will be converted to contain only SixBit ASCII character set (see. ITU-R M.1371-1)

vessel_type: int | None

Vessel Type.

0: not available or no ship = default

1-99: as defined in § 3.3.2

100-199: reserved, for regional use

200-255: reserved, for regional use

Not applicable to SAR aircraft

length: float | None

Length/Diameter in meters

beam: float | None

Beam/Diameter in meters

pos_ref_stbd: float | None

Position Reference Point from Starboard

pos_ref_bow: float | None

Position Reference Point from the Bow

eta_date: int | None

Date part of Estimated Time at Arrival in Days since 1.1.1970 UTC

eta_time: float | None

Time part of Estimated Time at Arrival in seconds since midnight

draught: float | None

Maximum present static draught

destination: str | None

Destination. Maximum of 20 6bit ASCII Characters.

Input string will be converted to contain only SixBit ASCII character set (see. ITU-R M.1371-1)

ais_version: N2kAISVersion

AIS Version, see type

gnss_type: N2kGNSSType

Type of GNSS, see type

dte: N2kAISDTE

Data terminal equipment (DTE) ready.

0: available

1: not available = default

ais_info: N2kAISTransceiverInformation

AIS Transceiver Information, see type

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time

n2k.messages.create_n2k_ais_class_a_static_data_message(data: AISClassAStaticData) Message[source]

AIS Class A Static Data (PGN 129794)

Parameters:

data (AISClassAStaticData) – See AISClassAStaticData

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_ais_class_a_static_data(msg: Message) AISClassAStaticData[source]

Parse AIS Class A Static Data information from a PGN 129794 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129794

Return type:

AISClassAStaticData

Returns:

Object containing the parsed information

class n2k.messages.AISClassBStaticDataPartA(*, message_id: N2kAISMessageID, repeat: N2kAISRepeat, user_id: int | None, name: str | None, ais_info: N2kAISTransceiverInformation, sid: int | None = None) None[source]

Bases: object

Data for AIS Class B Static Data Part A Message (PGN 129809)

message_id: N2kAISMessageID

Message Type ID according to https://www.itu.int/rec/R-REC-M.1371

repeat: N2kAISRepeat

Repeat indicator. Used by the repeater to indicate how many times a message has been repeated.

0-3; 0 = default; 3 = do not repeat anymore

user_id: int | None

MMSI Number (Maritime Mobile Service Identity, 9 digits)

name: str | None

Name of the vessel

Maximum 20 characters.

For SAR aircraft it should be set to “SAR AIRCRAFT NNNNNNN” where NNNNNNN” equals the aircraft registration number.

Input string will be converted to contain only SixBit ASCII character set (see. ITU-R M.1371-1)

ais_info: N2kAISTransceiverInformation

AIS Transceiver Information, see type

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time

n2k.messages.create_n2k_ais_class_b_static_data_part_a_message(data: AISClassBStaticDataPartA) Message[source]

AIS Class B Static Data part A (PGN 129809)

Parameters:

data (AISClassBStaticDataPartA) – See AISClassBStaticDataPartA

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_ais_class_b_static_data_part_a(msg: Message) AISClassBStaticDataPartA[source]

Parse AIS Class B Static Data Part A information from a PGN 129809 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129809

Return type:

AISClassBStaticDataPartA

Returns:

Object containing the parsed information

class n2k.messages.AISClassBStaticDataPartB(*, message_id: N2kAISMessageID, repeat: N2kAISRepeat, user_id: int | None, vessel_type: int | None, vendor: str | None, callsign: str | None, length: float | None, beam: float | None, pos_ref_stbd: float | None, pos_ref_bow: float | None, mothership_id: int | None, ais_info: N2kAISTransceiverInformation, sid: int | None = None) None[source]

Bases: object

Data for AIS Class B Static Data Part B Message (PGN 129810)

message_id: N2kAISMessageID

Message Type ID according to https://www.itu.int/rec/R-REC-M.1371

repeat: N2kAISRepeat

Repeat indicator. Used by the repeater to indicate how many times a message has been repeated.

0-3; 0 = default; 3 = do not repeat anymore

user_id: int | None

MMSI Number (Maritime Mobile Service Identity, 9 digits)

vessel_type: int | None

Vessel Type.

0: not available or no ship = default

1-99: as defined in § 3.3.2

100-199: reserved, for regional use

200-255: reserved, for regional use

Not applicable to SAR aircraft

vendor: str | None

Unique identification of the Unit by a number as defined by the manufacturer.

Input string will be converted to contain only SixBit ASCII character set (see. ITU-R M.1371-1)

callsign: str | None

Call Sign. Max. 7 chars will be used. Input string will be converted to contain only SixBit ASCII character set (see. ITU-R M.1371-1)

length: float | None

Length/Diameter in meters

beam: float | None

Beam/Diameter in meters

pos_ref_stbd: float | None

Position Reference Point from Starboard

pos_ref_bow: float | None

Position Reference Point from the Bow

mothership_id: int | None

MMSI of the mothership

ais_info: N2kAISTransceiverInformation

AIS Transceiver Information, see type

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time

n2k.messages.create_n2k_ais_class_b_static_data_part_b_message(data: AISClassBStaticDataPartB) Message[source]

AIS CLass B Static Data part B (PGN 129810)

Parameters:

data (AISClassBStaticDataPartB) – See AISClassBStaticDataPartB

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_ais_class_b_static_data_part_b(msg: Message) AISClassBStaticDataPartB[source]

Parse AIS Class B Static Data Part B information from a PGN 129810 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 129810

Return type:

AISClassBStaticDataPartB

Returns:

Object containing the parsed information

class n2k.messages.WaypointList(*, start: int | None, num_waypoints: int | None, database: int | None, waypoints: list[Waypoint]) None[source]

Bases: object

Data for Waypoint List message (PGN 130074)

start: int | None

The ID of the first waypoint

num_waypoints: int | None

Number of valid Waypoints in the list

database: int | None

Database ID

waypoints: list[Waypoint]

List of waypoints to be sent with the route. Each consisting of an ID, Name, Latitude and Longitude.

n2k.messages.create_n2k_waypoint_list_message(data: WaypointList) Message[source]

Route and Waypoint Service - Waypoint List - Waypoint Name & Position (PGN 130074)

Parameters:

data (WaypointList) – See WaypointList

Return type:

Message

Returns:

NMEA2000 Message, ready to be sent

n2k.messages.parse_n2k_waypoint_list(msg: Message) WaypointList[source]

Parse Waypoint List from a PGN 130074 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 130074

Return type:

WaypointList

Returns:

Object containing the parsed information

class n2k.messages.WindSpeed(*, wind_speed: float | None, wind_angle: float | None, wind_reference: N2kWindReference, sid: int | None = None) None[source]

Bases: object

Data for Wind Speed message (PGN 130306)

wind_speed: float | None

Wind Speed in meters per second

wind_angle: float | None

Wind Angle in radians

wind_reference: N2kWindReference

Wind Reference. Can be e.g. Theoretical Wind using True North or Magnetic North, Apparent Wind as measured, …

See n2k.types.N2kWindReference

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_wind_speed_message(data: WindSpeed) Message[source]

Wind Speed (PGN 130306)

Parameters:

data (WindSpeed) – See WindSpeed

Return type:

Message

Returns:

NMEA2000 message ready to be sent.

n2k.messages.parse_n2k_wind_speed(msg: Message) WindSpeed[source]

Parse heading information from a PGN 127250 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 127250

Return type:

WindSpeed

Returns:

Object containing the parsed information

class n2k.messages.OutsideEnvironmentalParameters(*, water_temperature: float | None, outside_ambient_air_temperature: float | None, atmospheric_pressure: float | None, sid: int | None = None) None[source]

Bases: object

Data for Outside Environmental Parameters message (PGN 130310) - DEPRECATED

water_temperature: float | None

Water temperature in Kelvin, precision 0.01K

outside_ambient_air_temperature: float | None

Outside ambient air temperature in Kelvin, precision 0.01K

atmospheric_pressure: float | None

Atmospheric pressure in Pascals, precision 100Pa

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_outside_environmental_parameters_message(data: OutsideEnvironmentalParameters) Message[source]

Outside Environmental Parameters (PGN 130310)

Local atmospheric environmental conditions.

This PGN has been deprecated. Specific PGNs 130316 Temperature, 130313 Relative Humidity, 130314 Actual Pressure, 130315 Set Pressure shall be used.

Parameters:

data (OutsideEnvironmentalParameters) – See OutsideEnvironmentalParameters

Return type:

Message

Returns:

NMEA2000 message ready to be sent.

n2k.messages.parse_n2k_outside_environmental_parameters(msg: Message) OutsideEnvironmentalParameters[source]

Parse environmental information from a PGN 130310 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 130310

Return type:

OutsideEnvironmentalParameters

Returns:

Object containing the parsed information

class n2k.messages.EnvironmentalParameters(*, temp_source: N2kTempSource, temperature: float | None, humidity_source: N2kHumiditySource, humidity: float | None, atmospheric_pressure: float | None, sid: int | None = None) None[source]

Bases: object

Data for Environmental Parameters message (PGN 130311) - DEPRECATED

temp_source: N2kTempSource

See n2k.types.N2kTempSource

temperature: float | None

Temperature in Kelvin, precision 0.01K

humidity_source: N2kHumiditySource

See n2k.types.N2kHumiditySource

humidity: float | None

Humidity in percent, precision 0.004%

atmospheric_pressure: float | None

Atmospheric pressure in Pascals, precision 100Pa

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_environmental_parameters_message(data: EnvironmentalParameters) Message[source]

Environmental Parameters (PGN 130311)

This PGN has been deprecated. Specific PGNs 130316 Temperature, 130313 Relative Humidity, 130314 Actual Pressure, 130315 Set Pressure shall be used.

Parameters:

data (EnvironmentalParameters) – See OutsideEnvironmentalParameters

Return type:

Message

Returns:

NMEA2000 message ready to be sent.

n2k.messages.parse_n2k_environmental_parameters(msg: Message) EnvironmentalParameters[source]

Parse environmental information from a PGN 130311 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 130311

Return type:

EnvironmentalParameters

Returns:

Object containing the parsed information

class n2k.messages.Temperature(*, temp_instance: int | None, temp_source: N2kTempSource, actual_temperature: float | None, set_temperature: float | None, sid: int | None = None) None[source]

Bases: object

Data for Temperature message (PGN 130312) - DEPRECATED

temp_instance: int | None

This should be unique at least on one device. May be best to have it unique over all devices sending this PGN.

temp_source: N2kTempSource

Source of measurement. See n2k.types.N2kTempSource

actual_temperature: float | None

Temperature in Kelvin, precision 0.01K

set_temperature: float | None

Temperature set point in Kelvin, precision 0.01K

This is meaningful for temperatures, which can be controlled like cabin, freezer, refrigeration temperature.

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_temperature_message(data: Temperature) Message[source]

Temperature (PGN 130312)

Temperature as measured by a specific temperature source. This PGN has been deprecated. Please use PGN 130316 (Temperature-Extended Range) for all new designs.

Parameters:

data (Temperature) – See Temperature

Return type:

Message

Returns:

NMEA2000 message ready to be sent.

n2k.messages.parse_n2k_temperature(msg: Message) Temperature[source]

Parse temperature from a PGN 130312 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 130312

Return type:

Temperature

Returns:

Object containing the parsed information

class n2k.messages.Humidity(*, humidity_instance: int | None, humidity_source: N2kHumiditySource, actual_humidity: float | None, set_humidity: float | None, sid: int | None = None) None[source]

Bases: object

Data for Humidity message (PGN 130313)

humidity_instance: int | None

This should be unique at least on one device. May be best to have it unique over all devices sending this PGN.

humidity_source: N2kHumiditySource

Source of measurement. See n2k.types.N2kHumiditySource

actual_humidity: float | None

Humidity in percent, precision 0.004%

set_humidity: float | None

Set value of Humidity in percent, precision 0.004%

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_humidity_message(data: Humidity) Message[source]

Humidity (PGN 130313)

Humidity as measured by a specific humidity source.

Parameters:

data (Humidity) – See Humidity

Return type:

Message

Returns:

NMEA2000 message ready to be sent.

n2k.messages.parse_n2k_humidity(msg: Message) Humidity[source]

Parse humidity from a PGN 130313 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 130313

Return type:

Humidity

Returns:

Object containing the parsed information

class n2k.messages.ActualPressure(*, pressure_instance: int | None, pressure_source: N2kPressureSource, actual_pressure: float | None, sid: int | None = None) None[source]

Bases: object

Data for Actual Pressure message (PGN 130314)

pressure_instance: int | None

This should be unique at least on one device. May be best to have it unique over all devices sending this PGN.

pressure_source: N2kPressureSource

Source of measurement. See n2k.types.N2kPressureSource

actual_pressure: float | None

Actual pressure in Pascals, precision 0.1Pa

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_actual_pressure_message(data: ActualPressure) Message[source]

Actual Pressure (PGN 130314)

Pressure as measured by a specific pressure source

Parameters:

data (ActualPressure) – See ActualPressure

Return type:

Message

Returns:

NMEA2000 message ready to be sent.

n2k.messages.parse_n2k_actual_pressure(msg: Message) ActualPressure[source]

Parse actual pressure from a PGN 130314 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 130314

Return type:

ActualPressure

Returns:

Object containing the parsed information

class n2k.messages.SetPressure(*, pressure_instance: int | None, pressure_source: N2kPressureSource, set_pressure: float | None, sid: int | None = None) None[source]

Bases: object

Data for Set Pressure message (PGN 130315)

pressure_instance: int | None

This should be unique at least on one device. May be best to have it unique over all devices sending this PGN.

pressure_source: N2kPressureSource

Source of measurement. See n2k.types.N2kPressureSource

set_pressure: float | None

Set pressure in Pascals, precision 0.1Pa

sid: int | None = None

Sequence ID. If your device provides e.g. boat speed and heading at same time, you can set the same SID for different messages to indicate that they are measured at same time.

n2k.messages.create_n2k_set_pressure_message(data: SetPressure) Message[source]

Set Pressure (PGN 130315)

This parameter group can be sent to a device that controls pressure to change its targeted pressure, or it can be sent out by the control device to indicate its current targeted pressure.

Parameters:

data (SetPressure) – See SetPressure

Return type:

Message

Returns:

NMEA2000 message ready to be sent.

n2k.messages.parse_n2k_set_pressure(msg: Message) SetPressure[source]

Parse set pressure from a PGN 130315 message

Parameters:

msg (Message) – NMEA2000 Message with PGN 130315

Return type:

SetPressure

Returns:

Object containing the parsed information