Add AutoIP option to network options for link local addressing #27048
+29
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
Allow a zero-configuration of IP addressing a vehicle using IPv4 link local addressing.
This is enabled with bit 1 of the
NET_OPTIONS
parameter enabled to turn onAUTOIP
.Link local is great because you don't need to bother with all the fiddly
NET_IPADDR
params.Sensor data (such as the Trimble PX-1) can take advantage of Multicast to send sensor data to the cube, and neither the Cube nor the PX1 need to know the other's address. This makes it easier to swap hardware with less configuration.
If a DHCP server is not available on the vehicle, because
LWIP_DHCP_AUTOIP_COOP
is enabled on our builds, this means that LWIP will automatically start a link local address in place of that. In theory, if a DHCP server started later (such as one running on a non-RTOS linux such as PI that takes a while to boot), LWIP will drop the link local address and switch to DHCP. I haven't tested that specific case yet.Setting up a DHCP server or static addressing on a vehicle is not easy for everyone. Setting a single bit in ArduPilot NET options is easier than that.
How to reproduce
Or, with netplan in
/etc/netplan/01-network-manager-all.yaml
:Reboot the cube
Open mavproxy consol
Observe in the logs it gets a
169.254
address, and so does your computerPing the Cube's address
Demo