feat: implement modbus reset command and update docs/tool

This commit is contained in:
2025-07-02 09:55:42 +02:00
parent f486d4c4ab
commit 85d493f24a
3 changed files with 10 additions and 0 deletions

View File

@@ -110,6 +110,12 @@ static int holding_reg_wr(uint16_t addr, uint16_t reg)
k_timer_stop(&watchdog_timer);
}
break;
case REG_HOLDING_DEVICE_RESET:
if (reg == 1) {
LOG_WRN("Modbus reset command received. Rebooting...");
sys_reboot(SYS_REBOOT_WARM);
}
break;
default:
fwu_handler(addr, reg);
break;

View File

@@ -223,6 +223,9 @@ def main_menu(stdscr, slave_id):
except Exception as e: message = f"-> Error: {e}"
elif selected_option == "Set Watchdog":
input_mode, input_prompt, input_target_reg = True, "Enter Watchdog Timeout (s): ", REG_HOLDING_WATCHDOG_TIMEOUT_S
elif selected_option == "Reset Node":
client.write_register(REG_HOLDING_DEVICE_RESET, 1, slave=slave_id)
message = "-> Sent RESET command"
elif selected_option == "Firmware Update":
filepath = file_browser(stdscr)
if filepath: