ovms_netmanager: working network ping with per-interface routing + dns command#1387
ovms_netmanager: working network ping with per-interface routing + dns command#1387samr037 wants to merge 1 commit intoopenvehicles:masterfrom
Conversation
…s command
The existing 'network ping' command was gated behind CONFIG_OVMS_DEV_NETMANAGER_PING
and called esp_ping_new_session() which is not provided by this ESP-IDF fork — it was
a non-linkable stub that would have failed to build if the dev flag had been enabled.
This commit:
- Reimplements network_ping on top of LwIP raw sockets (no ESP-IDF version coupling)
- Adds optional flags:
-I <iface> source interface (e.g. st1, pp2) for multi-interface routing tests
-c <count> number of pings (1-100, default 4)
-s <size> payload bytes (0-1400, default 32)
- Adds new 'network dns <hostname>' command (A/AAAA lookup via getaddrinfo)
- Removes the CONFIG_OVMS_DEV_NETMANAGER_PING ifdef gate (now production-ready)
The -I flag uses bind-to-source-IP (LwIP in this ESP-IDF fork lacks SO_BINDTODEVICE),
which lets users probe specific interfaces — useful for debugging cellular path
issues when WiFi is also up and owns the default route.
Tested on HW 3.3 / SIM7600:
- ping 8.8.8.8 : 4/4 via WiFi (~10ms, ttl 116)
- ping 8.8.8.8 -I pp2 : 4/4 via LTE (~70-180ms, ttl 114, src 10.111.x.x)
- ping 8.8.8.8 -I st1 : 4/4 via WiFi (~10ms, ttl 116, src 192.168.x.x)
- ping 192.168.50.254 -I pp2 : 100% loss (LAN unreachable from cellular — correct)
- ping doesnotexist.invalid : clean DNS error
- dns google.com : returns A record
- PPP Connects counter unchanged across all probes (no session disruption)
|
Sam, the current Adding the DNS lookup is also a good idea, but I'd rather have the command named as Generally, when adding new user level features, a brief description needs to be added to the As we're tight on remaining flash space, this probably won't be merged until 3.3.006 has been finalized. More things to address:
A suggestion on the interface selection: we never have more than one interface of a kind, and needing to look up the currently assigned interface number first is a PITA especially for scripts. I suggest accepting just the interface name without number, e.g. The DNS lookup could also do a Regards, |
The existing 'network ping' command was gated behind CONFIG_OVMS_DEV_NETMANAGER_PING
and called esp_ping_new_session() which is not provided by this ESP-IDF fork — it was
a non-linkable stub that would have failed to build if the dev flag had been enabled.
This commit:
-I source interface (e.g. st1, pp2) for multi-interface routing tests
-c number of pings (1-100, default 4)
-s payload bytes (0-1400, default 32)
The -I flag uses bind-to-source-IP (LwIP in this ESP-IDF fork lacks SO_BINDTODEVICE),
which lets users probe specific interfaces — useful for debugging cellular path
issues when WiFi is also up and owns the default route.
Tested on HW 3.3 / SIM7600: