Motivation
In #938 we improved connectivity check by replacing ping with arp lookup.
But we still poll every 5 seconds which delays the update of the ip address on the display (and reconfiguring cockpit / mediamtx)
ToDo
We can probably use ip monitor instead. e.g:
async function watchNeighbor(ip, dev = wired_interface, onChange) {
for await (const line of $`ip --json monitor neigh dev ${dev}`) {
// bug not actually json
// https://bugs.launchpad.net/ubuntu/+source/iproute2/+bug/2116779
if (line.includes(ip)) {
const reachable = line.includes('lladdr') && !line.includes('FAILED')
onChange(reachable)
}
}
}
Motivation
In #938 we improved connectivity check by replacing
pingwith arp lookup.But we still poll every 5 seconds which delays the update of the ip address on the display (and reconfiguring cockpit / mediamtx)
ToDo
We can probably use
ip monitorinstead. e.g: