Skip to content

ping does not return a time (always says 0.0 or None) #9348

@gitcnd

Description

@gitcnd

CircuitPython version

Adafruit CircuitPython 9.1.0-beta.3 on 2024-05-22; Ai Thinker ESP32-CAM with ESP32

Code/REPL

>>> import time
>>> import wifi
>>> import ipaddress
>>> ip1 = ipaddress.ip_address("196.1.56.26") # this is deliberately a very slow server in S.A.
>>> print(wifi.radio.ping(ip1))
None
>>> print(wifi.radio.ping(ip1,timeout=2))
0.0
>>> ip1 = ipaddress.ip_address("1.1.1.1")
>>> print(wifi.radio.ping(ip1))
0.0
>>> print(wifi.radio.ping(ip1))
0.0
>>>

Behavior

prints 0.0

Description

should print times - here's what linux does:-

$ ping -c 1 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=58 time=476 ms

--- 1.1.1.1 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 476.281/476.281/476.281/0.000 ms
$ ping -c 1 196.1.56.26
PING 196.1.56.26 (196.1.56.26) 56(84) bytes of data.
64 bytes from 196.1.56.26: icmp_seq=1 ttl=45 time=1185 ms

--- 196.1.56.26 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 1184.691/1184.691/1184.691/0.000 ms

Additional information

No response

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions