A modern C++ driver for communicating with the Nortek Nucleus sonar system.
This driver provides a clean, C++17-based interface for receiving and parsing data from a Nortek Nucleus using TCP networking via Asio or Boost.Asio.
- Modern C++17 interface
- Header-only networking via Asio or Boost.Asio
- Minimal dependencies
- Easy CMake integration
- Designed for real-time data streaming
- C++17 or newer
- One of:
- Standalone
asio(header-only), or Boost.Asio
- Standalone
- Familiarity with the Nortek Nucleus User Manual is strongly recommended
The driver supports parsing the following Nortek data formats:
- IMU Data
- Magnetometer Data
- Bottom Track Data
- Water Track Data
- Altimeter Data
- AHRS and INS Data V2
- Current Profile Data
- String Data
- Spectrum Data V3
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . -jTo install the driver system-wide:
cd build
sudo make installThis will install headers and CMake config files for easy use in other projects.
#include <nortek_nucleus_driver.hpp>find_package(nortek_nucleus_driver REQUIRED)
target_link_libraries(your_target PRIVATE nortek_nucleus_driver)Before running:
- Ensure the Nucleus and host PC are on the same subnet
- Verify the correct IP address and port from the Nucleus configuration
- Ensure required TCP ports are not blocked by a firewall
#include <nortek_nucleus_driver.hpp>
int main() {
asio::io_context io;
ConnectionParams params;
params.remote_ip = "192.169.53.100";
params.data_remote_port = 9000;
params.password = "very_secret_password";
NortekNucleusDriver driver(io, callback);
driver.open_tcp_sockets(params);
// If the Nucleus is configured to use a password
driver.enter_password(params);
driver.start_read();
// Settings should be configured before start_nucleus()
driver.start_nucleus();
io.run();
}Typical configuration options include:
- Device IP address
- TCP port
- Enabled data formats
- Output rates
Example:
struct MagnetometerSettings {
int freq;
MagnetometerMethod mode;
NucleusDataStreamSettings data_stream_settings;
DataSeriesId data_format;
};
MagnetometerSettings mag_settings{};
mag_settings.freq = 75;
mag_settings.mode = MagnetometerMethod::Auto;
mag_settings.data_stream_settings = NucleusDataStreamSettings::On;
data_format.data_format = DataSeriesId::MagnometerData;
auto status_code = set_magnetometer_settings(mag_settings);
if (status_code != NucleusStatusCode::Ok){
// Handle error
}
Refer to the Nortek Nucleus manual for valid configuration values.
When a command fails, the Nucleus responds with:
"ERROR"
After receiving this response, you can retrieve detailed error information using the get_error() function.
auto error_message = driver.get_error();
std::string error_string;
error_string.assign(error_message.payload);
std::cout << error_string << std::endl;driver.get_error()retrieves the last error reported by the Nucleus.- The error details are stored in the
payloadfield of the returned object. - The payload is copied into a
std::stringfor easier handling and display. - The error message can then be logged or printed to the console.
- The driver does not manage threading beyond the provided
asio::io_context - All callbacks are executed in the context of the Asio event loop
Nathaniel Førrisdahl