58 msg::Log::get().sinks.add_Serial();
59 msg::Log::get().sinks.add(&msg::StartupLog::get());
62 net::register_settings();
64 LOG_ALWAYS(dist::ident());
65 LOGV(
"Flash image (%d bytes) sha256 sum: %s\n", loader::flashimage::len(),
66 loader::flashimage::sha256sum().to_string().c_str());
72 LOG(ANABRID_DEBUG_INIT,
"Initializing carrier board...");
74 LOG_ERROR(
"Error initializing carrier board.");
75 leds::indicate_error();
81 LOG(ANABRID_DEBUG_INIT,
"Starting up Ethernet...");
82 int net_error =
netconf.begin_ip();
83 if (!net_error &&
netconf.enable_mdns) {
87 if (!net_error &&
netconf.enable_jsonl)
88 msg::JsonlServer::get().begin();
89 if (!net_error &&
netconf.enable_webserver)
90 web::LucidacWebServer::get().begin();
98 msg::handlers::Registry::get().init(
carrier_);
100 auto ® = msg::handlers::Registry::get();
106 msg::JsonLinesProtocol::get().init(4096);
111 LOG_ALWAYS(
"Warning: Error during DAQ calibration. Machine will continue with reduced accuracy.");
115 carrier_.reset(entities::ResetAction::OVERLOAD_RESET);
118 mode::RealManualControl::to_ic();
121 LOG(ANABRID_DEBUG_INIT,
"Executing self-calibration, this may take a few moments...");
122 if (!
carrier_.calibrate_m_blocks()) {
132 LOG_ALWAYS(
"Info: Startup self-calibration apparently did not succeed. The calibration scheme is by "
133 "default not used in this build anyway.");
137 carrier_.reset(entities::ResetAction::CIRCUIT_RESET | entities::ResetAction::OVERLOAD_RESET);
142 LOG(ANABRID_DEBUG_INIT,
"Initialization done.");
144 static_plugin::setup();
152 msg::JsonlServer::get().loop();
154 static net::auth::AuthentificationContext admin_context{net::auth::UserPasswordAuthentification::admin};
155 msg::JsonLinesProtocol::get().process_serial_input(admin_context);
158 web::LucidacWebServer::get().loop();
160 msg::JsonLinesProtocol::get().process_out_of_band_handlers(
carrier_);
162 static_plugin::loop();