I am trying to use World Time Api to get the ip address assigned by my ISP. In Micro Python on an RPi Pico W my_ip = json["client_ip"]
returns an ipv4 address and in Python3 on a RPi 4B it returns an ipv6 address. I would like to get the ipv4 version in both cases. How do I get the ipv4 address in Python3 on a RPi 4B using Python3?
Asked
Active
Viewed 58 times
0

William Burlingame
- 21
- 2
-
Try this https://raspberrypi.stackexchange.com/questions/23884/force-ipv4-address – Steve Robillard Sep 05 '22 at 16:57
-
Steve, thanks for the response. Since I have already used MQTT to send messages between devices, I decided to send the IPv4 using MQTT rather than delve into your link. – William Burlingame Sep 07 '22 at 17:11