8 static const char *
const TAG =
"pipsolar";
10 void Pipsolar::setup() {
22 void Pipsolar::loop() {
43 ESP_LOGD(TAG,
"response length for command OK");
47 ESP_LOGD(TAG,
"command successful");
49 ESP_LOGD(TAG,
"command not successful");
62 ESP_LOGD(TAG,
"response length for command %s not OK: with length %zu",
74 if (this->grid_rating_voltage_) {
75 this->grid_rating_voltage_->publish_state(value_grid_rating_voltage_);
77 if (this->grid_rating_current_) {
78 this->grid_rating_current_->publish_state(value_grid_rating_current_);
80 if (this->ac_output_rating_voltage_) {
81 this->ac_output_rating_voltage_->publish_state(value_ac_output_rating_voltage_);
83 if (this->ac_output_rating_frequency_) {
84 this->ac_output_rating_frequency_->publish_state(value_ac_output_rating_frequency_);
86 if (this->ac_output_rating_current_) {
87 this->ac_output_rating_current_->publish_state(value_ac_output_rating_current_);
89 if (this->ac_output_rating_apparent_power_) {
90 this->ac_output_rating_apparent_power_->publish_state(value_ac_output_rating_apparent_power_);
92 if (this->ac_output_rating_active_power_) {
93 this->ac_output_rating_active_power_->publish_state(value_ac_output_rating_active_power_);
95 if (this->battery_rating_voltage_) {
96 this->battery_rating_voltage_->publish_state(value_battery_rating_voltage_);
98 if (this->battery_recharge_voltage_) {
99 this->battery_recharge_voltage_->publish_state(value_battery_recharge_voltage_);
101 if (this->battery_under_voltage_) {
102 this->battery_under_voltage_->publish_state(value_battery_under_voltage_);
104 if (this->battery_bulk_voltage_) {
105 this->battery_bulk_voltage_->publish_state(value_battery_bulk_voltage_);
107 if (this->battery_float_voltage_) {
108 this->battery_float_voltage_->publish_state(value_battery_float_voltage_);
110 if (this->battery_type_) {
111 this->battery_type_->publish_state(value_battery_type_);
113 if (this->current_max_ac_charging_current_) {
114 this->current_max_ac_charging_current_->publish_state(value_current_max_ac_charging_current_);
116 if (this->current_max_charging_current_) {
117 this->current_max_charging_current_->publish_state(value_current_max_charging_current_);
119 if (this->input_voltage_range_) {
120 this->input_voltage_range_->publish_state(value_input_voltage_range_);
123 if (this->input_voltage_range_switch_) {
124 this->input_voltage_range_switch_->publish_state(value_input_voltage_range_ == 1);
126 if (this->output_source_priority_) {
127 this->output_source_priority_->publish_state(value_output_source_priority_);
130 if (this->output_source_priority_utility_switch_) {
131 this->output_source_priority_utility_switch_->publish_state(value_output_source_priority_ == 0);
133 if (this->output_source_priority_solar_switch_) {
134 this->output_source_priority_solar_switch_->publish_state(value_output_source_priority_ == 1);
136 if (this->output_source_priority_battery_switch_) {
137 this->output_source_priority_battery_switch_->publish_state(value_output_source_priority_ == 2);
139 if (this->charger_source_priority_) {
140 this->charger_source_priority_->publish_state(value_charger_source_priority_);
142 if (this->parallel_max_num_) {
143 this->parallel_max_num_->publish_state(value_parallel_max_num_);
145 if (this->machine_type_) {
146 this->machine_type_->publish_state(value_machine_type_);
148 if (this->topology_) {
149 this->topology_->publish_state(value_topology_);
151 if (this->output_mode_) {
152 this->output_mode_->publish_state(value_output_mode_);
154 if (this->battery_redischarge_voltage_) {
155 this->battery_redischarge_voltage_->publish_state(value_battery_redischarge_voltage_);
157 if (this->pv_ok_condition_for_parallel_) {
158 this->pv_ok_condition_for_parallel_->publish_state(value_pv_ok_condition_for_parallel_);
161 if (this->pv_ok_condition_for_parallel_switch_) {
162 this->pv_ok_condition_for_parallel_switch_->publish_state(value_pv_ok_condition_for_parallel_ == 1);
164 if (this->pv_power_balance_) {
165 this->pv_power_balance_->publish_state(value_pv_power_balance_ == 1);
168 if (this->pv_power_balance_switch_) {
169 this->pv_power_balance_switch_->publish_state(value_pv_power_balance_ == 1);
174 if (this->grid_voltage_) {
175 this->grid_voltage_->publish_state(value_grid_voltage_);
177 if (this->grid_frequency_) {
178 this->grid_frequency_->publish_state(value_grid_frequency_);
180 if (this->ac_output_voltage_) {
181 this->ac_output_voltage_->publish_state(value_ac_output_voltage_);
183 if (this->ac_output_frequency_) {
184 this->ac_output_frequency_->publish_state(value_ac_output_frequency_);
186 if (this->ac_output_apparent_power_) {
187 this->ac_output_apparent_power_->publish_state(value_ac_output_apparent_power_);
189 if (this->ac_output_active_power_) {
190 this->ac_output_active_power_->publish_state(value_ac_output_active_power_);
192 if (this->output_load_percent_) {
193 this->output_load_percent_->publish_state(value_output_load_percent_);
195 if (this->bus_voltage_) {
196 this->bus_voltage_->publish_state(value_bus_voltage_);
198 if (this->battery_voltage_) {
199 this->battery_voltage_->publish_state(value_battery_voltage_);
201 if (this->battery_charging_current_) {
202 this->battery_charging_current_->publish_state(value_battery_charging_current_);
204 if (this->battery_capacity_percent_) {
205 this->battery_capacity_percent_->publish_state(value_battery_capacity_percent_);
207 if (this->inverter_heat_sink_temperature_) {
208 this->inverter_heat_sink_temperature_->publish_state(value_inverter_heat_sink_temperature_);
210 if (this->pv_input_current_for_battery_) {
211 this->pv_input_current_for_battery_->publish_state(value_pv_input_current_for_battery_);
213 if (this->pv_input_voltage_) {
214 this->pv_input_voltage_->publish_state(value_pv_input_voltage_);
216 if (this->battery_voltage_scc_) {
217 this->battery_voltage_scc_->publish_state(value_battery_voltage_scc_);
219 if (this->battery_discharge_current_) {
220 this->battery_discharge_current_->publish_state(value_battery_discharge_current_);
222 if (this->add_sbu_priority_version_) {
223 this->add_sbu_priority_version_->publish_state(value_add_sbu_priority_version_);
225 if (this->configuration_status_) {
226 this->configuration_status_->publish_state(value_configuration_status_);
228 if (this->scc_firmware_version_) {
229 this->scc_firmware_version_->publish_state(value_scc_firmware_version_);
231 if (this->load_status_) {
232 this->load_status_->publish_state(value_load_status_);
234 if (this->battery_voltage_to_steady_while_charging_) {
235 this->battery_voltage_to_steady_while_charging_->publish_state(
236 value_battery_voltage_to_steady_while_charging_);
238 if (this->charging_status_) {
239 this->charging_status_->publish_state(value_charging_status_);
241 if (this->scc_charging_status_) {
242 this->scc_charging_status_->publish_state(value_scc_charging_status_);
244 if (this->ac_charging_status_) {
245 this->ac_charging_status_->publish_state(value_ac_charging_status_);
247 if (this->battery_voltage_offset_for_fans_on_) {
248 this->battery_voltage_offset_for_fans_on_->publish_state(value_battery_voltage_offset_for_fans_on_ / 10.0f);
250 if (this->eeprom_version_) {
251 this->eeprom_version_->publish_state(value_eeprom_version_);
253 if (this->pv_charging_power_) {
254 this->pv_charging_power_->publish_state(value_pv_charging_power_);
256 if (this->charging_to_floating_mode_) {
257 this->charging_to_floating_mode_->publish_state(value_charging_to_floating_mode_);
259 if (this->switch_on_) {
260 this->switch_on_->publish_state(value_switch_on_);
262 if (this->dustproof_installed_) {
263 this->dustproof_installed_->publish_state(value_dustproof_installed_);
268 if (this->device_mode_) {
269 mode = value_device_mode_;
270 this->device_mode_->publish_state(mode);
275 if (this->silence_buzzer_open_buzzer_) {
276 this->silence_buzzer_open_buzzer_->publish_state(value_silence_buzzer_open_buzzer_);
278 if (this->overload_bypass_function_) {
279 this->overload_bypass_function_->publish_state(value_overload_bypass_function_);
281 if (this->lcd_escape_to_default_) {
282 this->lcd_escape_to_default_->publish_state(value_lcd_escape_to_default_);
284 if (this->overload_restart_function_) {
285 this->overload_restart_function_->publish_state(value_overload_restart_function_);
287 if (this->over_temperature_restart_function_) {
288 this->over_temperature_restart_function_->publish_state(value_over_temperature_restart_function_);
290 if (this->backlight_on_) {
291 this->backlight_on_->publish_state(value_backlight_on_);
293 if (this->alarm_on_when_primary_source_interrupt_) {
294 this->alarm_on_when_primary_source_interrupt_->publish_state(value_alarm_on_when_primary_source_interrupt_);
296 if (this->fault_code_record_) {
297 this->fault_code_record_->publish_state(value_fault_code_record_);
299 if (this->power_saving_) {
300 this->power_saving_->publish_state(value_power_saving_);
305 if (this->warnings_present_) {
306 this->warnings_present_->publish_state(value_warnings_present_);
308 if (this->faults_present_) {
309 this->faults_present_->publish_state(value_faults_present_);
311 if (this->warning_power_loss_) {
312 this->warning_power_loss_->publish_state(value_warning_power_loss_);
314 if (this->fault_inverter_fault_) {
315 this->fault_inverter_fault_->publish_state(value_fault_inverter_fault_);
317 if (this->fault_bus_over_) {
318 this->fault_bus_over_->publish_state(value_fault_bus_over_);
320 if (this->fault_bus_under_) {
321 this->fault_bus_under_->publish_state(value_fault_bus_under_);
323 if (this->fault_bus_soft_fail_) {
324 this->fault_bus_soft_fail_->publish_state(value_fault_bus_soft_fail_);
326 if (this->warning_line_fail_) {
327 this->warning_line_fail_->publish_state(value_warning_line_fail_);
329 if (this->fault_opvshort_) {
330 this->fault_opvshort_->publish_state(value_fault_opvshort_);
332 if (this->fault_inverter_voltage_too_low_) {
333 this->fault_inverter_voltage_too_low_->publish_state(value_fault_inverter_voltage_too_low_);
335 if (this->fault_inverter_voltage_too_high_) {
336 this->fault_inverter_voltage_too_high_->publish_state(value_fault_inverter_voltage_too_high_);
338 if (this->warning_over_temperature_) {
339 this->warning_over_temperature_->publish_state(value_warning_over_temperature_);
341 if (this->warning_fan_lock_) {
342 this->warning_fan_lock_->publish_state(value_warning_fan_lock_);
344 if (this->warning_battery_voltage_high_) {
345 this->warning_battery_voltage_high_->publish_state(value_warning_battery_voltage_high_);
347 if (this->warning_battery_low_alarm_) {
348 this->warning_battery_low_alarm_->publish_state(value_warning_battery_low_alarm_);
350 if (this->warning_battery_under_shutdown_) {
351 this->warning_battery_under_shutdown_->publish_state(value_warning_battery_under_shutdown_);
353 if (this->warning_battery_derating_) {
354 this->warning_battery_derating_->publish_state(value_warning_battery_derating_);
356 if (this->warning_over_load_) {
357 this->warning_over_load_->publish_state(value_warning_over_load_);
359 if (this->warning_eeprom_failed_) {
360 this->warning_eeprom_failed_->publish_state(value_warning_eeprom_failed_);
362 if (this->fault_inverter_over_current_) {
363 this->fault_inverter_over_current_->publish_state(value_fault_inverter_over_current_);
365 if (this->fault_inverter_soft_failed_) {
366 this->fault_inverter_soft_failed_->publish_state(value_fault_inverter_soft_failed_);
368 if (this->fault_self_test_failed_) {
369 this->fault_self_test_failed_->publish_state(value_fault_self_test_failed_);
371 if (this->fault_op_dc_voltage_over_) {
372 this->fault_op_dc_voltage_over_->publish_state(value_fault_op_dc_voltage_over_);
374 if (this->fault_battery_open_) {
375 this->fault_battery_open_->publish_state(value_fault_battery_open_);
377 if (this->fault_current_sensor_failed_) {
378 this->fault_current_sensor_failed_->publish_state(value_fault_current_sensor_failed_);
380 if (this->fault_battery_short_) {
381 this->fault_battery_short_->publish_state(value_fault_battery_short_);
383 if (this->warning_power_limit_) {
384 this->warning_power_limit_->publish_state(value_warning_power_limit_);
386 if (this->warning_pv_voltage_high_) {
387 this->warning_pv_voltage_high_->publish_state(value_warning_pv_voltage_high_);
389 if (this->fault_mppt_overload_) {
390 this->fault_mppt_overload_->publish_state(value_fault_mppt_overload_);
392 if (this->warning_mppt_overload_) {
393 this->warning_mppt_overload_->publish_state(value_warning_mppt_overload_);
395 if (this->warning_battery_too_low_to_charge_) {
396 this->warning_battery_too_low_to_charge_->publish_state(value_warning_battery_too_low_to_charge_);
398 if (this->fault_dc_dc_over_current_) {
399 this->fault_dc_dc_over_current_->publish_state(value_fault_dc_dc_over_current_);
401 if (this->fault_code_) {
402 this->fault_code_->publish_state(value_fault_code_);
404 if (this->warnung_low_pv_energy_) {
405 this->warnung_low_pv_energy_->publish_state(value_warnung_low_pv_energy_);
407 if (this->warning_high_ac_input_during_bus_soft_start_) {
408 this->warning_high_ac_input_during_bus_soft_start_->publish_state(
409 value_warning_high_ac_input_during_bus_soft_start_);
411 if (this->warning_battery_equalization_) {
412 this->warning_battery_equalization_->publish_state(value_warning_battery_equalization_);
430 ESP_LOGD(TAG,
"Decode QPIRI");
431 sscanf(tmp,
"(%f %f %f %f %f %d %d %f %f %f %f %f %d %d %d %d %d %d %d %d %d %d %f %d %d",
432 &value_grid_rating_voltage_, &value_grid_rating_current_, &value_ac_output_rating_voltage_,
433 &value_ac_output_rating_frequency_, &value_ac_output_rating_current_,
434 &value_ac_output_rating_apparent_power_, &value_ac_output_rating_active_power_,
435 &value_battery_rating_voltage_, &value_battery_recharge_voltage_,
436 &value_battery_under_voltage_, &value_battery_bulk_voltage_, &value_battery_float_voltage_,
437 &value_battery_type_, &value_current_max_ac_charging_current_,
438 &value_current_max_charging_current_, &value_input_voltage_range_,
439 &value_output_source_priority_, &value_charger_source_priority_, &value_parallel_max_num_,
440 &value_machine_type_, &value_topology_, &value_output_mode_,
441 &value_battery_redischarge_voltage_, &value_pv_ok_condition_for_parallel_,
442 &value_pv_power_balance_);
443 if (this->last_qpiri_) {
444 this->last_qpiri_->publish_state(tmp);
449 ESP_LOGD(TAG,
"Decode QPIGS");
452 "(%f %f %f %f %d %d %d %d %f %d %d %d %f %f %f %d %1d%1d%1d%1d%1d%1d%1d%1d %d %d %d %1d%1d%1d",
453 &value_grid_voltage_, &value_grid_frequency_, &value_ac_output_voltage_,
454 &value_ac_output_frequency_,
455 &value_ac_output_apparent_power_, &value_ac_output_active_power_, &value_output_load_percent_,
456 &value_bus_voltage_, &value_battery_voltage_, &value_battery_charging_current_,
457 &value_battery_capacity_percent_, &value_inverter_heat_sink_temperature_,
458 &value_pv_input_current_for_battery_, &value_pv_input_voltage_, &value_battery_voltage_scc_,
459 &value_battery_discharge_current_, &value_add_sbu_priority_version_,
460 &value_configuration_status_, &value_scc_firmware_version_, &value_load_status_,
461 &value_battery_voltage_to_steady_while_charging_, &value_charging_status_,
462 &value_scc_charging_status_, &value_ac_charging_status_,
463 &value_battery_voltage_offset_for_fans_on_, &value_eeprom_version_, &value_pv_charging_power_,
464 &value_charging_to_floating_mode_, &value_switch_on_,
465 &value_dustproof_installed_);
466 if (this->last_qpigs_) {
467 this->last_qpigs_->publish_state(tmp);
472 ESP_LOGD(TAG,
"Decode QMOD");
474 if (this->last_qmod_) {
475 this->last_qmod_->publish_state(tmp);
480 ESP_LOGD(TAG,
"Decode QFLAG");
483 for (
size_t i = 1; i < strlen(tmp); i++) {
492 this->value_silence_buzzer_open_buzzer_ = enabled;
495 this->value_overload_bypass_function_ = enabled;
498 this->value_lcd_escape_to_default_ = enabled;
501 this->value_overload_restart_function_ = enabled;
504 this->value_over_temperature_restart_function_ = enabled;
507 this->value_backlight_on_ = enabled;
510 this->value_alarm_on_when_primary_source_interrupt_ = enabled;
513 this->value_fault_code_record_ = enabled;
516 this->value_power_saving_ = enabled;
520 if (this->last_qflag_) {
521 this->last_qflag_->publish_state(tmp);
526 ESP_LOGD(TAG,
"Decode QPIWS");
529 this->value_warnings_present_ =
false;
530 this->value_faults_present_ =
true;
532 for (
size_t i = 1; i < strlen(tmp); i++) {
533 enabled = tmp[i] ==
'1';
536 this->value_warning_power_loss_ = enabled;
537 this->value_warnings_present_ += enabled;
540 this->value_fault_inverter_fault_ = enabled;
541 this->value_faults_present_ += enabled;
544 this->value_fault_bus_over_ = enabled;
545 this->value_faults_present_ += enabled;
548 this->value_fault_bus_under_ = enabled;
549 this->value_faults_present_ += enabled;
552 this->value_fault_bus_soft_fail_ = enabled;
553 this->value_faults_present_ += enabled;
556 this->value_warning_line_fail_ = enabled;
557 this->value_warnings_present_ += enabled;
560 this->value_fault_opvshort_ = enabled;
561 this->value_faults_present_ += enabled;
564 this->value_fault_inverter_voltage_too_low_ = enabled;
565 this->value_faults_present_ += enabled;
568 this->value_fault_inverter_voltage_too_high_ = enabled;
569 this->value_faults_present_ += enabled;
572 this->value_warning_over_temperature_ = enabled;
573 this->value_warnings_present_ += enabled;
576 this->value_warning_fan_lock_ = enabled;
577 this->value_warnings_present_ += enabled;
580 this->value_warning_battery_voltage_high_ = enabled;
581 this->value_warnings_present_ += enabled;
584 this->value_warning_battery_low_alarm_ = enabled;
585 this->value_warnings_present_ += enabled;
588 this->value_warning_battery_under_shutdown_ = enabled;
589 this->value_warnings_present_ += enabled;
592 this->value_warning_battery_derating_ = enabled;
593 this->value_warnings_present_ += enabled;
596 this->value_warning_over_load_ = enabled;
597 this->value_warnings_present_ += enabled;
600 this->value_warning_eeprom_failed_ = enabled;
601 this->value_warnings_present_ += enabled;
604 this->value_fault_inverter_over_current_ = enabled;
605 this->value_faults_present_ += enabled;
608 this->value_fault_inverter_soft_failed_ = enabled;
609 this->value_faults_present_ += enabled;
612 this->value_fault_self_test_failed_ = enabled;
613 this->value_faults_present_ += enabled;
616 this->value_fault_op_dc_voltage_over_ = enabled;
617 this->value_faults_present_ += enabled;
620 this->value_fault_battery_open_ = enabled;
621 this->value_faults_present_ += enabled;
624 this->value_fault_current_sensor_failed_ = enabled;
625 this->value_faults_present_ += enabled;
628 this->value_fault_battery_short_ = enabled;
629 this->value_faults_present_ += enabled;
632 this->value_warning_power_limit_ = enabled;
633 this->value_warnings_present_ += enabled;
636 this->value_warning_pv_voltage_high_ = enabled;
637 this->value_warnings_present_ += enabled;
640 this->value_fault_mppt_overload_ = enabled;
641 this->value_faults_present_ += enabled;
644 this->value_warning_mppt_overload_ = enabled;
645 this->value_warnings_present_ += enabled;
648 this->value_warning_battery_too_low_to_charge_ = enabled;
649 this->value_warnings_present_ += enabled;
652 this->value_fault_dc_dc_over_current_ = enabled;
653 this->value_faults_present_ += enabled;
658 this->value_fault_code_ = parse_number<int>(fc).value_or(0);
661 this->value_warnung_low_pv_energy_ = enabled;
662 this->value_warnings_present_ += enabled;
665 this->value_warning_high_ac_input_during_bus_soft_start_ = enabled;
666 this->value_warnings_present_ += enabled;
669 this->value_warning_battery_equalization_ = enabled;
670 this->value_warnings_present_ += enabled;
674 if (this->last_qpiws_) {
675 this->last_qpiws_->publish_state(tmp);
680 ESP_LOGD(TAG,
"Decode QT");
681 if (this->last_qt_) {
682 this->last_qt_->publish_state(tmp);
687 ESP_LOGD(TAG,
"Decode QMN");
688 if (this->last_qmn_) {
689 this->last_qmn_->publish_state(tmp);
745 ESP_LOGD(TAG,
"timeout command from queue: %s", command);
773 ESP_LOGD(TAG,
"checking crc on incoming message");
776 ESP_LOGD(TAG,
"CRC OK");
782 ESP_LOGD(TAG,
"CRC NOK expected: %X %X but got: %X %X", ((uint8_t) ((crc16) >> 8)), ((uint8_t) ((crc16) &0xff)),
792 uint8_t byte_command[16];
794 for (uint8_t i = 0; i <
length; i++) {
804 this->
write(((uint8_t) ((crc16) >> 8)));
805 this->
write(((uint8_t) ((crc16) &0xff)));
808 ESP_LOGD(TAG,
"Sending command from queue: %s with length %d", command, length);
833 this->
write(((uint8_t) ((crc16) >> 8)));
834 this->
write(((uint8_t) ((crc16) &0xff)));
837 ESP_LOGD(TAG,
"Sending polling command : %s with length %d",
845 uint8_t testposition = (next_position + i) % COMMAND_QUEUE_LENGTH;
848 ESP_LOGD(TAG,
"Command queued successfully: %s with length %u at position %d", command,
853 ESP_LOGD(TAG,
"Command queue full dropping command: %s", command);
856 void Pipsolar::switch_command(
const std::string &command) {
857 ESP_LOGD(TAG,
"got command: %s", command.c_str());
860 void Pipsolar::dump_config() {
861 ESP_LOGCONFIG(TAG,
"Pipsolar:");
862 ESP_LOGCONFIG(TAG,
"used commands:");
864 if (used_polling_command.length != 0) {
865 ESP_LOGCONFIG(TAG,
"%s", used_polling_command.command);
869 void Pipsolar::update() {}
873 if (used_polling_command.length == strlen(command)) {
874 uint8_t
len = strlen(command);
875 if (memcmp(used_polling_command.command, command, len) == 0) {
879 if (used_polling_command.length == 0) {
880 size_t length = strlen(command) + 1;
881 const char *beg = command;
883 used_polling_command.command =
new uint8_t[
length];
885 for (; beg !=
end; ++beg, ++i) {
886 used_polling_command.command[i] = (uint8_t) (*beg);
888 used_polling_command.errors = 0;
889 used_polling_command.identifier = polling_command;
890 used_polling_command.length = length - 1;
898 uint8_t crc_low = crc & 0xff;
899 uint8_t crc_high = crc >> 8;
900 if (crc_low == 0x28 || crc_low == 0x0d || crc_low == 0x0a)
902 if (crc_high == 0x28 || crc_high == 0x0d || crc_high == 0x0a)
904 crc = (crc_high << 8) | crc_low;
void write_str(const char *str)
uint32_t update_interval_
std::string command_queue_[COMMAND_QUEUE_LENGTH]
static const size_t COMMAND_QUEUE_LENGTH
uint16_t crc16be(const uint8_t *data, uint16_t len, uint16_t crc, uint16_t poly, bool refin, bool refout)
uint8_t check_incoming_crc_()
void write_array(const uint8_t *data, size_t len)
uint8_t check_incoming_length_(uint8_t length)
static const size_t COMMAND_TIMEOUT
uint8_t read_buffer_[PIPSOLAR_READ_BUFFER_LENGTH]
void add_polling_command_(const char *command, ENUMPollingCommand polling_command)
uint16_t crc16(const uint8_t *data, uint16_t len, uint16_t crc, uint16_t reverse_poly, bool refin, bool refout)
Calculate a CRC-16 checksum of data with size len.
uint32_t IRAM_ATTR HOT millis()
uint16_t pipsolar_crc_(uint8_t *msg, uint8_t len)
uint32_t command_start_millis_
bool read_byte(uint8_t *data)
void queue_command_(const char *command, uint8_t length)
BedjetMode mode
BedJet operating mode.
static const size_t PIPSOLAR_READ_BUFFER_LENGTH
PollingCommand used_polling_commands_[15]
uint8_t last_polling_command_
uint8_t send_next_command_()
uint8_t command_queue_position_
void empty_uart_buffer_()
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
size_t write(uint8_t data)