Skip to content

Use native RouterOS power-cycle API and fix PoE port discovery#46

Merged
widgetii merged 1 commit intomasterfrom
feature/routeros-power-cycle
Apr 20, 2026
Merged

Use native RouterOS power-cycle API and fix PoE port discovery#46
widgetii merged 1 commit intomasterfrom
feature/routeros-power-cycle

Conversation

@widgetii
Copy link
Copy Markdown
Member

Summary

  • Use MikroTik's native /interface/ethernet/poe/power-cycle command instead of manual off/sleep/on — atomic, switch-managed timing
  • Fix PoE port discovery: bidirectional substring match so serial label hi3516av300_imx415 matches RouterOS comment hi3516av300 (skip empty comments)
  • Default power_on restore to forced-on instead of auto-on
  • Start handshake (flooding 0xAA) concurrently with power-cycle so fast-boot devices are caught

Test plan

  • uv run pytest tests/ -x -v --ignore=tests/fuzz — 326 passed
  • Full install on hi3516av300 with --power-cycle — success (U-Boot + kernel + rootfs, all CRC verified)

🤖 Generated with Claude Code

- Use `/interface/ethernet/poe/power-cycle` instead of manual
  off/sleep/on for atomic power cycling with switch-managed timing
- Fix PoE port discovery to match bidirectionally: serial port label
  `hi3516av300_imx415` now matches RouterOS comment `hi3516av300`
- Skip empty comments in port matching to avoid false positives
- Default power_on restore mode to `forced-on` instead of `auto-on`
- Start handshake before power-cycle so continuous ACK catches
  fast-boot devices

Tested: full install on hi3516av300 with --power-cycle flag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@widgetii widgetii merged commit 248d81d into master Apr 20, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant